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 - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+94
README.md
# 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
```javascript
const payOS = require("@payos/node");
const payosApi = new payOS.default({
clientId: "",
apiKey: "",
checksumKey: "",
});
```
* ES Modules
```javascript
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
### 1. Create Payment Link:
```javascript
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:
```javascript
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:
```javascript
let result = await payosApi.getInformationPayment(orderId);
// Example:
let result = await payosApi.getInformationPayment(1234);
```
Type:
```javascript
orderId: String | Number
```
### 3. Confirm Webhook:
```javascript
let result = await payosApi.confirmWebhook({
webhookUrl: "https://your-domain.com/payment/payos_transfer_handler"
});
```
Type:
```javascript
{ webhookUrl: String }
```
+5
-2
{
"name": "@payos/node",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -20,3 +20,2 @@ "main": "lib/index.js",

"axios": "^1.5.0",
"body-parser": "^1.20.2",
"crypto": "^1.0.1",

@@ -27,3 +26,7 @@ "dotenv": "^16.3.1"

"@types/node": "^20.5.9"
},
"repository": {
"type": "git",
"url": "https://github.com/payOSHQ/payos-lib-be.git"
}
}