i wish to achieve:
so in my shopping cart page i set session("Payment_Amount") = total
and downloaded both asp files the wizard told me. expresschecout.asp and paypalfunctions.asp. and added the API credentials to the corect place.
and i add the form from their wizard:
<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>
But when i go to my shopping cart and press on the paypal submit button i am taken to expressheckout.asp but the page stays whit, saying Done in the status bar. how can i debug that? :/
EDIT ADDED MY 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
%>
i am guessing i am getting one of the errors from the bottom but cant find where to see thm..
Its a bit unclear as to what the specific problem you are having is, but here is the sequence of events you need to complete in order to use the PayPal express checkout method of payment. This sequence of events' context would be your shopping cart or whatever page your express checkout button is on.
Create an instance of the ExpressCheckOut class
Set ApiSignature, UserName, Password, Environment, APIVersion, OrderAmount, OrderItemDetails, CancelUrl, ReturnUrl of the ExpressCheckOut class.
Call ExpressCheckout and get a ExpressCheckoutResponse.
Check the ExpressCheckoutResponse object for success or failure.
If success then redirect user to the correct PayPal endpoint with the token you received from the ExpressCheckoutResponse object.
Hope this gives you some clarity on how to correctly use this PayPal api.
Enjoy!
精彩评论