npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

payermax

v1.0.1

Published

PayerMax SDK

Downloads

2

Readme

PayerMax

PayerMax SDK

Installation

npm install payermax --save
# or
yarn add payermax

Documentation

See the PayerMax API for documentation.

Usage

Note: After integrating the SDK, all API interfaces do not need to pass parameter sign、merchantId

const PayerMax = require('payermax');

const payerMax = new PayerMax({
  // Secret key (Required)
  secretKey: 'Merchant security key',

  // Merchant ID (Required)
  merchantId: 'Merchant ID assigned by PayerMax',

  // Debugging environment: Test or Prod (Optional)
  // default: Prod
  env: 'Test',

  // https configuration (Optional)
  // For details, please refer to the NodeJS https chapter
  https: {
    timeout: 1000
  }
});

Payment Service General API

For detailed parameter description, please refer to the document Payment Service

// Example: create a payment order
payerMax.payment.post({
  bizType: 'CUSTOMIZE',
  orderId: 'order1234456',
  userId: 'user123456',
  subject: 'shop title',
  countryCode: 'ID',
  currency: 'IDR',
  totalAmount: '1000',
  frontCallBackUrl: 'https://www.payermax.com',
  version: '2.3',
  ...params
  // merchantId (Optional)
  // sign (Optional)
})
.then(res => console.log(res))
.catch(err => console.log(err));

Disbursement Service General API

For detailed parameter description, please refer to the document Disbursement Service

payerMax.disbursement.post({
  bizType: 'singlePayment',
  version: '2.0'
  ...params
  // merchantId (Optional)
  // sign (Optional)
})
.then(res => console.log(res))
.catch(err => console.log(err));

Specify API

Create a payment order

For detailed parameter description, please refer to the document API

payerMax.payment.create({
  bizType: 'According to the authority of the contracted collection service',
  ...params
  // merchantId (Optional)
  // sign (Optional)
  // version (Optional)
})
.then(res => console.log(res))
.catch(err => console.log(err));

Payment Result Query

For detailed parameter description, please refer to the document API

payerMax.payment.queryReceiptResult({
  orderId: 'Merchant order id'
  // bizType (Optional)
  // merchantId (Optional)
  // sign (Optional)
  // version (Optional)
})
.then(res => console.log(res))
.catch(err => console.log(err));

Refund

For detailed parameter description, please refer to the document API

payerMax.payment.refund({
  refundId: 'Refund request id',
  orderId: 'Original merchant order id',
  amount: 'Refund amount',
  currency: 'Currency code',
  callbackUrl: 'Refund result callback URL', // (Optional)
  comment: 'Refund comments', // (Optional)
  email: 'Email', // (Optional)
  // bizType (Optional)
  // merchantId (Optional)
  // sign (Optional)
  // version (Optional)
})
.then(res => console.log(res))
.catch(err => console.log(err));

Refund Result Query

For detailed parameter description, please refer to the document API

payerMax.payment.queryRefundResult({
  refundId: 'Refund request id'
  // bizType (Optional)
  // merchantId (Optional)
  // sign (Optional)
  // version (Optional)
})
.then(res => console.log(res))
.catch(err => console.log(err));

Create a disbursement order

For detailed parameter description, please refer to the document API

payerMax.disbursement.create({
  orderId: 'Merchant order ID',
  ...params
  // bizType (Optional)
  // merchantId (Optional)
  // sign (Optional)
  // version (Optional)
})
.then(res => console.log(res))
.catch(err => console.log(err));

Disbursement Result Query

For detailed parameter description, please refer to the document API

payerMax.disbursement.queryResult({
  orderId: 'Merchant order ID',
  // bizType (Optional)
  // merchantId (Optional)
  // sign (Optional)
  // version (Optional)
})
.then(res => console.log(res))
.catch(err => console.log(err));