@pay3/sdk v1.5.0
Pay3 JS SDK
Installation and Usage
Installation
Install the package by running the command,
npm install @pay3/sdk
Import the package into your project using,
import { initPay3 } from '@pay3/sdk';
Initialise Pay3 SDK,
const pay3 = initPay3({ clientId, hostname, isPaymentMode: true });
clientId
- A unique client ID is created for each client application. The client ID is environment dependent.hostname
- Pay3 will be opened in a new window using this hostname prefix. The host name is environment dependent.isPaymentMode
(optional. default:false
) - Pass true for fiat checkout in payments only mode.
Event Listeners
Login status change
pay3.on('pay3-sdk-login-status', (event) => {
const { data: { isLoggedIn, address } } = event;
// Your code here
});
Transaction status change
pay3.on('pay3-sdk-transaction-status', (event) => {
const { data: { message, requestId, receipt, status, orderId } } = event;
// Your code here
});
Functions
Connect
This function is used to open the EasySign modal in a new window
pay3.connect({ requestId });
requestId
(optional) - Can pass a random id string to identify the request. This requestId will be present in thepay3-sdk-login-status
event data.
Open Checkout
This function will open the fiat checkout flow
const checkoutRequest = {
requestId,
user: {
email: "user@email.address" // User's email address
},
payment: [
{
amount: 6.00", // Amount in fiat currency
name: "brl_bz", // Currency code (e.g. brl_bz)
},
{
amount: "4.05",
name: "usd_usa",
}
],
checkout: {
description: "Checkout Description",
imgUrl: "https://sample-image-url.com",
},
userMessage: "Some message for the user"
};
pay3.openCheckout(checkoutRequest);
For the full documentation, visit the below links 1. In-game Payments 2. Game tokens and NFTs
8 days ago
8 days ago
12 days ago
2 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago