Getting Started with Lume Pay

Welcome to Lume Pay! This guide will help you integrate our payment verification service into your application quickly and securely.

Prerequisites

  • Node.js 16.x or later
  • npm or yarn package manager
  • A Lume Pay account (you can sign up here)

Installation

Install the Lume Pay SDK using npm or yarn:

npm install lumepay-sdk
# or
yarn add lumepay-sdk

Quick Start

Here's a simple example of how to use the SDK in your application:

import PaymentGateway from 'lumepay-sdk';

// Initialize the SDK with your API key
const paymentGateway = new PaymentGateway({
  apiKey: 'your-api-key', // Get this from your dashboard
  baseUrl: 'https://lumepay.pyrrho.dev' // Optional, defaults to this URL
});

// Create a payment intent
const intent = await paymentGateway.createIntent({
  amount: 1000, // Amount in ETB
  customerEmail: 'customer@example.com', // Required for payment tracking
  metadata: { orderId: '123' } // Optional, for your reference
});

// Get your bank details to share with the customer
const { bankAccount, bankName, accountName } = await paymentGateway.getAccountDetails();

// After customer makes the payment, submit for verification
const result = await paymentGateway.submitPayment({
  intentId: intent.id,
  transactionId: 'TRANSACTION_ID' // Get this from the customer
});