Make a server-side API call to create the order and save the card at the same time. When a payer is using a card to check out, the Orders API can capture the payment in a single request.
Use 3D Secure authentication to reduce the likelihood of fraud and improve transaction performance with supported cards. In some countries, authorizing a card can trigger a 3D Secure contingency. 3D Secure verification may occur in PSD2 countries, including members of the EU. For 3D Secure verification, pass SCA_ALWAYS
or SCA_WHEN_REQUIRED
in the payment_source.card.attributes.verification.method field for the create order request. The API response returns the order status as PAYER_ACTION_REQUIRED
.
Save card fields for a returning payer
Create your own UI to show saved payment methods for returning payers.
Call the List All Payment Tokens API server-side to retrieve all payment methods saved for a payer. Identify the payer using the PayPal-generated customer.id
. From this list, you can show all saved payment methods to a payer to allow them to select one during checkout.
In the following sample, the authorize and capture requests occur in a single request, and the card is stored in the vault with 3D Secure verification when required.