PayPal快速结账购物车

时间:2010-06-17 21:58:00

标签: asp-classic paypal

我希望实现:alt text

所以在我的购物车页面中,我设置了session("Payment_Amount") = total 并下载了向导告诉我的两个asp文件。 expresschecout.asp paypalfunctions.asp 。并将API凭据添加到corect位置。 我从他们的向导中添加表单:

<form action='expresscheckout.asp' METHOD='POST'>
<input type='image' name='submit' src='https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif' border='0' align='top' alt='Check out with PayPal'/>
</form>

但是当我去购物车并按下贝宝提交按钮时,我被带到了expressheckout.asp,但页面保持白色,在状态栏中说完了。我怎么调试呢? :/

编辑添加了我的代码,ASP:

<!-- #include file ="paypalfunctions.asp" -->
<%
' ==================================
' PayPal Express Checkout Module
' ==================================

On Error Resume Next

'------------------------------------
' The paymentAmount is the total value of 
' the shopping cart, that was set 
' earlier in a session variable 
' by the shopping cart page
'------------------------------------
paymentAmount = Session("Payment_Amount")

'------------------------------------
' The currencyCodeType and paymentType 
' are set to the selections made on the Integration Assistant 
'------------------------------------
currencyCodeType = "USD"
paymentType = "Sale"

'------------------------------------
' The returnURL is the location where buyers return to when a
' payment has been succesfully authorized.
'
' This is set to the value entered on the Integration Assistant 
'------------------------------------
returnURL = "http://www.noamsm.co.il/index.asp"

'------------------------------------
' The cancelURL is the location buyers are sent to when they click the
' return to XXXX site where XXX is the merhcant store name
' during payment review on PayPal
'
' This is set to the value entered on the Integration Assistant 
'------------------------------------
cancelURL = "http://www.noamsm.co.il/index.asp"

'------------------------------------
' Calls the SetExpressCheckout API call
'
' The CallShortcutExpressCheckout function is defined in the file PayPalFunctions.asp,
' it is included at the top of this file.
'-------------------------------------------------
Set resArray = CallShortcutExpressCheckout (paymentAmount, currencyCodeType, paymentType, returnURL, cancelURL)

ack = UCase(resArray("ACK"))
If ack="SUCCESS" Then
    ' Redirect to paypal.com
    ReDirectURL( resArray("TOKEN") )
Else  
    'Display a user friendly Error on the page using any of the following error information returned by PayPal
    ErrorCode = URLDecode( resArray("L_ERRORCODE0"))
    ErrorShortMsg = URLDecode( resArray("L_SHORTMESSAGE0"))
    ErrorLongMsg = URLDecode( resArray("L_LONGMESSAGE0"))
    ErrorSeverityCode = URLDecode( resArray("L_SEVERITYCODE0"))
End If
%>

我猜我从底部得到一个错误,但无法找到在哪里看到..

1 个答案:

答案 0 :(得分:3)

关于您遇到的具体问题,我们有点不清楚,但这里是您需要完成的一系列事件才能使用PayPal快速结账付款方式。这一系列事件的上下文将是您的购物车或您的快速结账按钮所在的任何页面。

  • 创建ExpressCheckOut类的实例

  • 设置ExpressCheckOut类的A​​piSignature,UserName,Password,Environment,APIVersion,OrderAmount,OrderItemDetails,CancelUrl,ReturnUrl。

  • 致电ExpressCheckout并获取ExpressCheckoutResponse。

  • 检查ExpressCheckoutResponse对象是否成功。

  • 如果成功,则使用从ExpressCheckoutResponse对象收到的令牌将用户重定向到正确的PayPal端点。

希望这能让您清楚了解如何正确使用此PayPal API。

享受!