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

@nest25/banksy-sdk

v1.0.32

Published

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 secu

Downloads

250

Readme

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. Then let the user choose the payment provider they want to pay with.
    const providersData = await banksy.getProviders();
  3. This payment providers selection step can be skipped and can be hard coded.
  4. Create a payment
    const paymentData = await banksy.createPayment(
       "PROVIDER_NAME", // Can be hardcoded here in order to skip step 2
       "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" 
     );
  5. Will return a payment link, open it to perform the payment.
  6. After successful payment the SUCCESS_CALLBACK_URL will be redirected automatically with paymentId: string on query parameter
  7. Same thing will happen on failure.
  8. 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,
   "payment": string // Encrypted payment object
}

Decrypt Payment To decrypt the payment data received on webhook use this method

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

const banksy = new Banksy("YOUR_SECRET_KEY");

const paymentData = banksy.decryptPayment("PAYMENT_STRING_RECEIVED_ON_WEBHOOK");

NB: This method only works with client secret key