giftCardsQuote method
Future<GiftCardQuote?>
giftCardsQuote({
- GiftCardOrderRequest? giftCardOrderRequest,
- Future<
void> ? abortTrigger,
Quote gift cards
Prices the order body with current prices, without placing an order. Takes the same body as order and checks it the same way: each item completely (its inputs, then its publicId, then its price) before the next, in request order. The first failure aborts the quote and is named at items[i], as the order names it, for example 409 / 11002 at items[i].inputs.maxPrice when the current price is above it. A range offer may be quoted on an equivalent offer of the same card that sells the same value for less: the item then returns that offer's publicId, which the order should use.
Parameters:
- GiftCardOrderRequest giftCardOrderRequest:
Implementation
Future<GiftCardQuote?> giftCardsQuote({ GiftCardOrderRequest? giftCardOrderRequest, Future<void>? abortTrigger, }) async {
final response = await giftCardsQuoteWithHttpInfo(giftCardOrderRequest: giftCardOrderRequest, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GiftCardQuote',) as GiftCardQuote;
}
return null;
}