Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

huawei-nodejs

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

huawei-nodejs

huawei pay

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

huawei-nodejs

华为支付 for node.js

Installation

npm install huawei-nodejs

Usage

获取APP支付签名后订单参数

var Huawei = require('huawei-nodejs');

var pay = new Huawei({
	app_id: 'xxxxxxxx',
	app_private_key: fs.readFileSync('./app_private_key.pem'), //华为商户应用私钥
	alipay_public_key: fs.readFileSync('./alipay_public_key.pem')
});

var result = pay.buildSignOrderParam({
    boby:'对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body',
	subject: '大乐透',
	out_trade_no: '20140703'+Math.random().toString().substr(2, 10),
	totatimeout_expressl_amount: 9.00,
	: '90m',
	product_code: 'QUICK_MSECURITY_PAY'
});
console.log(result);

中间件

商户服务端处理支付宝的回调(express为例)


// 支付结果异步通知
router.use('/wxpay/notify', pay.notify(function(msg, req, res, next){
	// 处理商户业务逻辑

    // res.success() 向支付宝返回处理成功信息,res.fail()返回失败信息。
    res.success();
}));

Keywords

FAQs

Package last updated on 14 Jan 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc