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