Test Your Integration and Execute the Payment

To complete the payment flow, you should issue a request to execute the payment. Payment execution can be initiated from the final order review page or in the background upon return from the hosted pages (when there is no order review page).

When you execute the payment, submit any updates to the shipping address and the shipping and handling charges with the request. Do not change item list.

The payer_id needed to execute the payment is provided in the response from the doContinue function together with the rememberedCards.

Example

The following sample shows how to issue a request to execute payment in the sandbox environment.

Handling errors

When an error is thrown a response object that contains the error code and resolution is posted to the checkout page and sent to the onError callback. Sometimes the error just requires action by the payer and in those cases a message is displayed within the payment wall instructing the payer how to proceed. Those errors are still sent to the onError callback for logging and debugging purposes.

The table lists most errors and the recommended action. To resolve any errors that are not listed below, get a new ecToken from create payment and ask the payer to use a different card.

Cause

Action

CHECK_ENTRYTRY_ANOTHER_CARDSET_INSTALLMENTS_FAIL

None.

INVALID_OR_EXPIRED_TOKENINTERNAL_ERROR

Get a new ecToken from create payment and start a new PayPal Plus session.

MISSING_EXPERIENCE_PROFILE_ID

All transactions must include an experience profile as described in this document.

INVALID_DATA_FIRST_NAMEINVALID_DATA_LAST_NAME

The country code is missing or invalid. Collect a valid country code, get a new ecToken from create payment and start a new PayPal Plus session.

INVALID_DATA_COUNTRY_CODEMISSING_DATA_COUNTRY_CODE

The country code is missing or invalid. Collect a valid country code, get a new ecToken from create payment and start a new PayPal Plus session.

INVALID_DATA_ADDRESS

The shipping address provided is invalid. Collect a valid address, get a new ecToken from create payment and start a new PayPal Plus session.