makePayment method
Implementation
Future<Response> makePayment(
String txnDetails,
String pgDetails,
String cardDetails,
String custDetails,
String billDetails,
String shipDetails,
String itemDetails,
String otherDetails,
String merchantId
) async {
final makePaymentRequestJson = jsonEncode({
'txn_details': txnDetails,
'pg_details': pgDetails,
'card_details': cardDetails,
'cust_details': custDetails,
'bill_details': billDetails,
'ship_details': shipDetails,
'item_details': itemDetails,
'other_details': otherDetails,
'me_id': merchantId
});
//debugPrint('Calling api make payment ${StringConstants.makePayment} with body $makePaymentRequestJson');
final Map<String, String> headers = <String, String>{
'Content-Type': 'application/json',
};
try {
final Response response = await http.post(
Uri.parse(StringConstants.makePayment),
body: makePaymentRequestJson,
headers: headers);
return response;
} catch (e) {
//debugPrint('Make Payment api exception is ${e.toString()}');
rethrow;
}
}