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

stancer-api

v1.0.10

Published

Stancer API wrapper for NodeJS.

Downloads

10

Readme

Stancer Node.js Library

The Stancer Node library provides convenient access to the Stancer API from applications written in server-side JavaScript.

This package isn't an official package but a community made.


Documentation

Installation

To install the latest version on npm locally and save it in your package's package.json file:

npm install stancer-api --save

To install the latest development version locally, without updating your project's package.json file:

npm install git+https://github.com/Arkmind/stancer-api.git


Usage

Simple usage

import { Client } from "stancer-api";

const client = new Client({
    stest: process.env.SECRET_TEST_STANCER_API_KEY,
    sprod: process.env.SECRET_PROD_STANCER_API_KEY,
});

client.customer.get('cust_id');

Using your own fetch

import { Client } from "stancer-api";
import fetch from "node-fetch@2";

const client = new Client(
    {
        stest: process.env.SECRET_TEST_STANCER_API_KEY,
        sprod: process.env.SECRET_PROD_STANCER_API_KEY,
    }, 
    { 
        environment: process.env.NODE_ENV, // 'test' | 'prod'
        fetch 
    },
);

API Reference

The export Client as a property named payment that is an instance of Payment, containing methods to manipulate payments.

Get payment data Client.payment.get(id: string)

Create a payment Client.payment.create(data: PaymentCreate)
PaymentCreate

Update a payment Client.payment.update(id: string, data: PaymentUpdate)
PaymentUpdate

List all payment Client.payment.list(data: PaymentList)
PaymentList

The export Client as a property named creditCard that is an instance of CreditCard, containing methods to manipulate credit cards.

Get credit card data Client.creditCard.get(id: string)

Create a credit card Client.creditCard.create(data: CreditCardCreate)
CreditCardCreate

Update a credit card Client.creditCard.update(id: string, data: CreditCardUpdate)
CreditCardUpdate

Delete a credit card Client.creditCard.delete(data: CreditCardDelete)
CreditCardDelete

The export Client as a property named sepa that is an instance of Sepa, containing methods to manipulate SEPAs.

Get SEPA data Client.sepa.get(id: string)

Create a SEPA Client.sepa.create(data: SepaCreate)
SepaCreate

Update a SEPA Client.sepa.update(id: string, data: SepaUpdate)
SepaUpdate

Delete a SEPA Client.sepa.delete(data: SepaDelete)
SepaDelete

The export Client as a property named customer that is an instance of Customer, containing methods to manipulate Customers.

Get Customer data Client.customer.get(id: string)

Create a Customer Client.customer.create(data: CustomerCreate)
CustomerCreate

Update a Customer Client.customer.update(id: string, data: CustomerUpdate)
CustomerUpdate

Delete a Customer Client.customer.delete(data: CustomerDelete)
CustomerDelete

The export Client as a property named refund that is an instance of Refund, containing methods to manipulate Refunds.

Get Refund data Client.refund.get(id: string)

Create a Refund Client.refund.create(data: CustomerCreate)
RefundCreate

The export Client as a property named dispute that is an instance of Dispute, containing methods to manipulate Disputes.

Get Dispute data Client.dispute.get(id: string)

List all Dispute Client.dispute.delete(data: DisputeList)
DisputeList

The export Client as a property named payout that is an instance of Payout, containing methods to manipulate Payouts.

Get a Payout detail Client.payout.get(id: string, type: PayoutTypes, data?: PayoutList) PayoutTypes, PayoutList

List all Payouts Client.payout.list(data: PayoutList)
PayoutList


Contribute

Requirements :

  • Node.JS > 18.0.0

Clone the Git repository and start building good stuff.

$ git clone [email protected]:Arkmind/stancer-api.git
$ cd stancer-api
$ npm install

When done build everything with npm run build and create a pull request respecting git convention.


Credits


License

MIT