@nest25/banksy-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.34 • Public • Published

BANKSY PAYMENT SDK

The Banksy Payment SDK is a unified payment gateway solution designed to simplify the integration of multiple payment methods into applications. It offers developers a comprehensive set of tools and APIs for seamless payment processing while ensuring security, compliance, and scalability.

[[TOC]]

FEATURES

  1. Unified Integration: Easily incorporate multiple payment methods into applications using a single set of APIs and tools.
  2. Multi-Payment Method Support: Accept payments through various methods including credit/debit cards, PayPal, cryptocurrencies, digital wallets, and bank transfers.
  3. Country-Specific Configuration: Dynamically enable/disable payment methods based on the user's country to comply with regional regulations and optimize the payment experience.
  4. Security and Compliance: Adheres to industry-standard encryption protocols and compliance requirements (such as PCI-DSS) to ensure secure transactions and safeguard sensitive payment data.
  5. Developer-Friendly: Clear documentation, code samples, and resources to streamline the integration process for developers of all skill levels.
  6. Customization Options: Customize the payment flow, user interface, and error handling mechanisms to meet specific application requirements.

CONFIGURATION

To use the SDK, you need:

  1. CLIENT_KEY
  2. CLIENT_SECRET

Follow these steps:

i. Go to the BANKSY-DASHBOARD portal to generate an API Key.

ii. Install the SDK in your frontend application:

npm install @nest25/banksy-sdk --save

iii. Initialize the SDK with your CLIENT_KEY:

import { Banksy } from "@nest25/banksy-sdk";

const banksy = new Banksy("YOUR_CLIENT_KEY");
export default banksy;

(Note: To prevent multiple initializations, create a separate helper file.)

DATA FLOW

The SDK provides useful methods for processing payments across multiple providers. The diagram below illustrates the data flow:

Alt Text

  1. Select the product/service user want to purchase with proper amount: number and currency: string
  2. Create a payment
    const paymentData = await banksy.createPayment(
       "CURRENCY_TYPE", // Currency type fiat or crypto
       "AMOUNT_TO_CHARGE",
       "CURRENCY",
       "SUCCESS_CALLBACK_URL",
       "FAILURE_CALLBACK_URL",
       "EXTERNAL_CLIENT_ID",
       "CONTEXT", // Can be set any valid JSON object, will receive on banksy.getPayment
       "WALLET_ADDRESS" 
     );
  3. Will return a payment link, open it to perform the payment.
  4. After successful payment the SUCCESS_CALLBACK_URL will be redirected automatically with paymentId: string on query parameter
  5. Same thing will happen on failure.
  6. After receiving the paymentId validate the status
    const paymentData = await banksy.getPayment(paymentId);

WEBHOOK

Configure your webhook urls on the Dashboard/API keys Webhooks will be triggered automatically once any transaction happens using the API key.

Webhooks will accepts only POST methods And body will be

{
   "paymentId": string,
   "paymentRaw": JSON Object // payment object
}

Readme

Keywords

none

Package Sidebar

Install

npm i @nest25/banksy-sdk

Weekly Downloads

63

Version

1.0.34

License

ISC

Unpacked Size

1.8 MB

Total Files

34

Last publish

Collaborators

  • narayan-nestech