Official Money-Pulse Flutter SDK — Accept payments and process payouts across Africa
# Money-Pulse Flutter SDK
SDK officiel Flutter / Dart pour Money-Pulse. Compatible iOS, Android, Web.
## Installation
```yaml
dependencies:
moneypulse: ^1.0.0
flutter_inappwebview: ^6.0.0 # pour ouvrir le checkout hosted
uni_links: ^0.5.1 # pour capturer le callback deep link
```
```bash
flutter pub get
```
## Quick Start
```dart
import 'package:moneypulse/moneypulse.dart';
final client = MoneyPulseClient(
apiKey: 'mp_live_votre_cle_api',
environment: MoneyPulseEnvironment.live,
);
final payment = await client.payments.create(
amount: 10000,
currency: 'XOF',
country: 'CI',
customer: Customer(email: 'client@email.com', phone: '+22507000000'),
callbackUrl: '
votre-backend.com',
returnUrl: 'moneypulse://callback',
);
print('Checkout URL: ${payment.checkoutUrl}');
```
## Payouts
```dart
final payout = await client.payouts.create(
amount: 50000,
currency: 'XOF',
country: 'CI',
recipient: PayoutRecipient(
type: 'mobile_money',
phone: '+22507000000',
name: 'Jean Kouassi',
),
);
```
## Mode Simulation
Testez sans débiter de fonds réels.
```dart
final test = await client.payments.create(
amount: 5000,
currency: 'XOF',
country: 'CI',
customer: Customer(phone: '+22507000000'),
simulate: true, // ← active la simulation
);
```
| Dernier chiffre | Résultat |
|---|---|
| `00`–`49` | ✅ completed |
| `50`–`89` | ⏳ pending → success |
| `90`–`99` | ❌ failed |
## Exemple complet — Checkout dans une WebView avec deep link callback
### 1. Configurer le deep link
**Android** (`android/app/src/main/AndroidManifest.xml`)
```xml
```
**iOS** (`ios/Runner/Info.plist`)
```xml
CFBundleURLTypes
CFBundleURLSchemes
moneypulse
```
### 2. Écran de paiement
```dart
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:moneypulse/moneypulse.dart';
import 'package:uni_links/uni_links.dart';
class CheckoutScreen extends StatefulWidget {
final double amount;
final String …