Widget External Tokens

SecurePay External Tokens

Last updated:April 30, 2024

SecurePay allows you to securely collect card, bank account or customer data from the shopper and initiate provisioning of an external token with the third party vendor.

To better understand external tokens for eCommerce and inStore, please read Tokenization Guide.

Use cases

Standalone tokenization

The merchant collects card data from the shopper via widget and initiates external tokenization. No payment request/flow is involved. An external token is synchronously created by the third party vendor and returned to the merchant so it can be stored. The external token can then be used in subsequent payments.


How it works

Prepare the checkout

Send the request parameters server-to-server to prepare the tokenization form.

Create the tokenization form

Display the tokenization form on your checkout page. Shopper submits the card information to create external token.

Get the tokenization status

Find out if the external token was successful.

Transactions:
RG
RG
CT
CT

1. Prepare the checkout

Perform a server-to-server POST request to prepare the checkout with the required customer data, including createToken=EXTERNAL but excluding paymentType. The response to a successful request is an id required in the second step to create the registration form.

Sample request:

2. Create the tokenization form

Create the registration form by adding the following lines of HTML/JavaScript to your page:

  • With the checkoutId received from first step
    <script src="https://eu-test.oppwa.com/v1/paymentWidgets.js?checkoutId={checkoutId}/registration"></script>
  • With the shopperResultUrl as the page on your site where the end consumer should be redirected after the tokenization is complete
    <form action="{shopperResultUrl}" class="paymentWidgets" data-brands="VISA MASTER AMEX"></form>

Sample form:

3. Get the tokenization status

Once the tokenization request is processed, the customer is redirected to your shopperResultUrl along with a GET parameter resourcePath.

resourcePath=/v1/checkouts/{checkoutId}/registration

Sample request:


See also