Skip to main content

2Pay.js - Payments Solution


The 2Pay.js Javascript library allows merchants to create seamless payment flows, while keeping the need for PCI compliance to a minimum SAQ-A level. This means that shoppers pass sensitive payment information directly to the 2Checkout platform without sharing their credit card details with the merchant.


The 2Pay.js payments solution is available for all 2Checkout merchants who use or want to use the API integration, no matter what business model they have.

Currently, 2pay.js is in closed beta version and the public launch is scheduled for January 2020. For more details, contact 2Checkout.


To benefit from the 2Pay.js solution, merchants need to be integrated with the 2Checkout API and use the latest version - API 6.0.


The 2Pay.js solution brings multiple benefits for both merchants and shoppers:

  • Improved payment processing with a more secure and compliant system
  • Full-cart ownership without touching customer data, by tokenizing the payment information for merchants
  • Reduced complexity for the PCI DSS validation process via an SAQ-A questionnaire​
  • Improved security for shoppers, who will pass sensitive payment data directly to the 2Checkout platform, thus bypassing the merchant's systems.


2Pay.js can be implemented either by the merchant or by 2Checkout, after a request from the merchant. ​A JavaScript library allows merchants to include the payment fields at checkout without the need to handle shoppers' card data in any way, as shown by the steps below:

  • Merchants include a few lines of code in the interface where they need to collect payment information.​
  • Merchants will run a JS library that will replace the input fields with iframes
  • The iframes will collect and send the data directly to the 2Checkout​ platform

How it works

  1. The merchant runs a JavaScript library that will change the billing form by replacing the input fields with iframes. This way the data is sent directly to the 2Checkout system.​
  2. The merchant receives in return from the 2Checkout platform, a time-limited token for the saved credit card information.​
  3. The merchant submits the billing information and the payment token via the 2Checkout API.​
  4. The 2Checkout platform matches the token with the card data, extract the card data and authorize the payment and store the card in the vault. ​
  5. The merchant then redirects the customer to the Order Confirmation page​.
  6. Once the order is approved, the merchant receives a notification from the 2Checkout platform.
  7. Finally, the 2Checkout system sends a notification once the payment is settled.​


1. What payment methods are available for use with the 2Pay.js library?

All API version 6 accepted credit cards can be used with the 2Pay.js library.

2. What integrations does 2Pay.js support?

2Pay.js was developed for integration within web sites so that it allows full seamless integration with the merchants' checkout flow.

3. Does 2Pay.js support 3D Secure version 2?

While 2Pay.js does not need 3D Secure support, the integration for this security check is done via API once the order is placed with the payment token. More information about the 3DS flow in the API can be found here.


  • Was this article helpful?