1.0.10 • Published 2 years ago

stancer-api v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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 git@github.com: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

1.0.10

2 years ago

1.0.9-e

2 years ago

1.0.9-d

2 years ago

1.0.9-c

2 years ago

1.0.9-b

2 years ago

1.0.9-a

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago