@final-commerce/command-frame 0.11.1-online.1 → 0.11.1-online.2
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.
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** The shopper-facing vocabulary: never the platform's payment / fulfilment states. */
|
|
2
2
|
export type CheckoutOrderStatus = 'awaiting_payment' | 'confirming' | 'payment_failed' | 'paid' | 'fulfilled' | 'partially_refunded' | 'refunded' | 'cancelled';
|
|
3
|
+
/** Why the server cancelled an order the shopper paid for. */
|
|
4
|
+
export type CheckoutCancelReason = 'sold_out';
|
|
3
5
|
export interface GetCheckoutStatusParams {
|
|
4
6
|
/**
|
|
5
7
|
* The receipt `startCheckout` returned, to name which order. Omitted: the checkout in flight,
|
|
@@ -13,6 +15,11 @@ export interface GetCheckoutStatusResponse {
|
|
|
13
15
|
status: CheckoutOrderStatus | null;
|
|
14
16
|
/** True once the money is in: `paid`, `fulfilled`, or refunded since. */
|
|
15
17
|
paid: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Why a `cancelled` order was cancelled, when the server cancelled it. `sold_out`: the stock ran out
|
|
20
|
+
* before the payment was captured, so the payment was released and nothing was charged.
|
|
21
|
+
*/
|
|
22
|
+
cancelReason?: CheckoutCancelReason;
|
|
16
23
|
receiptId: string | null;
|
|
17
24
|
timestamp: string;
|
|
18
25
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -240,7 +240,7 @@ export type { GetShippingOptions, GetShippingOptionsResponse, ShippingOptionView
|
|
|
240
240
|
export type { SelectShippingOption, SelectShippingOptionParams, SelectShippingOptionResponse, } from './actions/select-shipping-option/types';
|
|
241
241
|
export type { SetOutlet, SetOutletParams, SetOutletResponse } from './actions/set-outlet/types';
|
|
242
242
|
export type { ResumeCheckout, ResumeCheckoutParams, ResumeCheckoutResponse, ResumeCheckoutResult, } from './actions/resume-checkout/types';
|
|
243
|
-
export type { GetCheckoutStatus, GetCheckoutStatusParams, GetCheckoutStatusResponse, CheckoutOrderStatus, } from './actions/get-checkout-status/types';
|
|
243
|
+
export type { GetCheckoutStatus, GetCheckoutStatusParams, GetCheckoutStatusResponse, CheckoutOrderStatus, CheckoutCancelReason, } from './actions/get-checkout-status/types';
|
|
244
244
|
export type { GetMotoConfig, GetMotoConfigResponse, MotoUnavailableReason } from './actions/get-moto-config/types';
|
|
245
245
|
export type { AddCustomerNote, AddCustomerNoteParams, AddCustomerNoteResponse, } from './actions/add-customer-note/types';
|
|
246
246
|
export type { RemoveCustomerNote, RemoveCustomerNoteParams, RemoveCustomerNoteResponse, } from './actions/remove-customer-note/types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TopicEvent } from
|
|
1
|
+
import type { TopicEvent } from '../../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Payload for payment-failed event
|
|
4
4
|
*
|
|
@@ -9,7 +9,10 @@ import type { TopicEvent } from "../../../types";
|
|
|
9
9
|
export interface PaymentFailedPayload {
|
|
10
10
|
orderId: string;
|
|
11
11
|
receiptId: string;
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* The provider's result code, e.g. `Refused`, or an error name. `SoldOut`: the shopper pressed Pay
|
|
14
|
+
* and something in the cart can no longer be sold, so the card was never sent.
|
|
15
|
+
*/
|
|
13
16
|
resultCode: string;
|
|
14
17
|
/** Present when the failure carried a message worth showing. */
|
|
15
18
|
message?: string;
|