payWithUSSD static method

Future payWithUSSD({
  1. required String publicKey,
  2. required String tnxRef,
})

Implementation

static Future<dynamic> payWithUSSD({
  required String publicKey,
  required String tnxRef,
}) async {
  try {
    var response = await Fetcher.fetch(
      method: Method.post,
      path: '/payment-engine/api/v1/web-engine/process/ussd-request',
      publicKey: publicKey,
      payloads: {
        "ussdRequestType": "USSD_CODE_GENERATION",
        "reference": tnxRef,
      },
    );
    return response;
  } catch (e) {
    throw Exception(e);
  }
}