- No verification
- Smart authorization
- 3D Secure verification
Prerequisites
You’ll need a Payment Method Tokens API cards integration.No verification
For cards with no verification, the card data passed to the API is checked only for format.Sample request for setup token with no verification
- Change
ACCESS-TOKEN
to your sandbox access token. - Change
REQUEST-ID
to a unique alphanumeric set of characters, for example, a time stamp.
Sample response for setup token with no verification
A successful request returns the following:- An HTTP response code of
200
or201
. Returns200
for an idempotent request. - The ID of the token in the
id
field. - HATEOAS links
Smart authorization
Smart authorization runs a zero-value or minimal-value authorization to validate the card is real and active. Some issuing banks or regions don’t support zero-value authorization, so a minimal-value authorization is run. The seller must manually cancel minimal-value authorizations or the customer will have a small pending charge on their card.Sample request for setup token with smart authorization
- Change
ACCESS-TOKEN
to your sandbox access token. - Change
REQUEST-ID
to a set of unique alphanumeric characters such as a time stamp. - Use the card as the payment source and complete the rest of the source object for your use case and business.
- Pass the
verification_method
parameter withSCA_WHEN_REQUIRED
to verify card data. - Update the
return_url
value with the URL where the payer is redirected after they approve the flow. - Update the
cancel_url
value with the URL where the payer is redirected after they cancel the flow.
Sample response for setup token with smart authorization
A successful request returns the following:- An HTTP response code of
200
or201
. Returns200
for an idempotent request. - A status of
APPROVED
- The ID of the token in the
id
field. - HATEOAS links
3D Secure
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, passSCA_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
.
Sample request for setup token with 3D Secure
- Change
ACCESS-TOKEN
to your sandbox access token. - Change
REQUEST-ID
to a set of unique alphanumeric characters such as a time stamp. - Use the card as the payment source and complete the rest of the source object for your use case and business.
- Pass the
verification_method
parameter withSCA_ALWAYS
to verify card data. - Update the
return_url
value with the URL where the payer is redirected after they approve the flow. - Update the
cancel_url
value with the URL where the payer is redirected after they cancel the flow.
Sample response for setup token with 3D Secure
A successful request returns the following:- An HTTP response code of
200
or201
. Returns200
for an idempotent request. - A status of
PAYER_ACTION_REQUIRED
- HATEOAS links
Convert approved setup token to payment token
After the payer completes verification, make aPOST
request on the payment token endpoint to convert the approved setup token to a payment token.
To retrieve 3D secure verification data associated with a setup token, make a GET
request on the setup token endpoint.
Sample request
Sample response
A successful request returns the following:- An HTTP response code of
200 OK
- A status of
APPROVED
Parameter | Description |
---|---|
verification_method | The verification method value from the request is included in the response. |
verification_status | If the card is authorized, the status is set to VERIFIED . |
authorization | Details from the authorization are returned in an authorization object. This includes the amount and currency requested, and the AVS and CVV results from the processor response. |
APPROVED
status and the processor responses are returned to you. The eci_flag
parameter indicates that 3D Secure was not completed.
You can choose whether to use a card that did not complete 3D Secure or failed AVS and CVV checks:
- To use the card, make a
POST
request on add-payment-token. Convert the approved setup token to a full payment token. - To reject the card, don’t add the payment token or convert it to a full payment token.
Test AVS and CVV response codes
Generate AVS and CVV response codes when running tests in the PayPal sandbox. Use test card numbers.Generate AVS response
Setaddress_line_1
to the following values to generate an AVS response.
Address Line 1 | AVS Response | Visa | Mastercard | American Express | Discover |
---|---|---|---|---|---|
AVS_A_971 | A | Yes | Yes | Yes | Yes |
AVS_B_972 | B | Yes | No | No | No |
AVS_C_973 | C | Yes | No | No | No |
AVS_D_974 | D | Yes | No | Yes | No |
AVS_E_975 | E | No | Yes | Yes | No |
AVS_F_976 | F | Yes | No | Yes | No |
AVS_G_977 | G | Yes | No | No | Yes |
AVS_I_979 | I | Yes | No | No | No |
AVS_K_981 | K | No | No | Yes | No |
AVS_L_982 | L | No | No | Yes | No |
AVS_M_983 | M | Yes | No | Yes | No |
AVS_N_984 | N | Yes | Yes | Yes | Yes |
AVS_O_985 | O | No | No | Yes | No |
AVS_P_986 | P | Yes | No | No | No |
AVS_R_988 | R | Yes | Yes | Yes | Yes |
AVS_S_989 | S | Yes | Yes | Yes | Yes |
AVS_U_991 | U | Yes | Yes | Yes | Yes |
AVS_W_993 | W | Yes | Yes | Yes | Yes |
AVS_X_994 | X | Yes | Yes | No | Yes |
AVS_Y_995 | Y | Yes | Yes | Yes | Yes |
AVS_Z_996 | Z | Yes | Yes | Yes | Yes |
Generate CVV response
Set the CVV to the following values to generate a CVV response:CVV | CVV response | Description |
---|---|---|
115 | M | CVV2/CVC2/CID Match |
116 | N | CVV2/CVC2/CID No Match |
120 | P | Not Processed |
123 | S | CVV2 should be on the card, but merchant indicated that it was not |
125 | U | Unknown/Issuer does not participate |
130 | X | Server provider did not respond (default) |