asp-classic
  • paypal
  • 2010-06-17 107 views 0 likes 
    0

    快速結帳我想達到的目的:alt text貝寶購物車

    所以在我的購物車頁面我設置session("Payment_Amount") = total 和下載都ASP文件嚮導告訴我的。 expresschecout.asppaypalfunctions.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但頁面留利,並稱完成在狀態酒吧。我該如何調試? :/

    編輯加了我CODE,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 
    %> 
    

    我猜測我得到的錯誤之一,從底部,但無法找到在哪裏看到THM ..

    回答

    3

    它有點不清楚至於您遇到的具體問題是什麼,但以下是您需要完成的事件順序,才能使用PayPal快速結帳付款方式。這一系列事件的上下文將是您的購物車或您的快速結賬按鈕所在的任何頁面。

    • 創建ExpressCheckOut類的實例

    • 集ApiSignature,用戶名,密碼,環境,APIVersion,OrderAmount,OrderItemDetails,CancelUrl的ExpressCheckOut類RETURNURL。

    • 致電ExpressCheckout並獲得ExpressCheckoutResponse。

    • 檢查ExpressCheckoutResponse對象的成功或失敗。

    • 如果成功,則使用您從ExpressCheckoutResponse對象收到的令牌將用戶重定向到正確的PayPal端點。

    希望這給你一些清晰的如何正確使用這個PayPal API。

    享受!

    +0

    我把代碼:)可以請你幫我..(我與此失敗2.5周:( – 2010-06-17 22:39:24

    相關問題