conform method
dynamic
conform({})
Implementation
conform(
{required String id,
required String apiKey,
required bool testMode,
required void Function(ConformPaymentModel data) onDone,
required void Function(Map<String, dynamic> data) onError}) {
String url = testMode
? "https://uatcheckout.thawani.om/api/v1/payment_intents/$id/confirm"
: 'https://checkout.thawani.om/api/v1/payment_intents/$id/confirm';
Request.post(url: url, data: {}, headers: {
'Content-Type': "application/json",
'thawani-api-key': apiKey
}).then((value) {
if (value['status'] == 200) {
ConformPaymentModel model = ConformPaymentModel.fromJson(value['data']);
onDone(model);
} else {
onError(value['data']);
}
});
}