@fundkit/tola
v1.8.0
Published
FundKit Tola provider
Readme
@fundkit/tola
Tola payment provider integration for FundKit
📦 Installation
npm install @fundkit/core @fundkit/tola
# or
yarn add @fundkit/core @fundkit/tola
# or
pnpm add @fundkit/core @fundkit/tolaGet Your API Key
Before you start, you'll need a FundKit API key. Get yours at fundkit.dev - it's free to get started!
Quick Start
import { PaymentClient } from '@fundkit/core';
import { Tola } from '@fundkit/tola';
// Initialize Tola provider
const tola = new Tola({
apiKey: process.env.TOLA_API_KEY!,
merchantId: process.env.TOLA_MERCHANT_ID!,
});
// Use with FundKit client
const client = new PaymentClient({
apiKey: process.env.FUNDKIT_API_KEY!,
providers: [tola],
environment: 'sandbox',
});
// Process payment
const transaction = {
amount: 15000,
currency: 'UGX',
operator: 'mtn',
accountNumber: '256778123456',
externalId: 'tx_' + Date.now(),
};
const response = await client.collection(transaction);
console.log('Tola payment:', response);Configuration
Required Configuration
interface TolaConfig {
apiKey: string; // Your Tola API key
merchantId: string; // Your Tola merchant ID
}Environment Variables
TOLA_API_KEY=your_api_key_here
TOLA_MERCHANT_ID=your_merchant_id_here🌍 Supported Features
- Mobile money collections
- Bank transfers
- Multiple payment methods
- Real-time notifications
- Transaction reconciliation
- Multi-currency support
- Sandbox and production environments
API Reference
Tola Class
class Tola extends BaseProvider {
constructor(config: TolaConfig);
async collection(transaction: Transaction): Promise<CollectionResponse>;
async getTransaction(txId: string): Promise<TransactionStatus>;
}Related Documentation
Development
This package is part of the FundKit monorepo. For development setup:
- Clone the FundKit repository
- Install dependencies:
bun install - Build packages:
bun run build - Run tests:
bun test
License
MIT License - see the LICENSE file for details.
