Initialize using npm
4 min
Install dependency
Install @pay3/sdk package using package manager which adds it to your packages.json
npm install --save @pay3/sdkThe above command will add pay3 js sdk to dependencies section of your package.json
"dependencies": {
...
"@pay3/sdk": "^1.6.4",
...
}initPay3()
Pay3 SDK supports Fiat Checkout flow using payment only mode.
Pay3 team shares hostname and clientId during onboarding. Following parameters can be used for creating new instance of Pay3.
Parameters
- hostname: Pay3 will be opened in a new window using this hostname prefix. The host name is environment dependent.
- clientId: A unique client ID is created for each client application. The client ID is environment dependent.
- isPaymentMode : Pass true for fiat checkout in payments only mode.
- lang (optional, default value 'en'): This parameter specifies the language preference for the Pay3 SDK. The strings used follow two letter language code as in ISO 639-1. Example pt for Portuguese, en for English.
import { initPay3, Pay3 } from '@pay3/sdk';
const pay3Pay: Pay3 = initPay3({ clientId, hostname, isPaymentMode: true, lang: 'en' });