zalopay-nodejs
/
0.1.2
zalopay-nodejs 0.1.2
Install from the command line:
Learn more about npm packages
$ npm install @zalopay-oss/zalopay-nodejs@0.1.2
Install via package.json:
"@zalopay-oss/zalopay-nodejs": "0.1.2"
About this version
The Zalopay Node SDK provides convenient access to the ZaloPay API from applications written in server-side JavaScript or TypeScript.
Run:
npm i @zalopay-oss/zalopay-nodejs
- Create a client with some initial configuration
import { ZaloPayClient } from "@zalopay-oss/zalopay-nodejs";
const client = new ZaloPayClient({
appId: "your_app_id",
key1: "your_key_1",
key2: "your_key_2",
callbackUrl: "your_default_callback_url",
env: "sandbox",
});
- Create a simple order through the client and handle the result
const order: CreateOrderRequest = {
appTransId: "your_app_trans_id",
appUser: "user_id",
item: JSON.stringify(items),
embedData: JSON.stringify(embed_data),
amount: "amount",
description: "description",
bankCode: "zalopayapp",
type: 'order',
};
client.orderProvider.create(order)
.then(result => {
console.log(result)
...
})
.catch(err => console.log(err));
Details
- zalopay-nodejs
- zalopay-oss
- over 1 year ago
- ISC
- 10 dependencies
Assets
- zalopay-nodejs-0.1.2.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0