@propeller-commerce/propeller-v2-vue-ui 0.3.22 → 0.3.23

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/CHANGELOG.md CHANGED
@@ -8,6 +8,22 @@ once it reaches 1.0. Until then (the `0.x` line) the public API may change
8
8
  between minor versions; breaking changes are called out below and in
9
9
  [MIGRATION.md](./MIGRATION.md).
10
10
 
11
+ ## [0.3.23] - 2026-06-26
12
+
13
+ ### Added
14
+
15
+ - **`useCheckout().placeOrder` now supports PSP (deferred-payment) orders.**
16
+ - New `orderStatus?` option — defaults to `'REQUEST'` in quote mode / `'NEW'`
17
+ otherwise; pass `'UNFINISHED'` (or any backend status string) for an order
18
+ awaiting an external payment whose final status the PSP webhook sets later.
19
+ - New `finalizeOrder?: boolean` option (default `true`). Pass `false` to defer
20
+ the order-confirmation email, confirm event, PDF attachment, **and cart
21
+ deletion** to payment time — so a shopper handed off to a PSP isn't emailed
22
+ and their cart isn't cleared before they've paid.
23
+
24
+ Backward compatible: existing callers behave exactly as before. Mirrors React
25
+ UI 0.4.14.
26
+
11
27
  ## [0.3.22] - 2026-06-25
12
28
 
13
29
  ### Added
@@ -22,6 +22,25 @@ export interface PlaceOrderOptions {
22
22
  isQuoteMode?: boolean;
23
23
  reference?: string;
24
24
  notes?: string;
25
+ /**
26
+ * Order status to set. When omitted it defaults to `'REQUEST'` in quote mode
27
+ * and `'NEW'` otherwise. Pass `'UNFINISHED'` for an order awaiting an external
28
+ * payment (PSP) whose final status the payment webhook sets later. Any backend
29
+ * status string is accepted.
30
+ */
31
+ orderStatus?: 'NEW' | 'REQUEST' | 'UNFINISHED' | (string & {});
32
+ /**
33
+ * Whether this placement *finalizes* the order — i.e. sends the order
34
+ * confirmation email, fires the confirm event, attaches the order PDF, and
35
+ * clears the cart. Defaults to `true`.
36
+ *
37
+ * Set this to `false` for an order awaiting an external payment (e.g.
38
+ * `'UNFINISHED'` orders handed off to a PSP). The confirmation/cart deletion
39
+ * should then happen when the payment is confirmed (the PSP webhook), not at
40
+ * placement — otherwise the shopper is emailed and the cart cleared before
41
+ * they've paid.
42
+ */
43
+ finalizeOrder?: boolean;
25
44
  }
26
45
  /** Backwards-friendly alias kept for the public `UseCheckout*` type re-exports. */
27
46
  export type PlaceOrderResult = Result<{
package/dist/index.cjs CHANGED
@@ -946,7 +946,9 @@ function useCheckout(options) {
946
946
  language
947
947
  });
948
948
  }
949
- const orderStatus = opts.isQuoteMode ? "REQUEST" : "NEW";
949
+ const orderStatus = opts.orderStatus ?? (opts.isQuoteMode ? "REQUEST" : "NEW");
950
+ const finalizeOrder = opts.finalizeOrder ?? true;
951
+ const sendConfirmation = finalizeOrder && !opts.isQuoteMode;
950
952
  const response = await cartService.processCart({
951
953
  id: cartId,
952
954
  input: { orderStatus, language }
@@ -957,10 +959,10 @@ function useCheckout(options) {
957
959
  orderId,
958
960
  status: orderStatus,
959
961
  payStatus: propellerSdkV2.PaymentStatuses.OPEN,
960
- sendOrderConfirmationEmail: !opts.isQuoteMode,
961
- addPDFAttachment: !opts.isQuoteMode,
962
- triggerOrderSendConfirmEvent: !opts.isQuoteMode,
963
- deleteCart: true
962
+ sendOrderConfirmationEmail: sendConfirmation,
963
+ addPDFAttachment: sendConfirmation,
964
+ triggerOrderSendConfirmEvent: sendConfirmation,
965
+ deleteCart: finalizeOrder
964
966
  });
965
967
  if (opts.isQuoteMode) {
966
968
  await orderService.triggerQuoteSendRequest?.({ orderId, language });