Skip to main content

Installation

Le SDK Python peut être installé via pub
dependencies:
  easytransfert_sdk_api_marchand: ^1.0.0
Puis exécutez :
dart pub get

Initialisation

import 'package:easytransfert_sdk_api_marchand/easytransfert_sdk_api_marchand.dart';

final config = EasyTransfertConfig(
  apiKey: "VOTRE_CLE_API",
  ipnUrl: "https://votre-site.com/ipn",
);

final sdk = EasyTransfertSDK(config);

Collecte (Cashout-out)

final response = await sdk.cashout.cashout({
   "amount": 1000,
   "destination": "0102030405",
   "ipn_url": "https://votre-domaine.com/webhook/ipn",
   "api_key": "votre-api-key",
   "service_id": 17,
   "custom_data": "commande-12345",
});
print(response);

Transfert (Cash-in)

final response = await sdk.cashin.cashin({
    "amount": 1000,
    "destination": "0700000000",
    "ipn_url": "https://votre-domaine.com/webhook/ipn",
    "api_key": "votre-api-key",
    "service_id": 17,
});
print(response);

Vérifier le solde

final response = await sdk.balance.getBalance({
  "wallet": "main",
});
print(response);

Vérification du status d’une transaction

final response = await sdk.transactionStatus.checkStatus({
  "transaction_id": "TRANS123",
});
print(response);