submitEwalletProcessPayment method

Future<IBinoxusPayOnResponse> submitEwalletProcessPayment({
  1. required Map<String, dynamic> body,
  2. required String token,
})

Implementation

Future<IBinoxusPayOnResponse> submitEwalletProcessPayment(
    {required Map<String, dynamic> body, required String token}) async {
  try {
    Map<String, String> headers = {
      "mb-token": token,
    };
    String url = "/pay/submit-ewallet-payment";
    final resp = await postWithDio(url, body: body, headers: headers);
    debugPrint("$resp");
    var response = IBinoxusPayOnResponse.fromJson(resp);
    return response;
  } catch (e, stack) {
    debugPrint('Error during submit mobile money: $e');
    debugPrint('Stack trace: $stack');
    return IBinoxusPayOnResponse(
        binStatus: EApiResponseStatusCode.bIN001,
        amount: 0,
        currency: '-',
        customRef: '-',
        paymentStatus: IPaymentStatus.fail,
        title: "Oups !",
        message:
            "Une erreur est survenue lors de cette opération, veuillez réessayer",
        systemRef: '');
  }
}