PromisePay has changed its name to Assembly Learn more x

Integrating PromisePay.js

Overview

The PromisePay.js SDK provides front-end features for your platform and allows your front end (a user’s browser or web app) to talk to Assembly directly. The package is primarily designed to assist in PCI compliance, allowing for credit card and bank account details to be captured securely to help with PCI compliance. It also provides methods for capturing DeviceID and the user’s IP address.

Walkthrough

This section walks you through the steps to set up the PromisePay.js SDK in your platform.

1) Include the SDK

Add the below code within the <head></head> tags of your page. This will instantiate an Assembly class.

2) Configure the SDK

You will need to configure the package to ensure it is talking to the appropriate Assembly environment. If you wish to encrypt the details on the front-end, before they are transported using SSL, contact Assembly to have a public key generated.

Please note:

  • Keys are independent in the Pre-live and Production Assembly environments.
  • The environment value is either prelive or prod.
  • The publicKey is the key generated by Assembly.
  • This key is optional however once the key has been generated it becomes required.
  • Using a public client-side key does not significantly add to security, since the card data is already being submitted over SSL.
  • The encryption of card data on the client-side will add significant processing time when adding a credit card.

 

Include the following code snippet within your JavaScript to configure Assembly:

Uses of PromisePay.js

Generating a device ID

There is a single method that needs to be called to generate a Device ID which represents the device the user is using. The method will return a string value with the Device ID, therefore you will need to set up methods for the data to be passed back to.

These methods should send the data back to your platform’s backend. It will be required when making a payment.

Capturing an IP address

There is a single method that needs to be called to generate an IP address which represents the IP of the device the user is using. The method will return a string value with the IP Address, therefore you will need to set up methods for the data to be passed back to.

These methods should send the data back to your platform’s backend. It will be required when making a payment:

Capturing Credit Card and Bank Account Details

Capturing credit card and bank account details through a front-end interface will result in data being securely sent to Assembly with minimal impact to your PCI compliance. There are multiple methods which can be used to capture credit card and bank account details.

Please see Capturing a Credit Card and Capturing a Bank Account for step-by-step instructions on capturing account details through generating a related token, or using a custom HTML form.