vella-pay
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

Vella Checkout

NPM

NPM version

🚀 Install

npm install vella-pay

💻 Import

// ES6:
import VellaCheckout from 'vella-pay';

If you don't have your API keys, you can sign up for a test account here.

🎬 Initialize SDK

With api keys or access credentials

Based on how your account was set up, you will either have a pair or API key or a set of access credentials. Here is how you can use the SDK in both scenarios:

const key = "vk_test_XXXXXXXXX"; // your vella API test/live key
const config = {
  email: 'example@mail.com', // string - customer email
  name: "Tade Ogidan", // string - customer name
  amount: 100.00, //float - amount to pay
  currency: "NGN", // supported currency  NGN USD,GBP,USDT,USDC
  merchant_id: "", // string - merchant id
  reference: "", // string - generated reference
  custom_meta: {}, // custom meta data,
  source: "", // domain or location name widget is being called from
};
const vellaSDK = new VellaCheckout(key, config);
vellaSDK.init();
vellaSDK.onSuccess(response => {
  console.log("data", response) // success response with data

  //handle logic
   
  //trigger close widget
  vellaSDK.closeWidget();
})
vellaSDK.onError(error => {
  console.log("error", error) // error response
});
vellaSDK.onClose(() => {
  console.log("widget closed") // close response
});;

Contributors

Code Contributors

Support

If you're having trouble with Vella checkout integration, please reach out to us at hello@vella.finance or come chat with us using on https://app.vella.finance. We're happy to help you out with your integration to Vella.

Package Sidebar

Install

npm i vella-pay

Weekly Downloads

5

Version

1.1.2

License

MIT

Unpacked Size

30.5 kB

Total Files

14

Last publish

Collaborators

  • vellafinance