Lamba Product Documentation
Learn More
  • πŸ‘‹Welcome to Lamba
  • Overview
    • πŸ’‘Why Lamba?
    • 🍒Our Strategies for Solving Problems
    • β˜‘οΈReasons Why Lamba is Almost Costless!
    • πŸ”’Methods of Security Enforcement
  • Use Cases
    • πŸ‘ For E-commerce (collecting & splitting payments)
    • 🏹For CRMs
    • πŸ‘©β€πŸ’»For CMS
    • πŸ“§Building Email Apps
    • πŸ“©Building SMS Apps
    • πŸ§‘β€πŸ€β€πŸ§‘Building Social Media Publishing Apps
  • Getting Started
    • 🀝Creating Your First App
    • πŸ”Generating API keys & Enabling Services
    • πŸ”‘Recommended Security Considerations
  • Documentation
    • 🐦Understanding Lamba Model
    • ⛱️Lamba UI (JS Client)
      • πŸ‹Live Demo
      • πŸ§‘Installation & Initialization
      • πŸ“Structure of the Initialization Object
      • πŸ§‘How to use a service
        • Using LowMail
        • Using LowSMS
        • Using LowFi
      • 〽️Listening for Events
      • πŸ•ΈοΈHandling Webhooks
    • ♐Lamba API
      • πŸŽ†Endpoint & Authorization
  • Development Roadmap
    • πŸ—ΎRDMP 2023
    • πŸ—ΎRDMP 2024
  • Join The Team
    • πŸ«‚Bring On Your Skillset
Powered by GitBook
On this page

Was this helpful?

  1. Documentation
  2. Lamba UI (JS Client)
  3. How to use a service

Using LowFi

Helpful tip: Please note that you must set your API keys in your app's Lamba dashboard for the enabledServices to show up. Only the gateways with properly connected keys would show up.

For the SellMart app, test keys for Stripe, Paystack and Flutterwave have been set, thus you can try them out on the Codepen demo shown earlier.

Enabling all payment products

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: "test@emaildomain.com",
        // ... 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: "test-email@domain.com", // 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();
}

Enabling specific payment products

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: ["stripe","paystack"]}, // enables only "stripe" and "paystack"
    lowFiConfig: {...},
    usageCapabilities: ['connect','use'],
  });
  
  // call the `open` method on the lamba instance to open up the Lamba interface
  lamba.open();
}

When run, this would open up the Lamba UI with the finance product for the user to choose from and make a payment for your product.

Live Example: as an example, copy the below code to the codepen demo and initiate a payment with either Paystack or Flutterwave to see the result

function openBuilder(){
  const lamba = new Lamba({
    title: "Lamba",
    icon: 'https://ik.imagekit.io/lambahq/lamba-dark.png',
    theme: "light", // or "dark"
    appId: "65aabeba6182d6903a2ea355", // (REQUIRED)
    customerId: "cus_x1847", // (REQUIRED)
    enabledServices: {low_fi: ["paystack","flutterwave"]}, // (OPTIONAL)
    usageCapabilities: ['connect','use'], // (REQUIRED)
    lowFiConfig: {
      orderId: "order_28383",
      paystack: {
        amount: 100,
        currency: 'NGN', 
        email: "test@emaildomain.com",
      },
      flutterwave: { // (OPTIONAL)
     amount: 1500,
     currency: "NGN",
     payment_options: "card, ussd",
     customer: {
       email: "bose@sellmart.com",
       phone_number: "08102909304",
       name: "Bose Moday",
     },
   },
  }
  });
  
  // open the Lamba dialog
  lamba.open();
}

You should see a response like the one shown below, upon successful verification of your transaction:

Things you can build with the payment service on Lamba JS library and the API:

  1. E-commerce Payment Gateway Integration:

    • Example: Seamlessly integrate payment processing solutions like Stripe or Paystack into your e-commerce platform, enabling customers to make secure and convenient online payments.

  2. Subscription Service Billing:

    • Example: Implement recurring billing systems for subscription-based services, using Lamba's low_fi integrations to manage regular payments and subscription renewals.

  3. Crowdfunding Platform Payment Management:

    • Example: Develop a crowdfunding platform where you can use Lamba's low_fi integrations to handle the collection and distribution of funds for various projects.

  4. Donation Processing for Nonprofits:

    • Example: Create a system for nonprofits to receive donations online. Utilize Lamba's integrations to provide multiple donation options and process these transactions securely.

  5. Split Payments in Marketplaces:

    • Example: For online marketplaces, implement a feature to split payments between sellers and the platform. This could be used to distribute revenues from sales, ensuring all parties receive their share.

PreviousUsing LowSMSNextListening for Events

Last updated 3 months ago

Was this helpful?

⛱️
πŸ§‘
Successful payment on Lamba