...
You may implement PayPal’s SDK to take advantage of Venmo and Pay Later payment options through PayPal. Other payment options are coming soon.
Full PayPal documentation on this approach is here:
PayPal SDK: https://developer.paypal.com/sdk/js/reference/
SDK Performance Optimization: https://developer.paypal.com/sdk/js/performance/
Note |
---|
|
...
Conditional Parameter:
If QA or Capture on Shipment is enabled in the campaign then include intent=authorize
PayPal SDK will not work with multiple transactions. Do not use Capture on Shipment with both a physical and digital product on the order. Those will be separate transactions.
See this link for full details: https://developer.paypal.com/sdk/js/configuration/#link-configureandcustomizeyourintegration
...
onClick (Call the Import Order API to retrieve the create order parameters. It must include paypalSdk = 1 with other required parameters)
It is important that you bind the Import Order call to the PayPal checkout button.
Be sure to include the sessionId and orderId from the previous steps, if known
There are PayPal specific requirements that need to be passed to Import Order:
paySource = 'PAYPAL'
paypalBillerId is the value assigned to your PayPal Commerce gateway, found on your gateway list.
prepaidType = PAYPAL_VENMO or PAYPAL_PAYLATER (if PayPal button is clicked then do not send this parameter)
salesUrl = the checkout page full url
createOrder (Create a PayPal order using the parameters received from the “onClick” function)
onApprove (PayPal approved the order. To process the order in CheckoutChamp and complete it in PayPal pass the “orderID” and “payerID” to Confirm PayPal API. It must include paypalSdk = 1)
onCancel (PayPal users canceled the payment or closed the payment screen)
onError (Error from PayPal)
...