simplypaye 0.1.0
simplypaye: ^0.1.0 copied to clipboard
SimplyPaye Mobile Money SDK for Flutter and Dart — Orange Money, Airtel Money, M-Pesa via https://api-simply-pay.net. Merchant signup at marchand-simplypaye.store.
simplypaye (Flutter / Dart) #
SDK Mobile Money SimplyPaye pour applications Flutter.
Inscription marchand : marchand-simplypaye.store
Installation #
Dans pubspec.yaml :
dependencies:
simplypaye:
path: ../integrations/flutter/simplypaye
# ou depuis git :
# simplypaye:
# git:
# url: https://github.com/Elmightypower/simplyserveur.git
# path: integrations/flutter/simplypaye
flutter pub get
Exemple #
import 'package:simplypaye/simplypaye.dart';
final client = SimplyPayeClient(
merchantCode: '108953',
apiKey: 'optional-api-key',
mode: SimplyPayeMode.production,
);
Future<void> pay() async {
final result = await client.initiateMobilePayment(
phone: '243812345678',
amount: '100',
currency: 'CDF',
reference: 'APP-ORDER-1',
);
// Afficher à l'utilisateur : confirmer le push USSD
final status = await client.pollPaymentStatus(result.orderNumber);
if (status.isSuccess) {
// Paiement OK
}
}
Mode test #
final sandbox = SimplyPayeClient(
merchantCode: '108953',
mode: SimplyPayeMode.sandbox,
);
final p = await sandbox.initiateMobilePayment(
phone: '243812345678',
amount: '50',
currency: 'CDF',
reference: 'TEST-1',
);
await sandbox.setSimulationStatus(p.orderNumber, SimulationStatus.success);
API #
| Méthode | Description |
|---|---|
initiateMobilePayment |
Lance USSD (prod ou simulation) |
checkPaymentStatus |
Statut une fois |
pollPaymentStatus |
Polling jusqu’à succès/échec |
setSimulationStatus |
Sandbox uniquement |