Using LowFi
function openBuilder(){
const lamba = new Lamba({
title: "Lamba",
icon: 'https://ik.imagekit.io/lambahq/lamba-dark.png',
theme: "light",
appId: "65aabeba6182d6903a2ea355",
customerId: "cus_x1847",
enabledServices: ["low_fi"], // enables all payment gateways in the `low_fi` service
lowFiConfig: {
orderId: String, // your unique orderId (in your DB) for this payment transaction (REQUIRED)
paystack: { // paystack gateway SDK initialization config/data (OPTIONAL)
amount: 100, // set the actual amount value here. Lamba will auto multiply it by 100 to convert to the lowest currency unit
currency: 'NGN', // Use GHS for Ghana Cedis or USD for US Dollars
email: "[email protected]",
// ... the rest of paystack config properties
},
flutterwave: {
// ... the rest of flutterwave config properties
},
seerbit: {
// ... the rest of seerbit config properties
},
budpay: {
// ... the rest of budpay config properties
},
stripe: { // processes only payment intents at the moment (OPTIONAL)
amount: 150, // $150. will be automatically converted to cents by Lamba
currency: "usd",
automatic_payment_methods: {
enabled: true,
allow_redirects: "never"
},
receipt_email: "[email protected]", // refer to https://stripe.com/docs/api/payment_intents/create
// split payment feature
payment_intent_data:{
transfer_data: {
destination: "{{CONNECTED_ACCOUNT_ID}}", // the subaccount id
amount: 125, // amount the destination (i.e the `connected_account_id`, typically a seller on your platform) should receive.
}
}
},
paypal:{
intent: "capture", // required
purchase_units: [{
amount: {
currency_code: "USD", // required
value: "10.00" // required
}
}],
items: [ // (optional)
{
name: "T-Shirt",
description: "Super Fresh Shirt",
unit_amount: {
currency_code: "USD",
value: "10.00"
},
quantity: "1",
},
],
query_params: {
"currency": "USD", // (optional)
"enable-funding": "venmo", // (optional)
}
}
// PLEASE TAKE NOTE OF THE FOLLOWING:
// * for each payment config in the lowFiConfig, do not specify a callback
// * function since it will be overriden with the inbuilt Lamba callback function.
// * Same goes for the onclose, onClose or close functions.
// *
// * `productId` in seerbit will be replaced with the `orderId` by the Lamba UI
// *
// * `last_name` in budpay will be replaced with the `orderId` by the Lamba UI
// *
// * public key for each payment gateway will be automatically injected & will override
// * existing ones
// *
// * transaction references will be automatically injected & will override
// * existing ones
// *
// * `ui_mode` in stripe will be overriden with `embedded`
},
usageCapabilities: ['connect','use'],
});
// call the `open` method on the lamba instance to open up the Lamba interface
lamba.open();
}
Last updated