1.5.0 • Published 8 days ago

@pay3/sdk v1.5.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
8 days ago

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 the pay3-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

1.5.0

8 days ago

1.4.9

8 days ago

1.4.8

12 days ago

1.4.5

2 months ago

1.4.3

3 months ago

1.4.2

4 months ago

1.4.1

4 months ago

1.4.0

4 months ago

1.3.12

4 months ago

1.3.11

5 months ago

1.3.10

6 months ago

1.3.9

6 months ago

1.3.8

6 months ago

1.3.7

6 months ago

1.3.6

6 months ago

1.3.5

7 months ago

1.3.4

7 months ago

1.3.3

7 months ago

1.3.2

7 months ago

1.3.1

7 months ago

1.3.0

7 months ago

1.2.9

7 months ago

1.2.8

7 months ago

1.2.7

7 months ago

1.2.6

7 months ago

1.2.5

7 months ago

1.2.4

7 months ago

1.2.3

8 months ago

1.2.2

8 months ago

1.2.1

8 months ago

1.2.0

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.0

9 months ago