🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

paymax

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paymax

paymax-server-sdk-nodejs

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Paymax node.js sdk

简介

lib 文件夹下是 Node.js SDK 文件,
example 文件夹里面是一个简单的接入示例,该示例仅供参考。

版本要求

nodejs 版本 v0.10.0 及以上

安装

npm install paymax

初始化配置

var Paymax=require('paymax');
//Paymax提供给商户的SecretKey,登录网站后查看
Paymax.conf.setSecretKey('55970fdbbf10459f966a8e276afa86fa');

//Paymax提供给商户的公钥,登录网站后查看(参考样例,严格按照pem格式保存)
Paymax.conf.setPaymaxPublicKeyPath('paymax_rsa_public_key.pem');

//商户自己的私钥【公钥通过Paymax网站上传到Paymax,私钥pem文件路径设置到下面的变量中】
Paymax.conf.setPrivateKeyPath('rsa_private_key.pem');

下单:

Paymax.charge.createCharge(
    {
        amount: '0.01',
        subject: 'test_subject',
        body: 'this is a body',
        order_no: generateRandomAlphaNum(20),
        channel: 'alipay_app',
        client_ip: '127.0.0.1',
        app: 'app_7hqF2S6GYXET457i',
        currency: 'cny',
        extra: {},
        description: 'this is a description',
    }, getResult
)

订单查询

Paymax.charge.queryCharge('ch_fbe2d2675043004b02303b6a',getResult);

退款

Paymax.refund.createRefund(
        'ch_a59123a1538074f3cfa6568b',
         {
         'amount':'0.01',
         'description':'this is a description',
         'extra':{}
         },
         getResult
 );

退款查询

Paymax.refund.queryRefund(
         {
         'chargeNo':'ch_a59123a1538074f3cfa6568b',
         'refundNo':'re_d6586ff6e077b95985344538'
         }
        ,getResult
 );

人脸识别:查询用户识别信息

Paymax.face.queryFaceAuth('123',getResult);

详细信息请参考 API 文档

Keywords

paymax-nodejs

FAQs

Package last updated on 09 Nov 2016

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