Skip to main content

Payment Without KYC

Overview

This section covers the process of handling payments that do not require KYC (Know Your Customer) verification. This flow is ideal for low-risk transactions where regulatory compliance does not mandate identity verification.

Payload Parameters

ParameterTypeRequiredDescription
amountnumberYesAmount to be charged
currencystringYesCurrency in which the amount to be charged
currencyType"crypto" | "fiat"YesCurrency type. Valid values are "fiat" or "crypto"
providerstringNoSpecify payment provider
customerNamestringNoCustomer name
successCallbackstringYesOn payment success portal will be redirected to this url
failureCallbackstringYesOn payment failure portal will be redirected to this url
externalClientIdstringNoExternal client id, you will receive this on webhook
isKycOptionalbooleanYesIndicates if KYC is optional. Must be true
customerEmailstringYesCustomer's email (required if isKycOptional is true).
customerPhonestringYesCustomer's phone number (required if isKycOptional is true).
contextanyNoAny extra context JSON data, you will receive this on webhook

Steps to Implement Payment Without KYC

Payment Process Example

1. Initialize the Banksy SDK

Set up the SDK with your API key and specify the environment (production or sandbox).

2. Create a Payment

Prepare the payment payload, which includes details such as amount, currency, customer information, and callback URLs for success and failure scenarios.

3. Redirect to Payment Provider

After creating the payment, the SDK will generate a payment link. Redirect the user to this link to complete the payment.

4. Handle Payment Success/Failure

Use the provided callback URLs to manage the outcome of the payment. Handle success and failure cases accordingly.

Code Example

import { Banksy } from "banksy-sdk";

// Step 1: Initialize the Banksy SDK
const apiKey = "your-client-key";
const banksy = new Banksy(apiKey);

// Step 2: Create a payment without KYC
async function initiatePaymentWithoutKYC() {
const paymentPayload = {
amount: 100,
currency: "USD",
successCallback: "https://yourdomain.com/success",
failureCallback: "https://yourdomain.com/failure",
customerName: "John Doe",
customerEmail: "john.doe@example.com",
currencyType: "fiat",
isKycOptional: true
};

try {
const payment = await banksy.createPayment(paymentPayload);
console.log("Payment Created: ", payment);
// Step 3: Redirect to the payment provider's gateway
window.location.href = payment.paymentLink;
} catch (error) {
console.error("Error creating payment: ", error.message);
}
}

initiatePaymentWithoutKYC();

Best Practices

  • Use Secure Callbacks: Ensure that your success and failure callback URLs are secure (HTTPS) to protect the integrity of the payment process.
  • Error Handling: Implement robust error handling to manage any issues during payment creation or redirection.