makePayment method

Future<String?> makePayment(
  1. String? encryptedTransactionDetails,
  2. String? encryptedPgDetails,
  3. String? encryptedCardDetails,
  4. String? encryptedUserDetails,
  5. String? billDetails,
  6. String? shipDetails,
  7. String? itemDetails,
  8. String? otherDetails,
  9. String merchantId,
  10. BuildContext context,
)

Implementation

Future<String?> makePayment(
    String? encryptedTransactionDetails,
    String? encryptedPgDetails,
    String? encryptedCardDetails,
    String? encryptedUserDetails,
    String? billDetails,
    String? shipDetails,
    String? itemDetails,
    String? otherDetails,
    String merchantId,
    BuildContext context) async {
  // loaderController.add(true);
  String? responseData = await appRepository
      .makePayment(
          encryptedTransactionDetails!,
          encryptedPgDetails!,
          encryptedCardDetails!,
          encryptedUserDetails!,
          billDetails!,
          shipDetails!,
          itemDetails!,
          otherDetails!,
          merchantId)
      .then((Response response) async {
    //debugPrint('Make Payment api response is ${response.body}');

    // loaderController.add(false);
    if (response.statusCode == 200) {
      return response.body;
    }
    return null;
  }, onError: (dynamic e) {
    // loaderController.add(false);
    //debugPrint('Make Payment api exception is ${e.toString()}');
    return null;
  });

  return responseData;
}