@basis-theory/tokestration-node-sdk-poc
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Multi-Provider Payment SDK

A TypeScript SDK for integrating multiple payment providers with a unified interface.

Supported Payment Providers

  • Stripe
  • Adyen
  • Braintree
  • TabaPay
  • Chase Orbital

Installation

npm install 🦄

Usage

  1. Initialize the SDK:
const paymentService = new PaymentService({
    basisTheoryApiKey: "",
    providerAuth: {
        ...
    }
});
  1. Tokenize a payment method:
const token = await paymentService.tokenize.stripe({ token: '15dab1fa-61c9-4ac1-a1f0-8199001dca74' });
const token = await paymentService.tokenize.braintree({ token: '15dab1fa-61c9-4ac1-a1f0-8199001dca74' });
  1. Charge a token:
const charge = await paymentService.charge.stripe({ processingToken: token.processingToken, amount: 1000 });
const charge = await paymentService.charge.braintree({ processingToken: token.processingToken, amount: 1000 });

Running the Test Client

To run the test client and see the SDK in action, follow these steps:

  1. Set up environment variables: Copy the .env.example file to .env and fill in your actual API keys and credentials for each payment provider.

    cp .env.example .env

    Then edit the .env file with your real credentials. (you can find these here)

  2. Install dependencies: Make sure you have all the necessary dependencies installed.

    npm install
  3. Run the test client: Execute the test client using the following command:

    npx tsx testClient.ts

    This will run through a series of tests for each supported payment provider, attempting to tokenize and charge (where implemented) using each provider.

Note: Some providers may throw errors if not fully configured or if there are issues with the provided credentials. These errors will be caught and logged to help with debugging.

Package Sidebar

Install

npm i @basis-theory/tokestration-node-sdk-poc

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

19.7 kB

Total Files

25

Last publish

Collaborators

  • greathouse-bt
  • kevinperaza-bt
  • jleon15
  • lcschy
  • briangonzalezatbt
  • dhudec
  • davi.basistheory
  • armsteadj1
  • matthew_basistheory
  • bt-platform