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

growstocks-pay

v1.1.2

Published

A simple API wrapper for GrowStocks Pay

Downloads

5

Readme

GrowStocks Pay API Wrapper

This is a GrowStocks Pay API wrapper.

API Application Form: Apply Here Working Example: Growrr Website Documentation: Read Here

Prerequisite

  • Node JS
  • GrowStocks Auth (including balance as a scope)
  • GrowStocks Developer Account

GrowStocks Auth

Basic Usages

const GSPay = require("growstocks-pay");
const pay = new GSPay("CLIENT_SECRET");

Creating Transaction

const userID = 737; // You can get this via GS Auth
const amount = 5; // Amount you want to deduct from user's account

await pay.createTransaction(userID, amount); // This will return a transaction ID

Getting Transaction

const transactionID = "XXXXXXXXXXXX"
await pay.getTransaction(transactionID);
/*
    returns 
    {
        id: "XXXXXXXXXXXX",
        party: 737,
        user: 1561,
        status: 0,
        amount: 5,
        datetime: 1596633967
    }

    id - Transaction ID
    party - Developer ID
    user - User ID,
    status - Payment status (integer) Paid = 1, Unpaid = 0
    datetime - Transaction created (in timestamp)
*/

Sending World Locks

const user = 737;
const amount = 5;

await pay.sendWorldLocks(user, amount);
/*
    returns
    {
        text: "5 World Locks has been sent to PapayaShake",
        balanceLeft: 0
    }
*/

Getting your balance

await pay.myBalance(); // returns 0

Additional Methods

GrowStocksPay.setClientSecret(CLIENT_SECRET);

  • Sets the client secret for your GS Pay Object

Rate Limits

  • Create endpoint rate limit: 1 request/user/4 seconds
  • Getendpoint rate limit: 1 request/user/2 seconds
  • Send endpoint rate limit: 1 request/user/second

Notes

All unpaid transactions will be automatically deleted 2 days after their creation.