delete method
dynamic
delete(
{ - required String cardId,
- required void onDelete(),
- required void onError(),
})
Implementation
delete(
{required String cardId,
required void Function() onDelete,
required void Function() onError}) {
String url = isTestMode
? "https://uatcheckout.thawani.om/api/v1/payment_methods/$cardId"
: "https://checkout.thawani.om/api/v1/payment_methods/$cardId";
Request.delete(url: url, data: {}, headers: {
'Content-Type': "application/json",
'thawani-api-key': userApiKey
}).then((value) => {
if (value['data']['code'] == 2003) {onDelete()} else {}
});
}