Skip to main content

gopay 0.2.0 copy "gopay: ^0.2.0" to clipboard
gopay: ^0.2.0 copied to clipboard

GoPAY Mobile Money payments and payouts client for Flutter and Dart (Android, iOS, Web, desktop). HMAC-SHA256 signed requests.

example/main.dart

import 'package:gopay/gopay.dart';

Future<void> main() async {
  // 1. Configuration du client GoPAY avec vos identifiants marchands
  final gopay = GoPayClient(const GoPayConfig(
    baseUrl: 'https://gopay.gooomart.com',
    paymentApiKey: 'VOTRE_PAYMENT_API_KEY',
    paymentSecretKey: 'VOTRE_PAYMENT_SECRET_KEY',
    payoutApiKey: 'VOTRE_PAYOUT_API_KEY', // Optionnel si aucun transfert sortant
  ));

  print('=== Démonstration GoPAY Mobile Money ===');

  // 2. Initialisation d'une demande de paiement mobile money (CDF / USD)
  final paymentRef = 'REF-${DateTime.now().millisecondsSinceEpoch}';
  final paymentResponse = await gopay.initPayment(
    4000.0,
    'CDF',
    '+243990000000',
    paymentRef,
  );

  if (paymentResponse.success) {
    print('Paiement initié avec succès.');
    print('Trans ID: ${paymentResponse.transId}');
    print('Statut: ${paymentResponse.transactionStatus}');
  } else {
    print('Échec: ${paymentResponse.message} (${paymentResponse.errorCode})');
  }

  // 3. Vérification du statut de paiement
  final statusResponse = await gopay.checkPayment(paymentRef);
  print('Statut vérifié: ${statusResponse.transactionStatus}');

  // 4. Consultation du solde Payout
  final balanceResponse = await gopay.getPayoutBalance();
  if (balanceResponse.success) {
    print('Solde Payout: ${balanceResponse.balance} ${balanceResponse.currency}');
  }
}
1
likes
0
points
231
downloads

Publisher

unverified uploader

Weekly Downloads

GoPAY Mobile Money payments and payouts client for Flutter and Dart (Android, iOS, Web, desktop). HMAC-SHA256 signed requests.

Homepage
Repository (GitHub)
View/report issues

Topics

#payment #mobile-money #fintech #payout #api-client

License

unknown (license)

Dependencies

crypto, http

More

Packages that depend on gopay