New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@payos/node

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@payos/node

## Step 1: Assure that you have installed the library With Npm: **npm install @payos/node**\ With Yarn: **yarn add @payos/node**

Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
3.9K
-4.98%
Maintainers
2
Weekly downloads
 
Created
Source

Documentation for using the @payos/node package

Step 1: Assure that you have installed the library

With Npm: npm install @payos/node
With Yarn: yarn add @payos/node

Step 2: Import the library and initialize your PayOS

  • CommonJS
const payOS = require("@payos/node");

const payosApi = new payOS.default({
    clientId: "",
    apiKey: "",
    checksumKey: "",
});
  • ES Modules
import payOS from "@payos/node";

const payosApi = new payOS({
    clientId: "",
    apiKey: "",
    checksumKey: "",
});

Don't forget to fill 3 field: clientId, apiKey and checksumKey from your payOS account.

Now, you can use

let result = await payosApi.createPaymentLink({
    orderCode: 234234,
    amount: 1000,
    description: "Thanh toan don hang",
    items: [
    {
        name: "Mì tôm hảo hảo ly",
        quantity: 1,
        price: 1000,
    },
    ],
    cancelUrl: "https://your-domain.com",
    returnUrl: "https://your-domain.com",
});

Type:

PaymentLinkType {
    orderCode: number;
    amount: number;
    description: string;
    items: { name: string; quantity: number; price: number }[];
    cancelUrl: string;
    returnUrl: string;
    signature?: string;
    buyerName?: string;
    buyerEmail?: string;
    buyerPhone?: string;
    buyerAddress?: string;
}

2. Get Information of Payment:

let result = await payosApi.getInformationPayment(orderId);

// Example:
let result = await payosApi.getInformationPayment(1234);

Type:

orderId: String | Number

3. Confirm Webhook:

let result = await payosApi.confirmWebhook({ 
        webhookUrl: "https://your-domain.com/payment/payos_transfer_handler"
    });

Type:

{ webhookUrl: String }

FAQs

Package last updated on 03 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts