alipay-sdk-node
Install
$ npm install alipay-sdk-node --save
Usage
Create Alipay Instance
e.g.
const Alipay = /** * @param app_id required * @param app_private_key required * @param alipay_public_key required * @param notify_url required * @param return_url optional, for wap pay * @param sign_type optional, default is RSA2 * @param base_url optional, default is 'https://openapi.alipay.com/gateway.do' * @param cache optional, whether cache the alipay instance or not * / const alipay = new Alipay({ app_id: 'xxx', app_private_key: fs.readFileSync('filePath'), alipay_public_key: fs.readFileSync('filePath'), notify_url: 'xxx', sign_type: 'RSA2', base_url: 'https://openapi.alipaydev.com/gateway.do', return_url: 'xxx', cache: false })
click
WAP pay#getWapPageUrl(bizContent[,publicParams])
: get the url of wap pay- params: bizContent { JSON: required }
- params: publicParams { JSON: optional }, override the public params
- return: String
e.g.
alipay
click
APP Pay#getOrderInfoStr(bizContent[,publicParams])
: get the string of order info- params: bizContent {JSON: required}
- params: publicParams { JSON: optional }, override the public params
- return: String
e.g.
alipay
click
Check sign#rsaCheck(options)
: check sign- params: request body {JSON}
- return: Boolean
e.g.
alipay
click
Refund#refund(bizContent[,callback])
: refund api- params: bizContent {JSON}
- return: Promise Or Callback
e.g.
alipay
Contributors ✨
Thanks goes to these wonderful people (emoji key):
Aaron Che 💻 🐛 |
This project follows the all-contributors specification. Contributions of any kind welcome!