Initialize the SDK
Initialize Pay.com.js with your merchant ID and return a pay instance.
The Pay.com() function initializes the SDK for your merchant account and returns a pay instance. This is always the first call in any integration.
const pay = await Pay.com(options)Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
identifier | string | Yes | Your Pay.com merchant ID, from the Developers tab of the Pay.com dashboard. This isn't the session ID. Pay.com.js identifies the session by the client_secret you pass to pay.checkout(). |
live | boolean | No | npm package only. Set to true in live, with a live session. Default: false. With the script tag, this option has no effect. |
Returns
A pay instance used to call pay.checkout() and pay.authentication(). With the npm package, Pay.com() returns a promise that resolves with the instance. With the script tag, window.Pay.com() returns the instance directly.
Example
import Pay from '@pay-com/js'
const pay = await Pay.com({
identifier: 'YOUR_MERCHANT_ID',
live: true // omit for the sandbox
})Was this page helpful?