Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

notrix

NotrixPay17ISC1.3.5TypeScript support: included

Notrix Official JavaScript SDK

payment-gateway, notrix, payments, crypto-payments

readme

Notrix JavaScript SDK

Install

npm install notrix

Examples

Create Checkout Session

import Client from "notrix";

let client = new Client("SECRET_API_KEY", "PROJECT_ID");

let checkoutSession = await client.createCheckoutSession(
    [
        {
            name: "Bike",
            description: "green",
            price: 32.56,  // USD
            quantity: 1,
            imageURL: "https://example.com/bike.png"  // make sure the image is available from the notrix.io domain
        }
    ],
    "https://example.com/success",
    "https://example.com/cancel",
);
console.log(checkoutSession.url);  // redirect the user here to pay

Check Payment Status

import Client from "notrix";

let client = new Client("SECRET_API_KEY", "PROJECT_ID");

let paymentConfirmed = await client.isPaid(checkoutSession.paymentRequestToken);  // true / false