One-Click Checkout

This guide allows you to achieve a significant speedup of the checkout process by re-using the data a customer entered for a previous transaction/registration. It’s based on one of these two guides:
After the customer account details are stored, as part of the initial transaction/registration, you will need to keep a record of the associated registration IDs (token) that you can then use in step 1 below.

How it works

Prepare the checkout

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

Create the payment form

Display the payment form on your checkout page

Get the payment status

Find out if the payment was successful.

1. Prepare the checkout

NOTE: For demonstration purposes we have created a registration, which will be used in your one-click checkout, with id(s): 8ac7a4a07be8aec9017be8f0c7a714fa,8ac7a49f7be8a4a6017be8f0ca2d45cb. Following the guides above, you may add additional registrations options to the checkout.
First perform a server-to-server POST request to prepare the checkout, this should include the registration IDs of the customer as shown below. The registration IDs should be sent in the registrations[n].id parameter, where n is a sequence number from zero, incrementing for each of the customer’s registration IDs. The Standing Instruction parameters should be sent as standingInstruction.source as CIT, standingInstruction.mode as REPEATED and standingInstruction.type as UNSCHEDULED. For example, if the customer has two accounts on file, you would send registrations[0].id = {first} and registrations[1].id = {second}.

2. Create the payment form

Then, to show the payment form you just need to add the following lines of HTML/Javascript to your page and populating the following variables
  • The checkout’s id that you got in the response from step 1
<script src="{checkoutId}"></script>
The shopperResultUrl, which is the page on your site where the customer should be redirected to after the payment is processed and the brands that will be available.
<form action="{shopperResultUrl}" class="paymentWidgets">VISA MASTER AMEX</form>

When COPYandPAY builds up the payment form it automatically fetches the registrations data from the server and displays the pre-filled widgets to the shopper.

Todo Java Script

3. Get the payment status

As usual, once the payment has been processed, the customer is redirected to your shopperResultUrl along with a GET parameter resourcePath. IMPORTANT: The baseUrl must end in a “/”, e.g. “”. Then, to get the status of the payment, you should make a GET request to the baseUrl + resourcePath, including your authentication parameters. Example for a resourcePath:

We recommend that you verify the following fields from the Payment Status response, by comparing the returned values with expected:

  • ID(s)
  • Amount
  • Currency
  • Brand
  • Type