deleteCheckout method

Future<CheckoutObject> deleteCheckout({
  1. required String checkoutID,
})

Deletes a previously Created checkout. Needs to be supplied with the CheckOut ID

Implementation

Future<CheckoutObject> deleteCheckout({
  required String checkoutID,
}) async {
  CheckoutObject coinbaseResponse;
  Map data;
  Map response = await deleteFromDB(
      api: 'https://api.commerce.coinbase.com/checkouts/$checkoutID',
      apiKey: _apiKey);
  if (response.containsKey('error')) {
    data = response['error'];
  } else {
    data = response['data'];
  }
  coinbaseResponse = CheckoutObject.fromJson(data);
  Logger(debug).displayLog(coinbaseResponse.toString());
  return coinbaseResponse;
}