A comprehensive, production-ready Dart SDK for integrating with the Ecocash Open API. This SDK provides enterprise-grade features for processing payments, refunds, and transaction lookups in the Zimbabwe fintech ecosystem.
# Ecocash Dart SDK
A comprehensive, production-ready Dart SDK for integrating with the Ecocash Open API. This SDK provides enterprise-grade features for processing payments, refunds, and transaction lookups in the Zimbabwe fintech ecosystem.
## Features
### Core API Features
- **Payment Processing** - C2B (Customer to Business) instant payments
- **Refund Management** - Process refunds for previous transactions
- **Transaction Lookup** - Check transaction status and details
- **Mobile Money Integration** - Full Zimbabwe mobile money support
### Advanced SDK Features
- **Input Validation** - Comprehensive validation for all inputs
- **Retry Mechanism** - Configurable retry with exponential backoff
- **Batch Operations** - Process multiple transactions concurrently
- **Analytics & Reporting** - Built-in transaction analytics
- **Logging & Auditing** - Comprehensive logging with data masking
- **Circuit Breaker** - Prevent cascading failures
- **Offline Queue** - Queue transactions when network is unavailable
- **Sandbox Utilities** - Testing tools and mock responses
- **Data Security** - Automatic masking of sensitive information
- **Type Safety** - Full Dart null safety and strong typing
## Installation
Add to your `pubspec.yaml`:
```yaml
dependencies:
http: ^1.1.0
uuid: ^4.1.0
```
Then run:
```bash
dart pub get
```
## Quick Start
### Basic Usage
```dart
import 'package:ecocash_dart_sdk/ecocash_dart_sdk.dart';
void main() async {
// Initialize with basic configuration
final ecocash = EcocashApi(
apiKey: "your_api_key_here",
environment: EcocashEnvironment.sandbox,
);
try {
// Make a payment
final payment = await ecocash.makePayment(
customerMsisdn: "263XXXXXXXXX",
amount: 10.50,
reason: "Payment for services",
currency: "USD",
);
print('Payment successful: ${payment.ecocashTransactionReference}');
} catch (e) {
print('Payment failed: $e');
} finally {
ecocash.dispose();
}
}
```
### Advanced Configuration
```dart
import 'package:ecocash_dart_sdk/ecocash …