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

@canner/pay2gojs

v3.1.0

Published

pay2go

Downloads

30

Readme

pay2gojs

damn easy pay2go api for express

usage

一次付費

const app = express();
const pay2GoClient = new pay2go.Client({...});
app.use('/product/payment', pay2GoClient.serve({
  baseUrl: "/product/payment",
  beforeCharged: ({parameter, dataStore}) => {
    parameter.setAmount(300);
    parameter.setDesc("description");
    return dataStore.setData({
      name: "wwwy3y3"
    });
  },
  afterCharged: ({data}) => {
    data.name.should.be.eql('wwwy3y3');
  }
}));

定期定額

NOTICE

  • afterStart 在 PeriodStartType=2 的時候,馬上執行首刷,會比 onCharge 早回來
  • PeriodStartType=2 的時候,馬上首刷,但如果今天的日期不是 PeriodPoint 的日期,會多收一期的費用,換句話說,想要每月10號收費,今天是10號的話,就是總共 12 期,收了第一期,剩下11期,但是如果今天是11號,則總共13期,,下個月10號才會收第二期
const app = express();
const pay2GoClient = new pay2go.PeriodClient({...});
app.use('/product/:productId/payment', pay2GoClient.serve({
  beforeStart: ({parameter, dataStore}) => {
    parameter.setParam('PeriodAmt', 10000);
    parameter.setParam('ProdDesc', "description");
    parameter.setParam('PeriodPoint', "13");
    parameter.setParam('PeriodStartType', 2);
    parameter.setParam('PayerEmail', "[email protected]");
    return dataStore.setData({
      name: "wwwy3y3"
    });
  },
  afterStart: ({data, result}) => {
    console.log(data);
    console.log(result);
  },
  onCharge: ({orderNo, result}) => {
    console.log(orderNo);
    console.log(result);
  }
}));