@51eat/sdk 0.0.76 → 0.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/business/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/business/client/Client.js +7 -2
- package/dist/cjs/api/resources/business/resources/events/client/requests/StoreEventRequest.d.ts +7 -0
- package/dist/cjs/api/resources/business/resources/events/client/requests/UpdateEventRequest.d.ts +7 -0
- package/dist/cjs/api/resources/business/resources/events/resources/ticketTypes/client/requests/StoreTicketTypeRequest.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/events/resources/ticketTypes/client/requests/UpdateTicketTypeRequest.d.ts +7 -0
- package/dist/cjs/api/resources/business/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/index.js +3 -1
- package/dist/cjs/api/resources/business/resources/productOrders/client/Client.d.ts +26 -9
- package/dist/cjs/api/resources/business/resources/productOrders/client/Client.js +61 -30
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/AddTrackingProductOrdersRequest.d.ts +3 -2
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/FulfillProductOrdersRequest.d.ts +3 -2
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/GetLabelRatesProductOrdersRequest.d.ts +3 -2
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/GetProductOrdersRequest.d.ts +3 -2
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/MarkPickedUpProductOrdersRequest.d.ts +3 -2
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/PurchaseLabelProductOrdersRequest.d.ts +3 -2
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/RefundOrderRequest.d.ts +14 -0
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/business/resources/products/client/Client.d.ts +4 -2
- package/dist/cjs/api/resources/business/resources/products/client/Client.js +4 -2
- package/dist/cjs/api/resources/business/resources/products/client/requests/StoreProductRequest.d.ts +3 -1
- package/dist/cjs/api/resources/business/resources/products/client/requests/UpdateProductRequest.d.ts +3 -1
- package/dist/cjs/api/resources/business/resources/profile/client/requests/UpdateBusinessProfileRequest.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/client/Client.d.ts +27 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/client/Client.js +111 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/client/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/types/ListTaxCodesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/types/index.js +17 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/Client.d.ts +99 -8
- package/dist/cjs/api/resources/customer/resources/cart/client/Client.js +243 -11
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/AddItemCartRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/CheckoutCartRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/ChooseFulfillmentMethodRequest.d.ts +13 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/ClearCartRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/CreatePaymentIntentCartRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/GetCartRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/ListShippingOptionsCartRequest.d.ts +10 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/RefreshCartPaymentRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/RefreshCartPaymentRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/SelectShippingRateRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/SelectShippingRateRequest.js +3 -0
- package/dist/{esm/api/resources/customer/resources/cart/client/requests/GetShippingOptionsCartRequest.d.mts → cjs/api/resources/customer/resources/cart/client/requests/ShippingAddressRequest.d.ts} +6 -5
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/ShippingAddressRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/index.d.ts +5 -2
- package/dist/cjs/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/ListShippingOptionsCartResponse.d.ts +18 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/ListShippingOptionsCartResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/RefreshPaymentIntentCartResponse.d.ts +18 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/RefreshPaymentIntentCartResponse.js +10 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/SetFulfillmentCartResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/SetFulfillmentCartResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/SetShippingAddressCartResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/SetShippingAddressCartResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/index.d.ts +4 -1
- package/dist/cjs/api/resources/customer/resources/cart/types/index.js +4 -1
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/Client.d.ts +6 -0
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/Client.js +10 -0
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/requests/CreatePaymentIntentRequest.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/types/CreatePaymentIntentTicketingResponse.d.ts +12 -0
- package/dist/cjs/api/resources/customer/resources/productOrders/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/productOrders/client/Client.js +3 -0
- package/dist/cjs/api/resources/customer/resources/productOrders/client/requests/GetProductOrdersRequest.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/stands/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/customer/resources/stands/client/Client.js +9 -0
- package/dist/cjs/api/types/AppHttpResourcesApiV1BusinessCommerceProductResource.d.ts +10 -0
- package/dist/cjs/api/types/BusinessEvent.d.ts +7 -0
- package/dist/cjs/api/types/BusinessEventTicketType.d.ts +2 -0
- package/dist/cjs/api/types/BusinessProfile.d.ts +6 -1
- package/dist/cjs/api/types/CartResource.d.ts +24 -0
- package/dist/cjs/api/types/ConflictErrorBody.d.ts +2 -7
- package/dist/cjs/api/types/ConflictErrorBody.js +0 -7
- package/dist/cjs/api/types/CustomerBusinessProfile.d.ts +1 -1
- package/dist/cjs/api/types/CustomerEvent.d.ts +6 -0
- package/dist/cjs/api/types/CustomerEventDetail.d.ts +6 -0
- package/dist/cjs/api/types/EventFeedItem.d.ts +6 -0
- package/dist/cjs/api/types/FulfillmentType.d.ts +6 -0
- package/dist/cjs/api/types/FulfillmentType.js +9 -0
- package/dist/cjs/api/types/ProductResource.d.ts +5 -0
- package/dist/cjs/api/types/TaxCode.d.ts +21 -0
- package/dist/cjs/api/types/TaxCode.js +15 -0
- package/dist/cjs/api/types/TicketOrder.d.ts +7 -1
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/business/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/business/client/Client.mjs +5 -0
- package/dist/esm/api/resources/business/resources/events/client/requests/StoreEventRequest.d.mts +7 -0
- package/dist/esm/api/resources/business/resources/events/client/requests/UpdateEventRequest.d.mts +7 -0
- package/dist/esm/api/resources/business/resources/events/resources/ticketTypes/client/requests/StoreTicketTypeRequest.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/events/resources/ticketTypes/client/requests/UpdateTicketTypeRequest.d.mts +7 -0
- package/dist/esm/api/resources/business/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/productOrders/client/Client.d.mts +26 -9
- package/dist/esm/api/resources/business/resources/productOrders/client/Client.mjs +62 -31
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/AddTrackingProductOrdersRequest.d.mts +3 -2
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/FulfillProductOrdersRequest.d.mts +3 -2
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/GetLabelRatesProductOrdersRequest.d.mts +3 -2
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/GetProductOrdersRequest.d.mts +3 -2
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/MarkPickedUpProductOrdersRequest.d.mts +3 -2
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/PurchaseLabelProductOrdersRequest.d.mts +3 -2
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/RefundOrderRequest.d.mts +14 -0
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/business/resources/products/client/Client.d.mts +4 -2
- package/dist/esm/api/resources/business/resources/products/client/Client.mjs +4 -2
- package/dist/esm/api/resources/business/resources/products/client/requests/StoreProductRequest.d.mts +3 -1
- package/dist/esm/api/resources/business/resources/products/client/requests/UpdateProductRequest.d.mts +3 -1
- package/dist/esm/api/resources/business/resources/profile/client/requests/UpdateBusinessProfileRequest.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/taxCodes/client/Client.d.mts +27 -0
- package/dist/esm/api/resources/business/resources/taxCodes/client/Client.mjs +74 -0
- package/dist/esm/api/resources/business/resources/taxCodes/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/taxCodes/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/taxCodes/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/taxCodes/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/taxCodes/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/taxCodes/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/taxCodes/types/ListTaxCodesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/taxCodes/types/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/taxCodes/types/index.mjs +1 -0
- package/dist/esm/api/resources/customer/resources/cart/client/Client.d.mts +99 -8
- package/dist/esm/api/resources/customer/resources/cart/client/Client.mjs +243 -11
- package/dist/esm/api/resources/customer/resources/cart/client/requests/AddItemCartRequest.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/cart/client/requests/CheckoutCartRequest.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/cart/client/requests/ChooseFulfillmentMethodRequest.d.mts +13 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/ClearCartRequest.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/cart/client/requests/CreatePaymentIntentCartRequest.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/cart/client/requests/GetCartRequest.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/cart/client/requests/ListShippingOptionsCartRequest.d.mts +10 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/RefreshCartPaymentRequest.d.mts +12 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/RefreshCartPaymentRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/SelectShippingRateRequest.d.mts +12 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/SelectShippingRateRequest.mjs +2 -0
- package/dist/{cjs/api/resources/customer/resources/cart/client/requests/GetShippingOptionsCartRequest.d.ts → esm/api/resources/customer/resources/cart/client/requests/ShippingAddressRequest.d.mts} +6 -5
- package/dist/esm/api/resources/customer/resources/cart/client/requests/ShippingAddressRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/index.d.mts +5 -2
- package/dist/esm/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/cart/types/ListShippingOptionsCartResponse.d.mts +18 -0
- package/dist/esm/api/resources/customer/resources/cart/types/ListShippingOptionsCartResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/types/RefreshPaymentIntentCartResponse.d.mts +18 -0
- package/dist/esm/api/resources/customer/resources/cart/types/RefreshPaymentIntentCartResponse.mjs +7 -0
- package/dist/esm/api/resources/customer/resources/cart/types/SetFulfillmentCartResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/cart/types/SetFulfillmentCartResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/types/SetShippingAddressCartResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/cart/types/SetShippingAddressCartResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/types/index.d.mts +4 -1
- package/dist/esm/api/resources/customer/resources/cart/types/index.mjs +4 -1
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/Client.d.mts +6 -0
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/Client.mjs +10 -0
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/requests/CreatePaymentIntentRequest.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/CreatePaymentIntentTicketingResponse.d.mts +12 -0
- package/dist/esm/api/resources/customer/resources/productOrders/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/productOrders/client/Client.mjs +3 -0
- package/dist/esm/api/resources/customer/resources/productOrders/client/requests/GetProductOrdersRequest.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/stands/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/customer/resources/stands/client/Client.mjs +9 -0
- package/dist/esm/api/types/AppHttpResourcesApiV1BusinessCommerceProductResource.d.mts +10 -0
- package/dist/esm/api/types/BusinessEvent.d.mts +7 -0
- package/dist/esm/api/types/BusinessEventTicketType.d.mts +2 -0
- package/dist/esm/api/types/BusinessProfile.d.mts +6 -1
- package/dist/esm/api/types/CartResource.d.mts +24 -0
- package/dist/esm/api/types/ConflictErrorBody.d.mts +2 -7
- package/dist/esm/api/types/ConflictErrorBody.mjs +1 -6
- package/dist/esm/api/types/CustomerBusinessProfile.d.mts +1 -1
- package/dist/esm/api/types/CustomerEvent.d.mts +6 -0
- package/dist/esm/api/types/CustomerEventDetail.d.mts +6 -0
- package/dist/esm/api/types/EventFeedItem.d.mts +6 -0
- package/dist/esm/api/types/FulfillmentType.d.mts +6 -0
- package/dist/esm/api/types/FulfillmentType.mjs +6 -0
- package/dist/esm/api/types/ProductResource.d.mts +5 -0
- package/dist/esm/api/types/TaxCode.d.mts +21 -0
- package/dist/esm/api/types/TaxCode.mjs +12 -0
- package/dist/esm/api/types/TicketOrder.d.mts +7 -1
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +12 -1
- package/reference.md +382 -16
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/RefundProductOrdersRequest.d.ts +0 -11
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/SelectShippingOptionCartRequest.d.ts +0 -14
- package/dist/cjs/api/resources/customer/resources/cart/types/GetShippingOptionsCartResponse.d.ts +0 -14
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/RefundProductOrdersRequest.d.mts +0 -11
- package/dist/esm/api/resources/customer/resources/cart/client/requests/SelectShippingOptionCartRequest.d.mts +0 -14
- package/dist/esm/api/resources/customer/resources/cart/types/GetShippingOptionsCartResponse.d.mts +0 -14
- /package/dist/cjs/api/resources/business/resources/productOrders/client/requests/{RefundProductOrdersRequest.js → RefundOrderRequest.js} +0 -0
- /package/dist/cjs/api/resources/{customer/resources/cart/client/requests/GetShippingOptionsCartRequest.js → business/resources/taxCodes/types/ListTaxCodesResponse.js} +0 -0
- /package/dist/cjs/api/resources/customer/resources/cart/client/requests/{SelectShippingOptionCartRequest.js → ChooseFulfillmentMethodRequest.js} +0 -0
- /package/dist/cjs/api/resources/customer/resources/cart/{types/GetShippingOptionsCartResponse.js → client/requests/ListShippingOptionsCartRequest.js} +0 -0
- /package/dist/esm/api/resources/business/resources/productOrders/client/requests/{RefundProductOrdersRequest.mjs → RefundOrderRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{customer/resources/cart/client/requests/GetShippingOptionsCartRequest.mjs → business/resources/taxCodes/types/ListTaxCodesResponse.mjs} +0 -0
- /package/dist/esm/api/resources/customer/resources/cart/client/requests/{SelectShippingOptionCartRequest.mjs → ChooseFulfillmentMethodRequest.mjs} +0 -0
- /package/dist/esm/api/resources/customer/resources/cart/{types/GetShippingOptionsCartResponse.mjs → client/requests/ListShippingOptionsCartRequest.mjs} +0 -0
|
@@ -357,11 +357,22 @@ class CartClient {
|
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
359
|
/**
|
|
360
|
+
* Refused with a 422 and a message while the order can't be priced yet: no
|
|
361
|
+
* fulfillment method chosen (when the shop offers several), a shipped order
|
|
362
|
+
* with no shipping address, or calculated shipping with no option chosen.
|
|
363
|
+
* The message is also in the cart's `fulfillment.checkout_blocker`.
|
|
364
|
+
*
|
|
365
|
+
* A 409 `{status: "paid", message, payment_intent_id}` means the cart's
|
|
366
|
+
* payment already went through (never a second payment): finish checkout
|
|
367
|
+
* with that id. A 409 `{status: "processing", message}` means the payment
|
|
368
|
+
* is still in flight: don't pay again, check back later.
|
|
369
|
+
*
|
|
360
370
|
* @param {FiveOneEat.customer.CreatePaymentIntentCartRequest} request
|
|
361
371
|
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
362
372
|
*
|
|
363
373
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
364
374
|
* @throws {@link FiveOneEat.NotFoundError}
|
|
375
|
+
* @throws {@link FiveOneEat.ConflictError}
|
|
365
376
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
366
377
|
*
|
|
367
378
|
* @example
|
|
@@ -401,6 +412,8 @@ class CartClient {
|
|
|
401
412
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
402
413
|
case 404:
|
|
403
414
|
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
415
|
+
case 409:
|
|
416
|
+
throw new FiveOneEat.ConflictError(_response.error.body, _response.rawResponse);
|
|
404
417
|
case 422:
|
|
405
418
|
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
406
419
|
default:
|
|
@@ -415,11 +428,99 @@ class CartClient {
|
|
|
415
428
|
});
|
|
416
429
|
}
|
|
417
430
|
/**
|
|
431
|
+
* Call immediately before presenting or confirming the payment sheet. The
|
|
432
|
+
* cart may have changed since its payment intent was created (another
|
|
433
|
+
* device, a changed address or shipping option), so it is re-priced and
|
|
434
|
+
* the intent brought up to date. Send `amount`, the total in cents the
|
|
435
|
+
* buyer is looking at.
|
|
436
|
+
*
|
|
437
|
+
* - `total_changed: false` — pay with the returned `client_secret`.
|
|
438
|
+
* - `total_changed: true` — show "Your total changed to $X", re-initialise
|
|
439
|
+
* the payment sheet with the returned `client_secret` (it carries the new
|
|
440
|
+
* amount), and let the buyer confirm again.
|
|
441
|
+
* - 422 with a message — the order can't be priced yet (the same message
|
|
442
|
+
* as `fulfillment.checkout_blocker`); the old intent is cancelled.
|
|
443
|
+
* - 409 `status: paid` with `payment_intent_id` — the payment already went
|
|
444
|
+
* through; call checkout with that id instead.
|
|
445
|
+
* - 409 `status: processing` — the payment is still processing; don't pay
|
|
446
|
+
* again, check back later.
|
|
447
|
+
*
|
|
448
|
+
* @param {FiveOneEat.customer.RefreshCartPaymentRequest} request
|
|
449
|
+
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
450
|
+
*
|
|
451
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
452
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
453
|
+
* @throws {@link FiveOneEat.ConflictError}
|
|
454
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
455
|
+
*
|
|
456
|
+
* @example
|
|
457
|
+
* await client.customer.cart.refreshPaymentIntent({
|
|
458
|
+
* business: "business",
|
|
459
|
+
* amount: 1
|
|
460
|
+
* })
|
|
461
|
+
*/
|
|
462
|
+
refreshPaymentIntent(request, requestOptions) {
|
|
463
|
+
return core.HttpResponsePromise.fromPromise(this.__refreshPaymentIntent(request, requestOptions));
|
|
464
|
+
}
|
|
465
|
+
__refreshPaymentIntent(request, requestOptions) {
|
|
466
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
467
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
468
|
+
const { business } = request, _body = __rest(request, ["business"]);
|
|
469
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
470
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
471
|
+
const _response = yield core.fetcher({
|
|
472
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(business)}/cart/payment-intent/refresh`),
|
|
473
|
+
method: "POST",
|
|
474
|
+
headers: _headers,
|
|
475
|
+
contentType: "application/json",
|
|
476
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
477
|
+
requestType: "json",
|
|
478
|
+
body: _body,
|
|
479
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
480
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
481
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
482
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
483
|
+
logging: this._options.logging,
|
|
484
|
+
});
|
|
485
|
+
if (_response.ok) {
|
|
486
|
+
return {
|
|
487
|
+
data: _response.body,
|
|
488
|
+
rawResponse: _response.rawResponse,
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
if (_response.error.reason === "status-code") {
|
|
492
|
+
switch (_response.error.statusCode) {
|
|
493
|
+
case 401:
|
|
494
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
495
|
+
case 404:
|
|
496
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
497
|
+
case 409:
|
|
498
|
+
throw new FiveOneEat.ConflictError(_response.error.body, _response.rawResponse);
|
|
499
|
+
case 422:
|
|
500
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
501
|
+
default:
|
|
502
|
+
throw new errors.FiveOneEatError({
|
|
503
|
+
statusCode: _response.error.statusCode,
|
|
504
|
+
body: _response.error.body,
|
|
505
|
+
rawResponse: _response.rawResponse,
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/businesses/{business}/cart/payment-intent/refresh");
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Not gated on commerce readiness: the customer has already paid, so a
|
|
514
|
+
* lapsed readiness check must not stop the order from being recorded.
|
|
515
|
+
* A 409 means the cart changed after the payment was priced: the payment
|
|
516
|
+
* was refunded in full and no order was placed — re-check and pay again.
|
|
517
|
+
*
|
|
418
518
|
* @param {FiveOneEat.customer.CheckoutCartRequest} request
|
|
419
519
|
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
420
520
|
*
|
|
421
521
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
422
522
|
* @throws {@link FiveOneEat.NotFoundError}
|
|
523
|
+
* @throws {@link FiveOneEat.ConflictError}
|
|
423
524
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
424
525
|
*
|
|
425
526
|
* @example
|
|
@@ -465,6 +566,8 @@ class CartClient {
|
|
|
465
566
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
466
567
|
case 404:
|
|
467
568
|
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
569
|
+
case 409:
|
|
570
|
+
throw new FiveOneEat.ConflictError(_response.error.body, _response.rawResponse);
|
|
468
571
|
case 422:
|
|
469
572
|
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
470
573
|
default:
|
|
@@ -479,7 +582,74 @@ class CartClient {
|
|
|
479
582
|
});
|
|
480
583
|
}
|
|
481
584
|
/**
|
|
482
|
-
*
|
|
585
|
+
* Switching away from shipping clears the saved shipping address and option.
|
|
586
|
+
*
|
|
587
|
+
* @param {FiveOneEat.customer.ChooseFulfillmentMethodRequest} request
|
|
588
|
+
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
589
|
+
*
|
|
590
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
591
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
592
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
593
|
+
*
|
|
594
|
+
* @example
|
|
595
|
+
* await client.customer.cart.setFulfillment({
|
|
596
|
+
* business: "business",
|
|
597
|
+
* fulfillment_method: "ship"
|
|
598
|
+
* })
|
|
599
|
+
*/
|
|
600
|
+
setFulfillment(request, requestOptions) {
|
|
601
|
+
return core.HttpResponsePromise.fromPromise(this.__setFulfillment(request, requestOptions));
|
|
602
|
+
}
|
|
603
|
+
__setFulfillment(request, requestOptions) {
|
|
604
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
605
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
606
|
+
const { business } = request, _body = __rest(request, ["business"]);
|
|
607
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
608
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
609
|
+
const _response = yield core.fetcher({
|
|
610
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(business)}/cart/fulfillment`),
|
|
611
|
+
method: "PUT",
|
|
612
|
+
headers: _headers,
|
|
613
|
+
contentType: "application/json",
|
|
614
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
615
|
+
requestType: "json",
|
|
616
|
+
body: _body,
|
|
617
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
618
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
619
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
620
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
621
|
+
logging: this._options.logging,
|
|
622
|
+
});
|
|
623
|
+
if (_response.ok) {
|
|
624
|
+
return {
|
|
625
|
+
data: _response.body,
|
|
626
|
+
rawResponse: _response.rawResponse,
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
if (_response.error.reason === "status-code") {
|
|
630
|
+
switch (_response.error.statusCode) {
|
|
631
|
+
case 401:
|
|
632
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
633
|
+
case 404:
|
|
634
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
635
|
+
case 422:
|
|
636
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
637
|
+
default:
|
|
638
|
+
throw new errors.FiveOneEatError({
|
|
639
|
+
statusCode: _response.error.statusCode,
|
|
640
|
+
body: _response.error.body,
|
|
641
|
+
rawResponse: _response.rawResponse,
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/customer/businesses/{business}/cart/fulfillment");
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Sales tax on a shipped order is worked out from this address. Saving a
|
|
650
|
+
* different address clears the chosen shipping option.
|
|
651
|
+
*
|
|
652
|
+
* @param {FiveOneEat.customer.ShippingAddressRequest} request
|
|
483
653
|
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
484
654
|
*
|
|
485
655
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
@@ -487,7 +657,7 @@ class CartClient {
|
|
|
487
657
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
488
658
|
*
|
|
489
659
|
* @example
|
|
490
|
-
* await client.customer.cart.
|
|
660
|
+
* await client.customer.cart.setShippingAddress({
|
|
491
661
|
* business: "business",
|
|
492
662
|
* address: {
|
|
493
663
|
* line1: "line1",
|
|
@@ -497,18 +667,18 @@ class CartClient {
|
|
|
497
667
|
* }
|
|
498
668
|
* })
|
|
499
669
|
*/
|
|
500
|
-
|
|
501
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
670
|
+
setShippingAddress(request, requestOptions) {
|
|
671
|
+
return core.HttpResponsePromise.fromPromise(this.__setShippingAddress(request, requestOptions));
|
|
502
672
|
}
|
|
503
|
-
|
|
673
|
+
__setShippingAddress(request, requestOptions) {
|
|
504
674
|
return __awaiter(this, void 0, void 0, function* () {
|
|
505
675
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
506
676
|
const { business } = request, _body = __rest(request, ["business"]);
|
|
507
677
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
508
678
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
509
679
|
const _response = yield core.fetcher({
|
|
510
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(business)}/cart/shipping-
|
|
511
|
-
method: "
|
|
680
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(business)}/cart/shipping-address`),
|
|
681
|
+
method: "PUT",
|
|
512
682
|
headers: _headers,
|
|
513
683
|
contentType: "application/json",
|
|
514
684
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -542,11 +712,74 @@ class CartClient {
|
|
|
542
712
|
});
|
|
543
713
|
}
|
|
544
714
|
}
|
|
545
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
715
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/customer/businesses/{business}/cart/shipping-address");
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Options are held for 30 minutes; choose one by its `provider_rate_id`.
|
|
720
|
+
*
|
|
721
|
+
* @param {FiveOneEat.customer.ListShippingOptionsCartRequest} request
|
|
722
|
+
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
723
|
+
*
|
|
724
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
725
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
726
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
727
|
+
*
|
|
728
|
+
* @example
|
|
729
|
+
* await client.customer.cart.listShippingOptions({
|
|
730
|
+
* business: "business"
|
|
731
|
+
* })
|
|
732
|
+
*/
|
|
733
|
+
listShippingOptions(request, requestOptions) {
|
|
734
|
+
return core.HttpResponsePromise.fromPromise(this.__listShippingOptions(request, requestOptions));
|
|
735
|
+
}
|
|
736
|
+
__listShippingOptions(request, requestOptions) {
|
|
737
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
738
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
739
|
+
const { business } = request;
|
|
740
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
741
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
742
|
+
const _response = yield core.fetcher({
|
|
743
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(business)}/cart/shipping-options`),
|
|
744
|
+
method: "GET",
|
|
745
|
+
headers: _headers,
|
|
746
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
747
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
748
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
749
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
750
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
751
|
+
logging: this._options.logging,
|
|
752
|
+
});
|
|
753
|
+
if (_response.ok) {
|
|
754
|
+
return {
|
|
755
|
+
data: _response.body,
|
|
756
|
+
rawResponse: _response.rawResponse,
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
if (_response.error.reason === "status-code") {
|
|
760
|
+
switch (_response.error.statusCode) {
|
|
761
|
+
case 401:
|
|
762
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
763
|
+
case 404:
|
|
764
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
765
|
+
case 422:
|
|
766
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
767
|
+
default:
|
|
768
|
+
throw new errors.FiveOneEatError({
|
|
769
|
+
statusCode: _response.error.statusCode,
|
|
770
|
+
body: _response.error.body,
|
|
771
|
+
rawResponse: _response.rawResponse,
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/businesses/{business}/cart/shipping-options");
|
|
546
776
|
});
|
|
547
777
|
}
|
|
548
778
|
/**
|
|
549
|
-
*
|
|
779
|
+
* Send only the `provider_rate_id` from the shipping options. The price is
|
|
780
|
+
* the one quoted; an option older than 30 minutes is refused with a 422.
|
|
781
|
+
*
|
|
782
|
+
* @param {FiveOneEat.customer.SelectShippingRateRequest} request
|
|
550
783
|
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
551
784
|
*
|
|
552
785
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
@@ -556,8 +789,7 @@ class CartClient {
|
|
|
556
789
|
* @example
|
|
557
790
|
* await client.customer.cart.selectShippingOption({
|
|
558
791
|
* business: "business",
|
|
559
|
-
* provider_rate_id: "provider_rate_id"
|
|
560
|
-
* amount_cents: 1
|
|
792
|
+
* provider_rate_id: "provider_rate_id"
|
|
561
793
|
* })
|
|
562
794
|
*/
|
|
563
795
|
selectShippingOption(request, requestOptions) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as FiveOneEat from "../../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* business: "business",
|
|
6
|
+
* fulfillment_method: "ship"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface ChooseFulfillmentMethodRequest {
|
|
10
|
+
/** The business handle */
|
|
11
|
+
business: string;
|
|
12
|
+
fulfillment_method: FiveOneEat.FulfillmentType;
|
|
13
|
+
}
|
|
@@ -10,17 +10,18 @@
|
|
|
10
10
|
* }
|
|
11
11
|
* }
|
|
12
12
|
*/
|
|
13
|
-
export interface
|
|
14
|
-
/** The business
|
|
13
|
+
export interface ShippingAddressRequest {
|
|
14
|
+
/** The business handle */
|
|
15
15
|
business: string;
|
|
16
|
-
address:
|
|
16
|
+
address: ShippingAddressRequest.Address;
|
|
17
17
|
}
|
|
18
|
-
export declare namespace
|
|
18
|
+
export declare namespace ShippingAddressRequest {
|
|
19
19
|
interface Address {
|
|
20
20
|
line1: string;
|
|
21
|
+
line2?: (string | null) | undefined;
|
|
21
22
|
city: string;
|
|
22
23
|
state: string;
|
|
23
24
|
postal_code: string;
|
|
24
|
-
country?:
|
|
25
|
+
country?: string | undefined;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export type { AddItemCartRequest } from "./AddItemCartRequest.js";
|
|
2
2
|
export type { CheckoutCartRequest } from "./CheckoutCartRequest.js";
|
|
3
|
+
export type { ChooseFulfillmentMethodRequest } from "./ChooseFulfillmentMethodRequest.js";
|
|
3
4
|
export type { ClearCartRequest } from "./ClearCartRequest.js";
|
|
4
5
|
export type { CreatePaymentIntentCartRequest } from "./CreatePaymentIntentCartRequest.js";
|
|
5
6
|
export type { GetCartRequest } from "./GetCartRequest.js";
|
|
6
|
-
export type {
|
|
7
|
+
export type { ListShippingOptionsCartRequest } from "./ListShippingOptionsCartRequest.js";
|
|
8
|
+
export type { RefreshCartPaymentRequest } from "./RefreshCartPaymentRequest.js";
|
|
7
9
|
export type { RemoveItemCartRequest } from "./RemoveItemCartRequest.js";
|
|
8
|
-
export type {
|
|
10
|
+
export type { SelectShippingRateRequest } from "./SelectShippingRateRequest.js";
|
|
11
|
+
export type { ShippingAddressRequest } from "./ShippingAddressRequest.js";
|
|
9
12
|
export type { UpdateItemCartRequest } from "./UpdateItemCartRequest.js";
|
package/dist/cjs/api/resources/customer/resources/cart/types/ListShippingOptionsCartResponse.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ListShippingOptionsCartResponse {
|
|
2
|
+
options: ListShippingOptionsCartResponse.Options.Item[];
|
|
3
|
+
}
|
|
4
|
+
export declare namespace ListShippingOptionsCartResponse {
|
|
5
|
+
type Options = Options.Item[];
|
|
6
|
+
namespace Options {
|
|
7
|
+
interface Item {
|
|
8
|
+
provider_rate_id: string;
|
|
9
|
+
carrier: string;
|
|
10
|
+
service: string;
|
|
11
|
+
amount: number;
|
|
12
|
+
amount_cents: number;
|
|
13
|
+
currency: string;
|
|
14
|
+
carrier_delivery_days: number | null;
|
|
15
|
+
estimated_delivery_date: string | null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
package/dist/cjs/api/resources/customer/resources/cart/types/RefreshPaymentIntentCartResponse.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface RefreshPaymentIntentCartResponse {
|
|
2
|
+
total_changed: boolean;
|
|
3
|
+
client_secret: string;
|
|
4
|
+
payment_intent_id: string;
|
|
5
|
+
subtotal: number;
|
|
6
|
+
tax_amount: number;
|
|
7
|
+
shipping_amount: number;
|
|
8
|
+
platform_fee: number;
|
|
9
|
+
total_amount: number;
|
|
10
|
+
amount: number;
|
|
11
|
+
currency: RefreshPaymentIntentCartResponse.Currency;
|
|
12
|
+
}
|
|
13
|
+
export declare namespace RefreshPaymentIntentCartResponse {
|
|
14
|
+
const Currency: {
|
|
15
|
+
readonly Usd: "usd";
|
|
16
|
+
};
|
|
17
|
+
type Currency = (typeof Currency)[keyof typeof Currency];
|
|
18
|
+
}
|
package/dist/cjs/api/resources/customer/resources/cart/types/RefreshPaymentIntentCartResponse.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.RefreshPaymentIntentCartResponse = void 0;
|
|
5
|
+
var RefreshPaymentIntentCartResponse;
|
|
6
|
+
(function (RefreshPaymentIntentCartResponse) {
|
|
7
|
+
RefreshPaymentIntentCartResponse.Currency = {
|
|
8
|
+
Usd: "usd",
|
|
9
|
+
};
|
|
10
|
+
})(RefreshPaymentIntentCartResponse || (exports.RefreshPaymentIntentCartResponse = RefreshPaymentIntentCartResponse = {}));
|
|
@@ -2,7 +2,10 @@ export * from "./AddItemCartResponse.js";
|
|
|
2
2
|
export * from "./CheckoutCartResponse.js";
|
|
3
3
|
export * from "./CreatePaymentIntentCartResponse.js";
|
|
4
4
|
export * from "./GetCartResponse.js";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./ListShippingOptionsCartResponse.js";
|
|
6
|
+
export * from "./RefreshPaymentIntentCartResponse.js";
|
|
6
7
|
export * from "./RemoveItemCartResponse.js";
|
|
7
8
|
export * from "./SelectShippingOptionCartResponse.js";
|
|
9
|
+
export * from "./SetFulfillmentCartResponse.js";
|
|
10
|
+
export * from "./SetShippingAddressCartResponse.js";
|
|
8
11
|
export * from "./UpdateItemCartResponse.js";
|
|
@@ -18,7 +18,10 @@ __exportStar(require("./AddItemCartResponse.js"), exports);
|
|
|
18
18
|
__exportStar(require("./CheckoutCartResponse.js"), exports);
|
|
19
19
|
__exportStar(require("./CreatePaymentIntentCartResponse.js"), exports);
|
|
20
20
|
__exportStar(require("./GetCartResponse.js"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./ListShippingOptionsCartResponse.js"), exports);
|
|
22
|
+
__exportStar(require("./RefreshPaymentIntentCartResponse.js"), exports);
|
|
22
23
|
__exportStar(require("./RemoveItemCartResponse.js"), exports);
|
|
23
24
|
__exportStar(require("./SelectShippingOptionCartResponse.js"), exports);
|
|
25
|
+
__exportStar(require("./SetFulfillmentCartResponse.js"), exports);
|
|
26
|
+
__exportStar(require("./SetShippingAddressCartResponse.js"), exports);
|
|
24
27
|
__exportStar(require("./UpdateItemCartResponse.js"), exports);
|
package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/Client.d.ts
CHANGED
|
@@ -72,10 +72,16 @@ export declare class TicketingClient {
|
|
|
72
72
|
* Create a Stripe payment intent for the tickets held in the cart for the given event.
|
|
73
73
|
* Returns a client_secret for the mobile app to confirm payment with Stripe.
|
|
74
74
|
*
|
|
75
|
+
* A 409 `{status: "paid", message, payment_intent_id}` means these tickets
|
|
76
|
+
* are already paid for (the webhook issues them; never pay twice). A 409
|
|
77
|
+
* `{status: "processing", message}` means the payment is still in flight.
|
|
78
|
+
*
|
|
75
79
|
* @param {FiveOneEat.customer.events.CreatePaymentIntentRequest} request
|
|
76
80
|
* @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
77
81
|
*
|
|
78
82
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
83
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
84
|
+
* @throws {@link FiveOneEat.ConflictError}
|
|
79
85
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
80
86
|
*
|
|
81
87
|
* @example
|