vella-pay
v1.1.2
Published
Receive payment with VellaPay widget
Downloads
397
Maintainers
Readme
Vella Checkout
:rocket: Install
npm install vella-pay
:computer: Import
// ES6:
import VellaCheckout from 'vella-pay';
If you don't have your API keys, you can sign up for a test account here.
:clapper: 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: '[email protected]', // 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 [email protected] or come chat with us using on https://app.vella.finance. We're happy to help you out with your integration to Vella.