Integrate Express Checkout with Transaction Risk
Last updated: Sept 23rd, 4:26pm
PayPal partners and merchants can Set transaction context to send additional data about a customer to PayPal so that PayPal can complete a pre-transaction risk management evaluation before PayPal processes the customer transaction.
The Express Checkout feature implements a button that gives customers another way to pay and complements any existing payment solution. This enables online shoppers to pay with their PayPal balance, bank account, or credit card. You can integrate the REST Transaction Risk API Set transaction context feature with the classic Express Checkout feature to mitigate the risk before the actual PayPal transaction completes.
When a customer initiates a checkout, you make a classic SetExpressCheckout
call to specify the payment action, the amount of the payment, the return URL, and the cancel URL:
1curl -s --insecure https://api-3t.sandbox.paypal.com/nvp -d \2 "USER=<callerID> # User ID of the PayPal caller account \3 &PWD=<callerPswd> # Password of the caller account \4 &SIGNATURE=<callerSig> # Signature of the caller account \5 &METHOD=SetExpressCheckout \6 &VERSION=93 \7 &PAYMENTREQUEST_0_PAYMENTACTION=SALE # type of payment \8 &PAYMENTREQUEST_0_AMT=19.95 # amount of transaction \9 &PAYMENTREQUEST_0_CURRENCYCODE=USD # currency of transaction \10 &RETURNURL=https://example.com/success # URL of your payment confirmation page \11 &CANCELURL=https://example.com/cancel" # URL redirect if customer cancels payment
If the SetExpressCheckout
request succeeds, it returns a token string in the TOKEN
response field. The default lifetime of this token is three hours. This token is required in subsequent steps.
Integration process flow
This sequence diagram illustrates the integration process flow: