1.6.8 • Published 10 months ago

@pay3/sdk v1.6.8

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
10 months 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.6.4

12 months ago

1.6.3

12 months ago

1.6.2

12 months ago

1.6.1

12 months ago

1.6.0

12 months ago

1.5.2

1 year ago

2.0.0-canary.2

1 year ago

1.6.8

10 months ago

1.6.7

10 months ago

1.6.6

11 months ago

1.6.5

12 months ago

2.0.0-canary.1

1 year ago

2.0.0-canary.0

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.9

1 year ago

1.4.8

1 year ago

1.4.5

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.12

1 year ago

1.3.11

2 years ago

1.3.10

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.7

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago