EasyPay
Browse guides
DocsGetting started

Installation

Install EasyPay 2.x and configure your backend for Chapa payments.

Install the SDK

npm install @realkal/easy-pay@2

Version 2 includes server-side direct charges, OTP authorization and order verification. Import the server client from @realkal/easy-pay/server. Browser and mobile apps use the public-key client from @realkal/easy-pay. Package on npm

Configure your backend

import { easyPay } from "@realkal/easy-pay/server";

export const payments = new easyPay({
  secretKey: process.env.CHAPA_SECRET_KEY!,
  encryptionKey: process.env.CHAPA_ENCRYPTION_KEY, // for OTP
  paymentOptions: ["telebirr", "mpesa", "amole"],
});

Keep both secrets in server environment variables. Use Chapa test credentials while developing. Get the encryption key from your Chapa dashboard when enabling Amole. Chapa test numbers

Migrate from 1.x

Switch checkout callers on result.status. Use checkout_created to open hosted checkout, and pending or otp_required to display the next step. Pass your saved order expectations to verifyTransaction. Only this server check can trigger onSuccess. Result types

Next guide Direct payments