CashOnRails NPM Library
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:
- Installation and Setup - Get started with CashOnRails
- Client Configuration - Configure the client for your needs
- Feature Documentation:
- Payment Services - Process payments through multiple channels
- Transfers - Send money to bank accounts
- Reserved Accounts - Create and manage dedicated accounts
- Customer Management - Manage your customer database
- Utility Functions - Helper functions and tools
- Developer Resources:
- Error Handling - Handle errors effectively
- TypeScript Support - Use with TypeScript
- API Reference - Complete API reference
Core Features
Feature | Description |
---|---|
🔐 Secure Payments | Process payments via multiple channels with built-in security features |
💸 Bank Transfers | Send money to any bank account with real-time validation |
🏦 Reserved Accounts | Create and manage dedicated accounts for your customers |
👥 Customer Management | Create and manage customer profiles seamlessly |
🛠️ Utility Tools | Generate unique references and access helper functions |
📊 Comprehensive Reporting | Track 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
- Documentation: https://developer.cashonrails.com
- Email: support@cashonrails.com
- Twitter: @CashOnRailsAPI
- GitHub Issues: Report a bug
- Community: Discord