Libraries and SDKsNode.jsOverview

CashOnRails NPM Library

npm version License

Overview

The CashOnRails library provides a seamless integration with the CashOnRails API for managing payments, transfers, reserved accounts, and customers. Built for Node.js applications, this library supports both TEST and LIVE environments with comprehensive TypeScript support.

Documentation Structure

Our documentation is organized into several sections for easy navigation:

Core Features

FeatureDescription
🔐 Secure PaymentsProcess payments via multiple channels with built-in security features
💸 Bank TransfersSend money to any bank account with real-time validation
🏦 Reserved AccountsCreate and manage dedicated accounts for your customers
👥 Customer ManagementCreate and manage customer profiles seamlessly
🛠️ Utility ToolsGenerate unique references and access helper functions
📊 Comprehensive ReportingTrack transactions and access detailed reports

Quick Start

Install the Library

npm install cashonrails-node

Initialize the Client

import { CashOnRailsClient } from 'cashonrails-node';
 
// Create a new client instance
const client = new CashOnRailsClient('your_api_key', 'your_public_key', {
  environment: 'TEST', // Use 'LIVE' for production
});

Process a Payment

// Generate a unique reference
const reference = client.generateReference();
 
// Create a payment checkout
const checkout = await client.payment.checkout.initialize({
  first_name: "John",
  last_name: "Doe",
  email: "johndoe@gmail.com",
  amount: "100",
  currency: "NGN",
  reference: reference,
  redirectUrl: "https://yourwebsite.com/callback",
  title: "Payment for Order",
  description: "Order #12345",
  logoUrl: "https://yourwebsite.com/logo.png"
});
 
console.log('Checkout URL:', checkout.checkout_url);

For detailed documentation on each feature, please refer to the specific documentation pages linked above.

Contributing

We welcome contributions to improve the CashOnRails library! Please read our Contributing Guide for details on how to get started.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support