viewCheckout method

Future<CheckoutObject> viewCheckout(
  1. String code
)

View a Created Checkout

Returns A CheckoutObject cointainng the values

Implementation

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