@clickaroo/checkout-ui 0.1.4-beta → 0.1.5-beta

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.
Files changed (137) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/index.mjs +1 -1
  3. package/dist/storybook/storybook-static/assets/APIs.en-BZfNNuoc.js +372 -0
  4. package/dist/storybook/storybook-static/assets/APIs.en-BZzPbEJW.js +372 -0
  5. package/dist/storybook/storybook-static/assets/APIs.en-DcEWunRx.js +372 -0
  6. package/dist/storybook/storybook-static/assets/APIs.en-DfWH0fys.js +372 -0
  7. package/dist/storybook/storybook-static/assets/APIs.en-TWb_-3VC.js +372 -0
  8. package/dist/storybook/storybook-static/assets/APIs.en-nicPQ5AW.js +372 -0
  9. package/dist/storybook/storybook-static/assets/CheckoutPage-CDW7SRyI.js +3 -0
  10. package/dist/storybook/storybook-static/assets/CheckoutPage-DFb28rrp.js +3 -0
  11. package/dist/storybook/storybook-static/assets/CheckoutPage-DSLcTghb.js +3 -0
  12. package/dist/storybook/storybook-static/assets/CheckoutPage-DgZ1RopD.js +3 -0
  13. package/dist/storybook/storybook-static/assets/CheckoutPage-DvHYA1Jd.js +3 -0
  14. package/dist/storybook/storybook-static/assets/CheckoutPage-d8MZfjpI.js +3 -0
  15. package/dist/storybook/storybook-static/assets/CheckoutPage.en-Bsh4jm31.js +147 -0
  16. package/dist/storybook/storybook-static/assets/CheckoutPage.en-Byu6MnFF.js +147 -0
  17. package/dist/storybook/storybook-static/assets/CheckoutPage.en-CNVaEQvK.js +147 -0
  18. package/dist/storybook/storybook-static/assets/CheckoutPage.en-D87qzfwm.js +147 -0
  19. package/dist/storybook/storybook-static/assets/CheckoutPage.en-DLb_7NPf.js +147 -0
  20. package/dist/storybook/storybook-static/assets/CheckoutPage.en-DQ0u0fHa.js +147 -0
  21. package/dist/storybook/storybook-static/assets/CheckoutPage.stories-B5y94bOo.js +44 -0
  22. package/dist/storybook/storybook-static/assets/CheckoutPage.stories-B8Vyz9GJ.js +44 -0
  23. package/dist/storybook/storybook-static/assets/CheckoutPage.stories-BRP4VrvR.js +44 -0
  24. package/dist/storybook/storybook-static/assets/CheckoutPage.stories-BahbUp4O.js +44 -0
  25. package/dist/storybook/storybook-static/assets/CheckoutPage.stories-DFK1bMdr.js +44 -0
  26. package/dist/storybook/storybook-static/assets/CheckoutPage.stories-DvaZetee.js +44 -0
  27. package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-B0J9WR4k.js +1 -0
  28. package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-BE_XGTCZ.js +1 -0
  29. package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-BorkAxO4.js +1 -0
  30. package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-C2GhQi7e.js +1 -0
  31. package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-D3zu28Rn.js +1 -0
  32. package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-DVI1_7_g.js +1 -0
  33. package/dist/storybook/storybook-static/assets/CustomCheckout.en-8VNcggT9.js +211 -0
  34. package/dist/storybook/storybook-static/assets/CustomCheckout.en-BMJEFVTk.js +211 -0
  35. package/dist/storybook/storybook-static/assets/CustomCheckout.en-Bq25x8qa.js +211 -0
  36. package/dist/storybook/storybook-static/assets/CustomCheckout.en-BvF7SmOy.js +211 -0
  37. package/dist/storybook/storybook-static/assets/CustomCheckout.en-uXQeih6h.js +211 -0
  38. package/dist/storybook/storybook-static/assets/CustomCheckout.en-wshSoFMr.js +211 -0
  39. package/dist/storybook/storybook-static/assets/CustomCheckout.stories-B8CnjGCn.js +6 -0
  40. package/dist/storybook/storybook-static/assets/CustomCheckout.stories-BQkpNbox.js +6 -0
  41. package/dist/storybook/storybook-static/assets/CustomCheckout.stories-BrF5j7zs.js +6 -0
  42. package/dist/storybook/storybook-static/assets/CustomCheckout.stories-DhCrUQc1.js +6 -0
  43. package/dist/storybook/storybook-static/assets/CustomCheckout.stories-ZCeqtMGJ.js +6 -0
  44. package/dist/storybook/storybook-static/assets/CustomCheckout.stories-rMIVoUs4.js +6 -0
  45. package/dist/storybook/storybook-static/assets/CustomerInfo-BMTfZ9z3.js +1 -0
  46. package/dist/storybook/storybook-static/assets/CustomerInfo-BqCSWi4I.js +1 -0
  47. package/dist/storybook/storybook-static/assets/CustomerInfo-BwyY9803.js +1 -0
  48. package/dist/storybook/storybook-static/assets/CustomerInfo-CPNuEjrH.js +1 -0
  49. package/dist/storybook/storybook-static/assets/CustomerInfo-DShSrjMR.js +1 -0
  50. package/dist/storybook/storybook-static/assets/CustomerInfo-mKAI6gWW.js +1 -0
  51. package/dist/storybook/storybook-static/assets/CustomerInfo.stories-BAbhNSal.js +9 -0
  52. package/dist/storybook/storybook-static/assets/CustomerInfo.stories-BwCrEBgN.js +9 -0
  53. package/dist/storybook/storybook-static/assets/CustomerInfo.stories-D1l3Glaq.js +9 -0
  54. package/dist/storybook/storybook-static/assets/CustomerInfo.stories-Dv6cHWui.js +9 -0
  55. package/dist/storybook/storybook-static/assets/CustomerInfo.stories-jpdDC3ta.js +9 -0
  56. package/dist/storybook/storybook-static/assets/CustomerInfo.stories-tyhy9PWf.js +9 -0
  57. package/dist/storybook/storybook-static/assets/DeliveryAddress-CeuByf4d.js +2 -0
  58. package/dist/storybook/storybook-static/assets/DeliveryAddress-DOxyPw17.js +2 -0
  59. package/dist/storybook/storybook-static/assets/DeliveryAddress-DY5lFnTv.js +2 -0
  60. package/dist/storybook/storybook-static/assets/DeliveryAddress-DaRy4l-D.js +2 -0
  61. package/dist/storybook/storybook-static/assets/DeliveryAddress-QAGxLlLf.js +2 -0
  62. package/dist/storybook/storybook-static/assets/DeliveryAddress-TRtlNz2v.js +2 -0
  63. package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-C1JtetLS.js +9 -0
  64. package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-C8sE6JJZ.js +9 -0
  65. package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-CBScReyV.js +9 -0
  66. package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-CqmJ_Wn7.js +9 -0
  67. package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-FMwTSh9f.js +9 -0
  68. package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-vQ0cdVl6.js +9 -0
  69. package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-C4t3f4os.js +2 -0
  70. package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-CtrnOF1G.js +2 -0
  71. package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-DU1kBIGp.js +2 -0
  72. package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-DzgR8M-W.js +2 -0
  73. package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-OiuU2wez.js +2 -0
  74. package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-Q5WDl3Gp.js +2 -0
  75. package/dist/storybook/storybook-static/assets/Guide.en-BRVwtDXj.js +107 -0
  76. package/dist/storybook/storybook-static/assets/Guide.en-Boc44Lax.js +107 -0
  77. package/dist/storybook/storybook-static/assets/Guide.en-CKA244dX.js +107 -0
  78. package/dist/storybook/storybook-static/assets/Guide.en-Citkzdg9.js +107 -0
  79. package/dist/storybook/storybook-static/assets/Guide.en-Dn9xb9YI.js +107 -0
  80. package/dist/storybook/storybook-static/assets/Guide.en-XzxJQK_F.js +107 -0
  81. package/dist/storybook/storybook-static/assets/PaymentMethods-BFtlMopq.js +2 -0
  82. package/dist/storybook/storybook-static/assets/PaymentMethods-Buladk2O.js +2 -0
  83. package/dist/storybook/storybook-static/assets/PaymentMethods-CBXk2f9N.js +2 -0
  84. package/dist/storybook/storybook-static/assets/PaymentMethods-DmV3o0ow.js +2 -0
  85. package/dist/storybook/storybook-static/assets/PaymentMethods-DxorWSOl.js +2 -0
  86. package/dist/storybook/storybook-static/assets/PaymentMethods-afz1CTO5.js +2 -0
  87. package/dist/storybook/storybook-static/assets/PaymentMethods.stories-6fZvfvMO.js +9 -0
  88. package/dist/storybook/storybook-static/assets/PaymentMethods.stories-CcjSRFbb.js +9 -0
  89. package/dist/storybook/storybook-static/assets/PaymentMethods.stories-D1SSfWqv.js +9 -0
  90. package/dist/storybook/storybook-static/assets/PaymentMethods.stories-DJpOtGJg.js +9 -0
  91. package/dist/storybook/storybook-static/assets/PaymentMethods.stories-Dyg3R8Cs.js +9 -0
  92. package/dist/storybook/storybook-static/assets/PaymentMethods.stories-U-xbCFtF.js +9 -0
  93. package/dist/storybook/storybook-static/assets/QuickStart.en-8otT6VDx.js +136 -0
  94. package/dist/storybook/storybook-static/assets/QuickStart.en-Bz56Z2wW.js +136 -0
  95. package/dist/storybook/storybook-static/assets/QuickStart.en-C1fKNHfm.js +136 -0
  96. package/dist/storybook/storybook-static/assets/QuickStart.en-CEFLfOWt.js +136 -0
  97. package/dist/storybook/storybook-static/assets/QuickStart.en-D5OiYfrB.js +136 -0
  98. package/dist/storybook/storybook-static/assets/QuickStart.en-wgtxGAFt.js +136 -0
  99. package/dist/storybook/storybook-static/assets/ValidateInput-BKNagaQv.js +2 -0
  100. package/dist/storybook/storybook-static/assets/ValidateInput-BMZhq5zE.js +2 -0
  101. package/dist/storybook/storybook-static/assets/ValidateInput-CECRKp4c.js +2 -0
  102. package/dist/storybook/storybook-static/assets/ValidateInput-CXYuXafK.js +2 -0
  103. package/dist/storybook/storybook-static/assets/ValidateInput-LNzX4jJP.js +2 -0
  104. package/dist/storybook/storybook-static/assets/ValidateInput-np1-zwvJ.js +2 -0
  105. package/dist/storybook/storybook-static/assets/entry-preview-BAF1DioI.js +2 -0
  106. package/dist/storybook/storybook-static/assets/entry-preview-BAb-nh3P.js +2 -0
  107. package/dist/storybook/storybook-static/assets/entry-preview-BQMc41xo.js +2 -0
  108. package/dist/storybook/storybook-static/assets/entry-preview-C4SPQchM.js +2 -0
  109. package/dist/storybook/storybook-static/assets/entry-preview-CAnH1TUA.js +2 -0
  110. package/dist/storybook/storybook-static/assets/entry-preview-GhM6ttN0.js +2 -0
  111. package/dist/storybook/storybook-static/assets/iframe-CakT_Hx-.js +211 -0
  112. package/dist/storybook/storybook-static/assets/iframe-Crv4raYy.js +211 -0
  113. package/dist/storybook/storybook-static/assets/iframe-CueR_wS4.js +211 -0
  114. package/dist/storybook/storybook-static/assets/iframe-DWFwLXCc.js +211 -0
  115. package/dist/storybook/storybook-static/assets/iframe-SJLFWhX6.js +211 -0
  116. package/dist/storybook/storybook-static/assets/iframe-eGyOKkka.js +211 -0
  117. package/dist/storybook/storybook-static/assets/index-3vMs57rT.js +575 -0
  118. package/dist/storybook/storybook-static/assets/index-BlPVJQpb.js +575 -0
  119. package/dist/storybook/storybook-static/assets/index-Bz3Q1Yw_.js +575 -0
  120. package/dist/storybook/storybook-static/assets/index-D66ljFJA.js +575 -0
  121. package/dist/storybook/storybook-static/assets/index-DnrKlQ76.js +575 -0
  122. package/dist/storybook/storybook-static/assets/index-DoDFfets.js +575 -0
  123. package/dist/storybook/storybook-static/assets/preview-C1X5Ys-q.js +2 -0
  124. package/dist/storybook/storybook-static/assets/preview-CbAwkmzD.js +2 -0
  125. package/dist/storybook/storybook-static/assets/preview-DGJdQn9n.js +2 -0
  126. package/dist/storybook/storybook-static/assets/preview-DJkpO_nB.js +2 -0
  127. package/dist/storybook/storybook-static/assets/preview-De1PUXkc.js +2 -0
  128. package/dist/storybook/storybook-static/assets/preview-DyVoah3G.js +2 -0
  129. package/dist/storybook/storybook-static/assets/useCheckoutContext-3YTrU8Qh.js +27 -0
  130. package/dist/storybook/storybook-static/assets/useCheckoutContext-BW2h13W8.js +27 -0
  131. package/dist/storybook/storybook-static/assets/useCheckoutContext-BXtGY5u3.js +27 -0
  132. package/dist/storybook/storybook-static/assets/useCheckoutContext-C7KjDyWW.js +27 -0
  133. package/dist/storybook/storybook-static/assets/useCheckoutContext-CroxIBFh.js +27 -0
  134. package/dist/storybook/storybook-static/assets/useCheckoutContext-L3zhltsm.js +27 -0
  135. package/dist/storybook/storybook-static/iframe.html +1 -1
  136. package/dist/storybook/storybook-static/project.json +1 -1
  137. package/package.json +1 -1
@@ -0,0 +1,147 @@
1
+ import{j as e}from"./jsx-runtime-DiklIkkE.js";import{useMDXComponents as c}from"./index-ChEI-nsM.js";import{M as s,C as o,a as d}from"./index-BlPVJQpb.js";import{C as l,D as r}from"./CheckoutPage.stories-BahbUp4O.js";import"./index-DRjF_FHU.js";import"./iframe-CueR_wS4.js";import"./index-B7ki2Uzk.js";import"./index-D-Mha1DF.js";import"./index-DrFu-skq.js";import"./useCheckoutContext-BXtGY5u3.js";import"./CheckoutPage-d8MZfjpI.js";import"./CustomerInfo-BwyY9803.js";import"./ValidateInput-LNzX4jJP.js";import"./DeliveryAddress-QAGxLlLf.js";import"./PaymentMethods-afz1CTO5.js";function i(t){const n={a:"a",code:"code",h1:"h1",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...c(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(s,{of:l,title:"Documentation/Usage Guide/CheckoutPage",name:"CheckoutPage (English)"}),`
2
+ `,e.jsx(n.h1,{id:"checkoutpage",children:"CheckoutPage"}),`
3
+ `,e.jsx(n.p,{children:"A complete checkout page component that integrates customer information, delivery address, payment methods, and order submission functionality."}),`
4
+ `,e.jsx(n.h3,{id:"basic-usage",children:"Basic Usage"}),`
5
+ `,e.jsx(o,{of:r}),`
6
+ `,e.jsx(n.h3,{id:"props",children:"Props"}),`
7
+ `,e.jsx(d,{of:r}),`
8
+ `,e.jsx(n.h4,{id:"cart",children:"cart"}),`
9
+ `,e.jsx(n.p,{children:"Array of cart items. Each item represents a product in the checkout."}),`
10
+ `,e.jsxs(n.p,{children:["Type: ",e.jsx(n.code,{children:"CartItem[]"}),". See ",e.jsx(n.a,{href:"#cartitem",children:"CartItem Type Definition"})," for details."]}),`
11
+ `,e.jsx(n.p,{children:"Each cart item contains the following fields:"}),`
12
+ `,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Required Fields:"})}),`
13
+ `,e.jsxs("table",{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Field"}),e.jsx("th",{children:"Type"}),e.jsx("th",{children:"Required"}),e.jsx("th",{children:"Description"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("code",{children:"sku"})}),e.jsx("td",{children:e.jsx("code",{children:"string"})}),e.jsx("td",{children:"✅"}),e.jsx("td",{children:"Product SKU"})]}),e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("code",{children:"offerPricePoint"})}),e.jsx("td",{children:e.jsx("code",{children:"string"})}),e.jsx("td",{children:"✅"}),e.jsx("td",{children:"Price Point ID"})]})]})]}),`
14
+ `,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Optional Fields:"})}),`
15
+ `,e.jsxs(n.p,{children:["In addition to the two required fields ",e.jsx(n.code,{children:"sku"})," and ",e.jsx(n.code,{children:"offerPricePoint"}),", you can pass any other fields to each cart item. These additional fields will be saved to the order's ",e.jsx(n.code,{children:"metadata"})," and can be accessed later when retrieving order details through the ",e.jsx(n.code,{children:"useOrderDetail"})," hook."]}),`
16
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`const cart = [
17
+ {
18
+ sku: "TEST001",
19
+ offerPricePoint: "OPP-TEST001",
20
+ // Any other fields are allowed
21
+ title: "Product Title",
22
+ price: 99.99,
23
+ image: "https://example.com/product.jpg",
24
+ category: "Electronics",
25
+ // ... more fields
26
+ }
27
+ ];
28
+
29
+ const { orderDetail } = useOrderDetail(orderCode)
30
+ console.log(orderDetail.metadata.products)
31
+ /** [
32
+ {
33
+ sku: "TEST001",
34
+ offerPricePoint: "OPP-TEST001",
35
+ title: "Product Title",
36
+ price: 99.99,
37
+ image: "https://example.com/product.jpg",
38
+ category: "Electronics",
39
+ }
40
+ ]
41
+ **/
42
+ `})}),`
43
+ `,e.jsx(n.h4,{id:"oncheckoutinit",children:"onCheckoutInit"}),`
44
+ `,e.jsxs(n.p,{children:["Callback function when checkout initializes, triggered immediately after the ",e.jsx(n.code,{children:"CheckoutPage"})," component mounts, used to track the start of the checkout flow."]}),`
45
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`onCheckoutInit?: () => void
46
+ `})}),`
47
+ `,e.jsx(n.h4,{id:"onpaymentinfocomplete",children:"onPaymentInfoComplete"}),`
48
+ `,e.jsx(n.p,{children:"Callback function when payment information is complete, triggered when the user completes the payment form and payment element validation passes."}),`
49
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`onPaymentInfoComplete?: (products: CheckoutCartItem[], totalAmount: number) => void
50
+ `})}),`
51
+ `,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Parameter Description:"})}),`
52
+ `,e.jsxs(n.ul,{children:[`
53
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"products"})," - Cart items array, type ",e.jsx(n.code,{children:"CheckoutCartItem[]"}),". Returns an array of cart items. See ",e.jsx(n.a,{href:"#checkoutcartitem",children:"CheckoutCartItem Type Definition"})," for details"]}),`
54
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"totalAmount"})," - Total payment amount in cents (e.g., 9999 represents $99.99). For multiple items, this is the sum of all items"]}),`
55
+ `]}),`
56
+ `,e.jsx(n.h4,{id:"onordersubmit",children:"onOrderSubmit"}),`
57
+ `,e.jsx(n.p,{children:"Callback function when order is submitted, triggered after the user clicks the submit button and before order processing begins."}),`
58
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`onOrderSubmit?: (products: CheckoutCartItem[], totalAmount: number) => void
59
+ `})}),`
60
+ `,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Parameter Description:"})}),`
61
+ `,e.jsxs(n.ul,{children:[`
62
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"products"})," - Submitted cart items array, type ",e.jsx(n.code,{children:"CheckoutCartItem[]"}),". See ",e.jsx(n.a,{href:"#checkoutcartitem",children:"CheckoutCartItem Type Definition"})," for details"]}),`
63
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"totalAmount"})," - Total amount at submission time in cents (e.g., 9999 represents $99.99)"]}),`
64
+ `]}),`
65
+ `,e.jsx(n.h4,{id:"onordersuccess",children:"onOrderSuccess"}),`
66
+ `,e.jsx(n.p,{children:"Callback function when order succeeds, triggered after the order is successfully created."}),`
67
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`onOrderSuccess?: (orderCode: string, tradeCode?: string) => void
68
+ `})}),`
69
+ `,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Parameter Description:"})}),`
70
+ `,e.jsxs(n.ul,{children:[`
71
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"orderCode"})," - Order code"]}),`
72
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"tradeCode"})," - Trade code (optional)"]}),`
73
+ `]}),`
74
+ `,e.jsx(n.h3,{id:"usage-examples",children:"Usage Examples"}),`
75
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`import { CheckoutPage } from '@clickaroo/checkout-ui';
76
+
77
+ function App() {
78
+ const cart = [
79
+ {
80
+ sku: "TEST001",
81
+ offerPricePoint: "OPP-TEST001",
82
+ }
83
+ ];
84
+
85
+ return (
86
+ <CheckoutPage
87
+ cart={cart}
88
+ onCheckoutInit={() => {
89
+ console.log('Checkout initialized');
90
+ }}
91
+ onPaymentInfoComplete={(products, totalAmount) => {
92
+ console.log('Payment info complete');
93
+ console.log('Total amount:', totalAmount / 100);
94
+ products.forEach((product) => {
95
+ console.log('Product SKU:', product.sku);
96
+ console.log('Unit price:', product.priceInCents / 100, product.currency);
97
+ console.log('Quantity:', product.quantity);
98
+ console.log('Payment type:', product.paymentType);
99
+ });
100
+ }}
101
+ onOrderSubmit={(products, totalAmount) => {
102
+ console.log('Order submitted');
103
+ console.log('Total amount:', totalAmount / 100);
104
+ }}
105
+ onOrderSuccess={(orderCode, tradeCode) => {
106
+ console.log('Order successful', orderCode, tradeCode);
107
+ }}
108
+ />
109
+ );
110
+ }
111
+ `})}),`
112
+ `,e.jsx(n.h3,{id:"key-types",children:"Key Types"}),`
113
+ `,e.jsx(n.h4,{id:"cartitem",children:"CartItem"}),`
114
+ `,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"CartItem"})," is the basic cart item type passed to the ",e.jsx(n.code,{children:"CheckoutPage"})," component:"]}),`
115
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`interface CartItem {
116
+ // Required fields
117
+ sku: string; // Product SKU
118
+ offerPricePoint: string; // Price Point ID
119
+
120
+ // Optional fields - allows any custom fields, which will be saved to order metadata
121
+ [key: string]: unknown;
122
+ }
123
+ `})}),`
124
+ `,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Field Description:"})}),`
125
+ `,e.jsxs(n.ul,{children:[`
126
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"sku"})," - Product SKU, required field"]}),`
127
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"offerPricePoint"})," - Price Point ID, required field"]}),`
128
+ `,e.jsxs(n.li,{children:["Other fields - You can pass any additional fields (such as ",e.jsx(n.code,{children:"title"}),", ",e.jsx(n.code,{children:"price"}),", ",e.jsx(n.code,{children:"image"}),", etc.), which will be saved to the order's ",e.jsx(n.code,{children:"metadata"})," and can be retrieved through ",e.jsx(n.code,{children:"useOrderDetail"})]}),`
129
+ `]}),`
130
+ `,e.jsx(n.h4,{id:"checkoutcartitem",children:"CheckoutCartItem"}),`
131
+ `,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"CheckoutCartItem"})," is the cart item type returned in callback functions, extending ",e.jsx(n.code,{children:"CartItem"})," and including price details:"]}),`
132
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`interface CheckoutCartItem extends CartItem {
133
+ // Inherits all fields from CartItem (sku, offerPricePoint, etc.)
134
+ priceInCents: number; // Unit price in cents (e.g., 9999 represents $99.99)
135
+ currency: string; // Currency type (e.g., "USD", "EUR")
136
+ quantity: number; // Quantity
137
+ paymentType: "one-time" | "subscription"; // Payment type
138
+ }
139
+ `})}),`
140
+ `,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Field Description:"})}),`
141
+ `,e.jsxs(n.ul,{children:[`
142
+ `,e.jsxs(n.li,{children:["Inherits all fields from ",e.jsx(n.code,{children:"CartItem"})," (such as ",e.jsx(n.code,{children:"sku"}),", ",e.jsx(n.code,{children:"offerPricePoint"}),", etc.)"]}),`
143
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"priceInCents"})," - Unit price in cents"]}),`
144
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"currency"})," - Currency type"]}),`
145
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"quantity"})," - Quantity"]}),`
146
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"paymentType"})," - Payment type: ",e.jsx(n.code,{children:'"one-time"'})," for one-time payment, ",e.jsx(n.code,{children:'"subscription"'})," for subscription payment"]}),`
147
+ `]})]})}function T(t={}){const{wrapper:n}={...c(),...t.components};return n?e.jsx(n,{...t,children:e.jsx(i,{...t})}):i(t)}export{T as default};
@@ -0,0 +1,147 @@
1
+ import{j as e}from"./jsx-runtime-DiklIkkE.js";import{useMDXComponents as c}from"./index-ChEI-nsM.js";import{M as s,C as o,a as d}from"./index-D66ljFJA.js";import{C as l,D as r}from"./CheckoutPage.stories-DvaZetee.js";import"./index-DRjF_FHU.js";import"./iframe-CakT_Hx-.js";import"./index-B7ki2Uzk.js";import"./index-D-Mha1DF.js";import"./index-DrFu-skq.js";import"./useCheckoutContext-C7KjDyWW.js";import"./CheckoutPage-CDW7SRyI.js";import"./CustomerInfo-CPNuEjrH.js";import"./ValidateInput-BKNagaQv.js";import"./DeliveryAddress-CeuByf4d.js";import"./PaymentMethods-BFtlMopq.js";function i(t){const n={a:"a",code:"code",h1:"h1",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...c(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(s,{of:l,title:"Documentation/Usage Guide/CheckoutPage",name:"CheckoutPage (English)"}),`
2
+ `,e.jsx(n.h1,{id:"checkoutpage",children:"CheckoutPage"}),`
3
+ `,e.jsx(n.p,{children:"A complete checkout page component that integrates customer information, delivery address, payment methods, and order submission functionality."}),`
4
+ `,e.jsx(n.h3,{id:"basic-usage",children:"Basic Usage"}),`
5
+ `,e.jsx(o,{of:r}),`
6
+ `,e.jsx(n.h3,{id:"props",children:"Props"}),`
7
+ `,e.jsx(d,{of:r}),`
8
+ `,e.jsx(n.h4,{id:"cart",children:"cart"}),`
9
+ `,e.jsx(n.p,{children:"Array of cart items. Each item represents a product in the checkout."}),`
10
+ `,e.jsxs(n.p,{children:["Type: ",e.jsx(n.code,{children:"CartItem[]"}),". See ",e.jsx(n.a,{href:"#cartitem",children:"CartItem Type Definition"})," for details."]}),`
11
+ `,e.jsx(n.p,{children:"Each cart item contains the following fields:"}),`
12
+ `,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Required Fields:"})}),`
13
+ `,e.jsxs("table",{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Field"}),e.jsx("th",{children:"Type"}),e.jsx("th",{children:"Required"}),e.jsx("th",{children:"Description"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("code",{children:"sku"})}),e.jsx("td",{children:e.jsx("code",{children:"string"})}),e.jsx("td",{children:"✅"}),e.jsx("td",{children:"Product SKU"})]}),e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("code",{children:"offerPricePoint"})}),e.jsx("td",{children:e.jsx("code",{children:"string"})}),e.jsx("td",{children:"✅"}),e.jsx("td",{children:"Price Point ID"})]})]})]}),`
14
+ `,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Optional Fields:"})}),`
15
+ `,e.jsxs(n.p,{children:["In addition to the two required fields ",e.jsx(n.code,{children:"sku"})," and ",e.jsx(n.code,{children:"offerPricePoint"}),", you can pass any other fields to each cart item. These additional fields will be saved to the order's ",e.jsx(n.code,{children:"metadata"})," and can be accessed later when retrieving order details through the ",e.jsx(n.code,{children:"useOrderDetail"})," hook."]}),`
16
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`const cart = [
17
+ {
18
+ sku: "TEST001",
19
+ offerPricePoint: "OPP-TEST001",
20
+ // Any other fields are allowed
21
+ title: "Product Title",
22
+ price: 99.99,
23
+ image: "https://example.com/product.jpg",
24
+ category: "Electronics",
25
+ // ... more fields
26
+ }
27
+ ];
28
+
29
+ const { orderDetail } = useOrderDetail(orderCode)
30
+ console.log(orderDetail.metadata.products)
31
+ /** [
32
+ {
33
+ sku: "TEST001",
34
+ offerPricePoint: "OPP-TEST001",
35
+ title: "Product Title",
36
+ price: 99.99,
37
+ image: "https://example.com/product.jpg",
38
+ category: "Electronics",
39
+ }
40
+ ]
41
+ **/
42
+ `})}),`
43
+ `,e.jsx(n.h4,{id:"oncheckoutinit",children:"onCheckoutInit"}),`
44
+ `,e.jsxs(n.p,{children:["Callback function when checkout initializes, triggered immediately after the ",e.jsx(n.code,{children:"CheckoutPage"})," component mounts, used to track the start of the checkout flow."]}),`
45
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`onCheckoutInit?: () => void
46
+ `})}),`
47
+ `,e.jsx(n.h4,{id:"onpaymentinfocomplete",children:"onPaymentInfoComplete"}),`
48
+ `,e.jsx(n.p,{children:"Callback function when payment information is complete, triggered when the user completes the payment form and payment element validation passes."}),`
49
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`onPaymentInfoComplete?: (products: CheckoutCartItem[], totalAmount: number) => void
50
+ `})}),`
51
+ `,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Parameter Description:"})}),`
52
+ `,e.jsxs(n.ul,{children:[`
53
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"products"})," - Cart items array, type ",e.jsx(n.code,{children:"CheckoutCartItem[]"}),". Returns an array of cart items. See ",e.jsx(n.a,{href:"#checkoutcartitem",children:"CheckoutCartItem Type Definition"})," for details"]}),`
54
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"totalAmount"})," - Total payment amount in cents (e.g., 9999 represents $99.99). For multiple items, this is the sum of all items"]}),`
55
+ `]}),`
56
+ `,e.jsx(n.h4,{id:"onordersubmit",children:"onOrderSubmit"}),`
57
+ `,e.jsx(n.p,{children:"Callback function when order is submitted, triggered after the user clicks the submit button and before order processing begins."}),`
58
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`onOrderSubmit?: (products: CheckoutCartItem[], totalAmount: number) => void
59
+ `})}),`
60
+ `,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Parameter Description:"})}),`
61
+ `,e.jsxs(n.ul,{children:[`
62
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"products"})," - Submitted cart items array, type ",e.jsx(n.code,{children:"CheckoutCartItem[]"}),". See ",e.jsx(n.a,{href:"#checkoutcartitem",children:"CheckoutCartItem Type Definition"})," for details"]}),`
63
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"totalAmount"})," - Total amount at submission time in cents (e.g., 9999 represents $99.99)"]}),`
64
+ `]}),`
65
+ `,e.jsx(n.h4,{id:"onordersuccess",children:"onOrderSuccess"}),`
66
+ `,e.jsx(n.p,{children:"Callback function when order succeeds, triggered after the order is successfully created."}),`
67
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`onOrderSuccess?: (orderCode: string, tradeCode?: string) => void
68
+ `})}),`
69
+ `,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Parameter Description:"})}),`
70
+ `,e.jsxs(n.ul,{children:[`
71
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"orderCode"})," - Order code"]}),`
72
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"tradeCode"})," - Trade code (optional)"]}),`
73
+ `]}),`
74
+ `,e.jsx(n.h3,{id:"usage-examples",children:"Usage Examples"}),`
75
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`import { CheckoutPage } from '@clickaroo/checkout-ui';
76
+
77
+ function App() {
78
+ const cart = [
79
+ {
80
+ sku: "TEST001",
81
+ offerPricePoint: "OPP-TEST001",
82
+ }
83
+ ];
84
+
85
+ return (
86
+ <CheckoutPage
87
+ cart={cart}
88
+ onCheckoutInit={() => {
89
+ console.log('Checkout initialized');
90
+ }}
91
+ onPaymentInfoComplete={(products, totalAmount) => {
92
+ console.log('Payment info complete');
93
+ console.log('Total amount:', totalAmount / 100);
94
+ products.forEach((product) => {
95
+ console.log('Product SKU:', product.sku);
96
+ console.log('Unit price:', product.priceInCents / 100, product.currency);
97
+ console.log('Quantity:', product.quantity);
98
+ console.log('Payment type:', product.paymentType);
99
+ });
100
+ }}
101
+ onOrderSubmit={(products, totalAmount) => {
102
+ console.log('Order submitted');
103
+ console.log('Total amount:', totalAmount / 100);
104
+ }}
105
+ onOrderSuccess={(orderCode, tradeCode) => {
106
+ console.log('Order successful', orderCode, tradeCode);
107
+ }}
108
+ />
109
+ );
110
+ }
111
+ `})}),`
112
+ `,e.jsx(n.h3,{id:"key-types",children:"Key Types"}),`
113
+ `,e.jsx(n.h4,{id:"cartitem",children:"CartItem"}),`
114
+ `,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"CartItem"})," is the basic cart item type passed to the ",e.jsx(n.code,{children:"CheckoutPage"})," component:"]}),`
115
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`interface CartItem {
116
+ // Required fields
117
+ sku: string; // Product SKU
118
+ offerPricePoint: string; // Price Point ID
119
+
120
+ // Optional fields - allows any custom fields, which will be saved to order metadata
121
+ [key: string]: unknown;
122
+ }
123
+ `})}),`
124
+ `,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Field Description:"})}),`
125
+ `,e.jsxs(n.ul,{children:[`
126
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"sku"})," - Product SKU, required field"]}),`
127
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"offerPricePoint"})," - Price Point ID, required field"]}),`
128
+ `,e.jsxs(n.li,{children:["Other fields - You can pass any additional fields (such as ",e.jsx(n.code,{children:"title"}),", ",e.jsx(n.code,{children:"price"}),", ",e.jsx(n.code,{children:"image"}),", etc.), which will be saved to the order's ",e.jsx(n.code,{children:"metadata"})," and can be retrieved through ",e.jsx(n.code,{children:"useOrderDetail"})]}),`
129
+ `]}),`
130
+ `,e.jsx(n.h4,{id:"checkoutcartitem",children:"CheckoutCartItem"}),`
131
+ `,e.jsxs(n.p,{children:[e.jsx(n.code,{children:"CheckoutCartItem"})," is the cart item type returned in callback functions, extending ",e.jsx(n.code,{children:"CartItem"})," and including price details:"]}),`
132
+ `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`interface CheckoutCartItem extends CartItem {
133
+ // Inherits all fields from CartItem (sku, offerPricePoint, etc.)
134
+ priceInCents: number; // Unit price in cents (e.g., 9999 represents $99.99)
135
+ currency: string; // Currency type (e.g., "USD", "EUR")
136
+ quantity: number; // Quantity
137
+ paymentType: "one-time" | "subscription"; // Payment type
138
+ }
139
+ `})}),`
140
+ `,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Field Description:"})}),`
141
+ `,e.jsxs(n.ul,{children:[`
142
+ `,e.jsxs(n.li,{children:["Inherits all fields from ",e.jsx(n.code,{children:"CartItem"})," (such as ",e.jsx(n.code,{children:"sku"}),", ",e.jsx(n.code,{children:"offerPricePoint"}),", etc.)"]}),`
143
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"priceInCents"})," - Unit price in cents"]}),`
144
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"currency"})," - Currency type"]}),`
145
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"quantity"})," - Quantity"]}),`
146
+ `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"paymentType"})," - Payment type: ",e.jsx(n.code,{children:'"one-time"'})," for one-time payment, ",e.jsx(n.code,{children:'"subscription"'})," for subscription payment"]}),`
147
+ `]})]})}function T(t={}){const{wrapper:n}={...c(),...t.components};return n?e.jsx(n,{...t,children:e.jsx(i,{...t})}):i(t)}export{T as default};
@@ -0,0 +1,44 @@
1
+ import{S as r,c as i,D as l}from"./useCheckoutContext-L3zhltsm.js";import{C as u}from"./CheckoutPage-DvHYA1Jd.js";i(l);const m={component:u,title:"Components/CheckoutPage",parameters:{docs:{description:{component:"Complete checkout page component including customer information, address information, payment methods, and order submission button."}},controls:{sort:"none",include:["cart","googleApiKey","onCheckoutInit","onPaymentInfoComplete","onOrderSubmit","onOrderSuccess"]}},argTypes:{cart:{description:"Array of cart items. Each item must include `sku` and `offerPricePoint`. Note: even for a single product, pass it as an array with one item.",control:{type:"object"},table:{type:{summary:"CartItem[]"},category:"Product Information"}},onCheckoutInit:{description:"Callback function triggered when checkout initializes, fired immediately after CheckoutPage component mounts.",action:"onCheckoutInit",table:{type:{summary:"() => void"},category:"Event Callbacks"}},onPaymentInfoComplete:{description:"Callback function triggered when payment information is complete, fired when user completes payment form (Stripe payment element validation passes).",action:"onPaymentInfoComplete",table:{type:{summary:"(products: CheckoutCartItem[], totalAmount: number) => void"},category:"Event Callbacks"}},onOrderSubmit:{description:"Callback function triggered when order is submitted, fired after user clicks submit button and before order processing begins.",action:"onOrderSubmit",table:{type:{summary:"(products: CheckoutCartItem[], totalAmount: number) => void"},category:"Event Callbacks"}},onOrderSuccess:{description:"Callback function triggered when order is successfully created.",action:"onOrderSuccess",table:{type:{summary:"(orderCode: string, tradeCode?: string) => void"},category:"Event Callbacks"}},googleApiKey:{description:"Google Places API Key for enabling address autocomplete functionality.",control:{type:"text"},table:{type:{summary:"string"},category:"Configuration"}}}},n={args:{cart:[{sku:"TEST001",offerPricePoint:r.MULTIPLE[0],title:"Product 1",price:99.99,image:"https://example.com/product.jpg",category:"Electronics"},{sku:"TEST002",offerPricePoint:r.MULTIPLE[1],title:"Product 2",price:149.99,image:"https://example.com/product.jpg",category:"Electronics"}],googleApiKey:"AIzaSyCtZ0TqBCGRf1OtLwTmJANQ4_sOpTs5x1w",onCheckoutInit:()=>{console.log("✅ Checkout initialized")},onPaymentInfoComplete:(t,o)=>{console.log("✅ Payment info complete"),console.log("Total amount:",o/100),t.forEach(e=>{console.log(` - ${e.sku}: ${e.priceInCents/100} ${e.currency.toUpperCase()}`)})},onOrderSubmit:(t,o)=>{console.log("✅ Order submitted"),console.log("Submitted amount:",o/100),t.forEach(e=>{console.log(` - ${e.sku}: ${e.priceInCents/100} ${e.currency.toUpperCase()}`)})},onOrderSuccess:(t,o)=>{console.log("✅ Order successful"),console.log("Order code:",t),o&&console.log("Trade code:",o)}}};var c,a,s;n.parameters={...n.parameters,docs:{...(c=n.parameters)==null?void 0:c.docs,source:{originalSource:`{
2
+ args: {
3
+ cart: [{
4
+ sku: 'TEST001',
5
+ offerPricePoint: STORY_OFFER_PRICE_POINTS.MULTIPLE[0],
6
+ title: 'Product 1',
7
+ price: 99.99,
8
+ image: 'https://example.com/product.jpg',
9
+ category: 'Electronics'
10
+ }, {
11
+ sku: 'TEST002',
12
+ offerPricePoint: STORY_OFFER_PRICE_POINTS.MULTIPLE[1],
13
+ title: 'Product 2',
14
+ price: 149.99,
15
+ image: 'https://example.com/product.jpg',
16
+ category: 'Electronics'
17
+ }],
18
+ googleApiKey: 'AIzaSyCtZ0TqBCGRf1OtLwTmJANQ4_sOpTs5x1w',
19
+ onCheckoutInit: (() => {
20
+ console.log('✅ Checkout initialized');
21
+ }) as OnCheckoutInitCallback,
22
+ onPaymentInfoComplete: ((products: CheckoutCartItem[], totalAmount: number) => {
23
+ console.log('✅ Payment info complete');
24
+ console.log('Total amount:', totalAmount / 100);
25
+ products.forEach(product => {
26
+ console.log(\` - \${product.sku}: \${product.priceInCents / 100} \${product.currency.toUpperCase()}\`);
27
+ });
28
+ }) as OnPaymentInfoCompleteCallback,
29
+ onOrderSubmit: ((products: CheckoutCartItem[], totalAmount: number) => {
30
+ console.log('✅ Order submitted');
31
+ console.log('Submitted amount:', totalAmount / 100);
32
+ products.forEach(product => {
33
+ console.log(\` - \${product.sku}: \${product.priceInCents / 100} \${product.currency.toUpperCase()}\`);
34
+ });
35
+ }) as OnOrderSubmitCallback,
36
+ onOrderSuccess: ((orderCode: string, tradeCode?: string) => {
37
+ console.log('✅ Order successful');
38
+ console.log('Order code:', orderCode);
39
+ if (tradeCode) {
40
+ console.log('Trade code:', tradeCode);
41
+ }
42
+ }) as OnOrderSuccessCallback
43
+ }
44
+ }`,...(s=(a=n.parameters)==null?void 0:a.docs)==null?void 0:s.source}}};const d=["Default"],C=Object.freeze(Object.defineProperty({__proto__:null,Default:n,__namedExportsOrder:d,default:m},Symbol.toStringTag,{value:"Module"}));export{C,n as D};
@@ -0,0 +1,44 @@
1
+ import{S as r,c as i,D as l}from"./useCheckoutContext-3YTrU8Qh.js";import{C as u}from"./CheckoutPage-DgZ1RopD.js";i(l);const m={component:u,title:"Components/CheckoutPage",parameters:{docs:{description:{component:"Complete checkout page component including customer information, address information, payment methods, and order submission button."}},controls:{sort:"none",include:["cart","googleApiKey","onCheckoutInit","onPaymentInfoComplete","onOrderSubmit","onOrderSuccess"]}},argTypes:{cart:{description:"Array of cart items. Each item must include `sku` and `offerPricePoint`. Note: even for a single product, pass it as an array with one item.",control:{type:"object"},table:{type:{summary:"CartItem[]"},category:"Product Information"}},onCheckoutInit:{description:"Callback function triggered when checkout initializes, fired immediately after CheckoutPage component mounts.",action:"onCheckoutInit",table:{type:{summary:"() => void"},category:"Event Callbacks"}},onPaymentInfoComplete:{description:"Callback function triggered when payment information is complete, fired when user completes payment form (Stripe payment element validation passes).",action:"onPaymentInfoComplete",table:{type:{summary:"(products: CheckoutCartItem[], totalAmount: number) => void"},category:"Event Callbacks"}},onOrderSubmit:{description:"Callback function triggered when order is submitted, fired after user clicks submit button and before order processing begins.",action:"onOrderSubmit",table:{type:{summary:"(products: CheckoutCartItem[], totalAmount: number) => void"},category:"Event Callbacks"}},onOrderSuccess:{description:"Callback function triggered when order is successfully created.",action:"onOrderSuccess",table:{type:{summary:"(orderCode: string, tradeCode?: string) => void"},category:"Event Callbacks"}},googleApiKey:{description:"Google Places API Key for enabling address autocomplete functionality.",control:{type:"text"},table:{type:{summary:"string"},category:"Configuration"}}}},n={args:{cart:[{sku:"TEST001",offerPricePoint:r.MULTIPLE[0],title:"Product 1",price:99.99,image:"https://example.com/product.jpg",category:"Electronics"},{sku:"TEST002",offerPricePoint:r.MULTIPLE[1],title:"Product 2",price:149.99,image:"https://example.com/product.jpg",category:"Electronics"}],googleApiKey:"AIzaSyCtZ0TqBCGRf1OtLwTmJANQ4_sOpTs5x1w",onCheckoutInit:()=>{console.log("✅ Checkout initialized")},onPaymentInfoComplete:(t,o)=>{console.log("✅ Payment info complete"),console.log("Total amount:",o/100),t.forEach(e=>{console.log(` - ${e.sku}: ${e.priceInCents/100} ${e.currency.toUpperCase()}`)})},onOrderSubmit:(t,o)=>{console.log("✅ Order submitted"),console.log("Submitted amount:",o/100),t.forEach(e=>{console.log(` - ${e.sku}: ${e.priceInCents/100} ${e.currency.toUpperCase()}`)})},onOrderSuccess:(t,o)=>{console.log("✅ Order successful"),console.log("Order code:",t),o&&console.log("Trade code:",o)}}};var c,a,s;n.parameters={...n.parameters,docs:{...(c=n.parameters)==null?void 0:c.docs,source:{originalSource:`{
2
+ args: {
3
+ cart: [{
4
+ sku: 'TEST001',
5
+ offerPricePoint: STORY_OFFER_PRICE_POINTS.MULTIPLE[0],
6
+ title: 'Product 1',
7
+ price: 99.99,
8
+ image: 'https://example.com/product.jpg',
9
+ category: 'Electronics'
10
+ }, {
11
+ sku: 'TEST002',
12
+ offerPricePoint: STORY_OFFER_PRICE_POINTS.MULTIPLE[1],
13
+ title: 'Product 2',
14
+ price: 149.99,
15
+ image: 'https://example.com/product.jpg',
16
+ category: 'Electronics'
17
+ }],
18
+ googleApiKey: 'AIzaSyCtZ0TqBCGRf1OtLwTmJANQ4_sOpTs5x1w',
19
+ onCheckoutInit: (() => {
20
+ console.log('✅ Checkout initialized');
21
+ }) as OnCheckoutInitCallback,
22
+ onPaymentInfoComplete: ((products: CheckoutCartItem[], totalAmount: number) => {
23
+ console.log('✅ Payment info complete');
24
+ console.log('Total amount:', totalAmount / 100);
25
+ products.forEach(product => {
26
+ console.log(\` - \${product.sku}: \${product.priceInCents / 100} \${product.currency.toUpperCase()}\`);
27
+ });
28
+ }) as OnPaymentInfoCompleteCallback,
29
+ onOrderSubmit: ((products: CheckoutCartItem[], totalAmount: number) => {
30
+ console.log('✅ Order submitted');
31
+ console.log('Submitted amount:', totalAmount / 100);
32
+ products.forEach(product => {
33
+ console.log(\` - \${product.sku}: \${product.priceInCents / 100} \${product.currency.toUpperCase()}\`);
34
+ });
35
+ }) as OnOrderSubmitCallback,
36
+ onOrderSuccess: ((orderCode: string, tradeCode?: string) => {
37
+ console.log('✅ Order successful');
38
+ console.log('Order code:', orderCode);
39
+ if (tradeCode) {
40
+ console.log('Trade code:', tradeCode);
41
+ }
42
+ }) as OnOrderSuccessCallback
43
+ }
44
+ }`,...(s=(a=n.parameters)==null?void 0:a.docs)==null?void 0:s.source}}};const d=["Default"],C=Object.freeze(Object.defineProperty({__proto__:null,Default:n,__namedExportsOrder:d,default:m},Symbol.toStringTag,{value:"Module"}));export{C,n as D};
@@ -0,0 +1,44 @@
1
+ import{S as r,c as i,D as l}from"./useCheckoutContext-BW2h13W8.js";import{C as u}from"./CheckoutPage-DSLcTghb.js";i(l);const m={component:u,title:"Components/CheckoutPage",parameters:{docs:{description:{component:"Complete checkout page component including customer information, address information, payment methods, and order submission button."}},controls:{sort:"none",include:["cart","googleApiKey","onCheckoutInit","onPaymentInfoComplete","onOrderSubmit","onOrderSuccess"]}},argTypes:{cart:{description:"Array of cart items. Each item must include `sku` and `offerPricePoint`. Note: even for a single product, pass it as an array with one item.",control:{type:"object"},table:{type:{summary:"CartItem[]"},category:"Product Information"}},onCheckoutInit:{description:"Callback function triggered when checkout initializes, fired immediately after CheckoutPage component mounts.",action:"onCheckoutInit",table:{type:{summary:"() => void"},category:"Event Callbacks"}},onPaymentInfoComplete:{description:"Callback function triggered when payment information is complete, fired when user completes payment form (Stripe payment element validation passes).",action:"onPaymentInfoComplete",table:{type:{summary:"(products: CheckoutCartItem[], totalAmount: number) => void"},category:"Event Callbacks"}},onOrderSubmit:{description:"Callback function triggered when order is submitted, fired after user clicks submit button and before order processing begins.",action:"onOrderSubmit",table:{type:{summary:"(products: CheckoutCartItem[], totalAmount: number) => void"},category:"Event Callbacks"}},onOrderSuccess:{description:"Callback function triggered when order is successfully created.",action:"onOrderSuccess",table:{type:{summary:"(orderCode: string, tradeCode?: string) => void"},category:"Event Callbacks"}},googleApiKey:{description:"Google Places API Key for enabling address autocomplete functionality.",control:{type:"text"},table:{type:{summary:"string"},category:"Configuration"}}}},n={args:{cart:[{sku:"TEST001",offerPricePoint:r.MULTIPLE[0],title:"Product 1",price:99.99,image:"https://example.com/product.jpg",category:"Electronics"},{sku:"TEST002",offerPricePoint:r.MULTIPLE[1],title:"Product 2",price:149.99,image:"https://example.com/product.jpg",category:"Electronics"}],googleApiKey:"AIzaSyCtZ0TqBCGRf1OtLwTmJANQ4_sOpTs5x1w",onCheckoutInit:()=>{console.log("✅ Checkout initialized")},onPaymentInfoComplete:(t,o)=>{console.log("✅ Payment info complete"),console.log("Total amount:",o/100),t.forEach(e=>{console.log(` - ${e.sku}: ${e.priceInCents/100} ${e.currency.toUpperCase()}`)})},onOrderSubmit:(t,o)=>{console.log("✅ Order submitted"),console.log("Submitted amount:",o/100),t.forEach(e=>{console.log(` - ${e.sku}: ${e.priceInCents/100} ${e.currency.toUpperCase()}`)})},onOrderSuccess:(t,o)=>{console.log("✅ Order successful"),console.log("Order code:",t),o&&console.log("Trade code:",o)}}};var c,a,s;n.parameters={...n.parameters,docs:{...(c=n.parameters)==null?void 0:c.docs,source:{originalSource:`{
2
+ args: {
3
+ cart: [{
4
+ sku: 'TEST001',
5
+ offerPricePoint: STORY_OFFER_PRICE_POINTS.MULTIPLE[0],
6
+ title: 'Product 1',
7
+ price: 99.99,
8
+ image: 'https://example.com/product.jpg',
9
+ category: 'Electronics'
10
+ }, {
11
+ sku: 'TEST002',
12
+ offerPricePoint: STORY_OFFER_PRICE_POINTS.MULTIPLE[1],
13
+ title: 'Product 2',
14
+ price: 149.99,
15
+ image: 'https://example.com/product.jpg',
16
+ category: 'Electronics'
17
+ }],
18
+ googleApiKey: 'AIzaSyCtZ0TqBCGRf1OtLwTmJANQ4_sOpTs5x1w',
19
+ onCheckoutInit: (() => {
20
+ console.log('✅ Checkout initialized');
21
+ }) as OnCheckoutInitCallback,
22
+ onPaymentInfoComplete: ((products: CheckoutCartItem[], totalAmount: number) => {
23
+ console.log('✅ Payment info complete');
24
+ console.log('Total amount:', totalAmount / 100);
25
+ products.forEach(product => {
26
+ console.log(\` - \${product.sku}: \${product.priceInCents / 100} \${product.currency.toUpperCase()}\`);
27
+ });
28
+ }) as OnPaymentInfoCompleteCallback,
29
+ onOrderSubmit: ((products: CheckoutCartItem[], totalAmount: number) => {
30
+ console.log('✅ Order submitted');
31
+ console.log('Submitted amount:', totalAmount / 100);
32
+ products.forEach(product => {
33
+ console.log(\` - \${product.sku}: \${product.priceInCents / 100} \${product.currency.toUpperCase()}\`);
34
+ });
35
+ }) as OnOrderSubmitCallback,
36
+ onOrderSuccess: ((orderCode: string, tradeCode?: string) => {
37
+ console.log('✅ Order successful');
38
+ console.log('Order code:', orderCode);
39
+ if (tradeCode) {
40
+ console.log('Trade code:', tradeCode);
41
+ }
42
+ }) as OnOrderSuccessCallback
43
+ }
44
+ }`,...(s=(a=n.parameters)==null?void 0:a.docs)==null?void 0:s.source}}};const d=["Default"],C=Object.freeze(Object.defineProperty({__proto__:null,Default:n,__namedExportsOrder:d,default:m},Symbol.toStringTag,{value:"Module"}));export{C,n as D};
@@ -0,0 +1,44 @@
1
+ import{S as r,c as i,D as l}from"./useCheckoutContext-BXtGY5u3.js";import{C as u}from"./CheckoutPage-d8MZfjpI.js";i(l);const m={component:u,title:"Components/CheckoutPage",parameters:{docs:{description:{component:"Complete checkout page component including customer information, address information, payment methods, and order submission button."}},controls:{sort:"none",include:["cart","googleApiKey","onCheckoutInit","onPaymentInfoComplete","onOrderSubmit","onOrderSuccess"]}},argTypes:{cart:{description:"Array of cart items. Each item must include `sku` and `offerPricePoint`. Note: even for a single product, pass it as an array with one item.",control:{type:"object"},table:{type:{summary:"CartItem[]"},category:"Product Information"}},onCheckoutInit:{description:"Callback function triggered when checkout initializes, fired immediately after CheckoutPage component mounts.",action:"onCheckoutInit",table:{type:{summary:"() => void"},category:"Event Callbacks"}},onPaymentInfoComplete:{description:"Callback function triggered when payment information is complete, fired when user completes payment form (Stripe payment element validation passes).",action:"onPaymentInfoComplete",table:{type:{summary:"(products: CheckoutCartItem[], totalAmount: number) => void"},category:"Event Callbacks"}},onOrderSubmit:{description:"Callback function triggered when order is submitted, fired after user clicks submit button and before order processing begins.",action:"onOrderSubmit",table:{type:{summary:"(products: CheckoutCartItem[], totalAmount: number) => void"},category:"Event Callbacks"}},onOrderSuccess:{description:"Callback function triggered when order is successfully created.",action:"onOrderSuccess",table:{type:{summary:"(orderCode: string, tradeCode?: string) => void"},category:"Event Callbacks"}},googleApiKey:{description:"Google Places API Key for enabling address autocomplete functionality.",control:{type:"text"},table:{type:{summary:"string"},category:"Configuration"}}}},n={args:{cart:[{sku:"TEST001",offerPricePoint:r.MULTIPLE[0],title:"Product 1",price:99.99,image:"https://example.com/product.jpg",category:"Electronics"},{sku:"TEST002",offerPricePoint:r.MULTIPLE[1],title:"Product 2",price:149.99,image:"https://example.com/product.jpg",category:"Electronics"}],googleApiKey:"AIzaSyCtZ0TqBCGRf1OtLwTmJANQ4_sOpTs5x1w",onCheckoutInit:()=>{console.log("✅ Checkout initialized")},onPaymentInfoComplete:(t,o)=>{console.log("✅ Payment info complete"),console.log("Total amount:",o/100),t.forEach(e=>{console.log(` - ${e.sku}: ${e.priceInCents/100} ${e.currency.toUpperCase()}`)})},onOrderSubmit:(t,o)=>{console.log("✅ Order submitted"),console.log("Submitted amount:",o/100),t.forEach(e=>{console.log(` - ${e.sku}: ${e.priceInCents/100} ${e.currency.toUpperCase()}`)})},onOrderSuccess:(t,o)=>{console.log("✅ Order successful"),console.log("Order code:",t),o&&console.log("Trade code:",o)}}};var c,a,s;n.parameters={...n.parameters,docs:{...(c=n.parameters)==null?void 0:c.docs,source:{originalSource:`{
2
+ args: {
3
+ cart: [{
4
+ sku: 'TEST001',
5
+ offerPricePoint: STORY_OFFER_PRICE_POINTS.MULTIPLE[0],
6
+ title: 'Product 1',
7
+ price: 99.99,
8
+ image: 'https://example.com/product.jpg',
9
+ category: 'Electronics'
10
+ }, {
11
+ sku: 'TEST002',
12
+ offerPricePoint: STORY_OFFER_PRICE_POINTS.MULTIPLE[1],
13
+ title: 'Product 2',
14
+ price: 149.99,
15
+ image: 'https://example.com/product.jpg',
16
+ category: 'Electronics'
17
+ }],
18
+ googleApiKey: 'AIzaSyCtZ0TqBCGRf1OtLwTmJANQ4_sOpTs5x1w',
19
+ onCheckoutInit: (() => {
20
+ console.log('✅ Checkout initialized');
21
+ }) as OnCheckoutInitCallback,
22
+ onPaymentInfoComplete: ((products: CheckoutCartItem[], totalAmount: number) => {
23
+ console.log('✅ Payment info complete');
24
+ console.log('Total amount:', totalAmount / 100);
25
+ products.forEach(product => {
26
+ console.log(\` - \${product.sku}: \${product.priceInCents / 100} \${product.currency.toUpperCase()}\`);
27
+ });
28
+ }) as OnPaymentInfoCompleteCallback,
29
+ onOrderSubmit: ((products: CheckoutCartItem[], totalAmount: number) => {
30
+ console.log('✅ Order submitted');
31
+ console.log('Submitted amount:', totalAmount / 100);
32
+ products.forEach(product => {
33
+ console.log(\` - \${product.sku}: \${product.priceInCents / 100} \${product.currency.toUpperCase()}\`);
34
+ });
35
+ }) as OnOrderSubmitCallback,
36
+ onOrderSuccess: ((orderCode: string, tradeCode?: string) => {
37
+ console.log('✅ Order successful');
38
+ console.log('Order code:', orderCode);
39
+ if (tradeCode) {
40
+ console.log('Trade code:', tradeCode);
41
+ }
42
+ }) as OnOrderSuccessCallback
43
+ }
44
+ }`,...(s=(a=n.parameters)==null?void 0:a.docs)==null?void 0:s.source}}};const d=["Default"],C=Object.freeze(Object.defineProperty({__proto__:null,Default:n,__namedExportsOrder:d,default:m},Symbol.toStringTag,{value:"Module"}));export{C,n as D};
@@ -0,0 +1,44 @@
1
+ import{S as r,c as i,D as l}from"./useCheckoutContext-CroxIBFh.js";import{C as u}from"./CheckoutPage-DFb28rrp.js";i(l);const m={component:u,title:"Components/CheckoutPage",parameters:{docs:{description:{component:"Complete checkout page component including customer information, address information, payment methods, and order submission button."}},controls:{sort:"none",include:["cart","googleApiKey","onCheckoutInit","onPaymentInfoComplete","onOrderSubmit","onOrderSuccess"]}},argTypes:{cart:{description:"Array of cart items. Each item must include `sku` and `offerPricePoint`. Note: even for a single product, pass it as an array with one item.",control:{type:"object"},table:{type:{summary:"CartItem[]"},category:"Product Information"}},onCheckoutInit:{description:"Callback function triggered when checkout initializes, fired immediately after CheckoutPage component mounts.",action:"onCheckoutInit",table:{type:{summary:"() => void"},category:"Event Callbacks"}},onPaymentInfoComplete:{description:"Callback function triggered when payment information is complete, fired when user completes payment form (Stripe payment element validation passes).",action:"onPaymentInfoComplete",table:{type:{summary:"(products: CheckoutCartItem[], totalAmount: number) => void"},category:"Event Callbacks"}},onOrderSubmit:{description:"Callback function triggered when order is submitted, fired after user clicks submit button and before order processing begins.",action:"onOrderSubmit",table:{type:{summary:"(products: CheckoutCartItem[], totalAmount: number) => void"},category:"Event Callbacks"}},onOrderSuccess:{description:"Callback function triggered when order is successfully created.",action:"onOrderSuccess",table:{type:{summary:"(orderCode: string, tradeCode?: string) => void"},category:"Event Callbacks"}},googleApiKey:{description:"Google Places API Key for enabling address autocomplete functionality.",control:{type:"text"},table:{type:{summary:"string"},category:"Configuration"}}}},n={args:{cart:[{sku:"TEST001",offerPricePoint:r.MULTIPLE[0],title:"Product 1",price:99.99,image:"https://example.com/product.jpg",category:"Electronics"},{sku:"TEST002",offerPricePoint:r.MULTIPLE[1],title:"Product 2",price:149.99,image:"https://example.com/product.jpg",category:"Electronics"}],googleApiKey:"AIzaSyCtZ0TqBCGRf1OtLwTmJANQ4_sOpTs5x1w",onCheckoutInit:()=>{console.log("✅ Checkout initialized")},onPaymentInfoComplete:(t,o)=>{console.log("✅ Payment info complete"),console.log("Total amount:",o/100),t.forEach(e=>{console.log(` - ${e.sku}: ${e.priceInCents/100} ${e.currency.toUpperCase()}`)})},onOrderSubmit:(t,o)=>{console.log("✅ Order submitted"),console.log("Submitted amount:",o/100),t.forEach(e=>{console.log(` - ${e.sku}: ${e.priceInCents/100} ${e.currency.toUpperCase()}`)})},onOrderSuccess:(t,o)=>{console.log("✅ Order successful"),console.log("Order code:",t),o&&console.log("Trade code:",o)}}};var c,a,s;n.parameters={...n.parameters,docs:{...(c=n.parameters)==null?void 0:c.docs,source:{originalSource:`{
2
+ args: {
3
+ cart: [{
4
+ sku: 'TEST001',
5
+ offerPricePoint: STORY_OFFER_PRICE_POINTS.MULTIPLE[0],
6
+ title: 'Product 1',
7
+ price: 99.99,
8
+ image: 'https://example.com/product.jpg',
9
+ category: 'Electronics'
10
+ }, {
11
+ sku: 'TEST002',
12
+ offerPricePoint: STORY_OFFER_PRICE_POINTS.MULTIPLE[1],
13
+ title: 'Product 2',
14
+ price: 149.99,
15
+ image: 'https://example.com/product.jpg',
16
+ category: 'Electronics'
17
+ }],
18
+ googleApiKey: 'AIzaSyCtZ0TqBCGRf1OtLwTmJANQ4_sOpTs5x1w',
19
+ onCheckoutInit: (() => {
20
+ console.log('✅ Checkout initialized');
21
+ }) as OnCheckoutInitCallback,
22
+ onPaymentInfoComplete: ((products: CheckoutCartItem[], totalAmount: number) => {
23
+ console.log('✅ Payment info complete');
24
+ console.log('Total amount:', totalAmount / 100);
25
+ products.forEach(product => {
26
+ console.log(\` - \${product.sku}: \${product.priceInCents / 100} \${product.currency.toUpperCase()}\`);
27
+ });
28
+ }) as OnPaymentInfoCompleteCallback,
29
+ onOrderSubmit: ((products: CheckoutCartItem[], totalAmount: number) => {
30
+ console.log('✅ Order submitted');
31
+ console.log('Submitted amount:', totalAmount / 100);
32
+ products.forEach(product => {
33
+ console.log(\` - \${product.sku}: \${product.priceInCents / 100} \${product.currency.toUpperCase()}\`);
34
+ });
35
+ }) as OnOrderSubmitCallback,
36
+ onOrderSuccess: ((orderCode: string, tradeCode?: string) => {
37
+ console.log('✅ Order successful');
38
+ console.log('Order code:', orderCode);
39
+ if (tradeCode) {
40
+ console.log('Trade code:', tradeCode);
41
+ }
42
+ }) as OnOrderSuccessCallback
43
+ }
44
+ }`,...(s=(a=n.parameters)==null?void 0:a.docs)==null?void 0:s.source}}};const d=["Default"],C=Object.freeze(Object.defineProperty({__proto__:null,Default:n,__namedExportsOrder:d,default:m},Symbol.toStringTag,{value:"Module"}));export{C,n as D};
@@ -0,0 +1,44 @@
1
+ import{S as r,c as i,D as l}from"./useCheckoutContext-C7KjDyWW.js";import{C as u}from"./CheckoutPage-CDW7SRyI.js";i(l);const m={component:u,title:"Components/CheckoutPage",parameters:{docs:{description:{component:"Complete checkout page component including customer information, address information, payment methods, and order submission button."}},controls:{sort:"none",include:["cart","googleApiKey","onCheckoutInit","onPaymentInfoComplete","onOrderSubmit","onOrderSuccess"]}},argTypes:{cart:{description:"Array of cart items. Each item must include `sku` and `offerPricePoint`. Note: even for a single product, pass it as an array with one item.",control:{type:"object"},table:{type:{summary:"CartItem[]"},category:"Product Information"}},onCheckoutInit:{description:"Callback function triggered when checkout initializes, fired immediately after CheckoutPage component mounts.",action:"onCheckoutInit",table:{type:{summary:"() => void"},category:"Event Callbacks"}},onPaymentInfoComplete:{description:"Callback function triggered when payment information is complete, fired when user completes payment form (Stripe payment element validation passes).",action:"onPaymentInfoComplete",table:{type:{summary:"(products: CheckoutCartItem[], totalAmount: number) => void"},category:"Event Callbacks"}},onOrderSubmit:{description:"Callback function triggered when order is submitted, fired after user clicks submit button and before order processing begins.",action:"onOrderSubmit",table:{type:{summary:"(products: CheckoutCartItem[], totalAmount: number) => void"},category:"Event Callbacks"}},onOrderSuccess:{description:"Callback function triggered when order is successfully created.",action:"onOrderSuccess",table:{type:{summary:"(orderCode: string, tradeCode?: string) => void"},category:"Event Callbacks"}},googleApiKey:{description:"Google Places API Key for enabling address autocomplete functionality.",control:{type:"text"},table:{type:{summary:"string"},category:"Configuration"}}}},n={args:{cart:[{sku:"TEST001",offerPricePoint:r.MULTIPLE[0],title:"Product 1",price:99.99,image:"https://example.com/product.jpg",category:"Electronics"},{sku:"TEST002",offerPricePoint:r.MULTIPLE[1],title:"Product 2",price:149.99,image:"https://example.com/product.jpg",category:"Electronics"}],googleApiKey:"AIzaSyCtZ0TqBCGRf1OtLwTmJANQ4_sOpTs5x1w",onCheckoutInit:()=>{console.log("✅ Checkout initialized")},onPaymentInfoComplete:(t,o)=>{console.log("✅ Payment info complete"),console.log("Total amount:",o/100),t.forEach(e=>{console.log(` - ${e.sku}: ${e.priceInCents/100} ${e.currency.toUpperCase()}`)})},onOrderSubmit:(t,o)=>{console.log("✅ Order submitted"),console.log("Submitted amount:",o/100),t.forEach(e=>{console.log(` - ${e.sku}: ${e.priceInCents/100} ${e.currency.toUpperCase()}`)})},onOrderSuccess:(t,o)=>{console.log("✅ Order successful"),console.log("Order code:",t),o&&console.log("Trade code:",o)}}};var c,a,s;n.parameters={...n.parameters,docs:{...(c=n.parameters)==null?void 0:c.docs,source:{originalSource:`{
2
+ args: {
3
+ cart: [{
4
+ sku: 'TEST001',
5
+ offerPricePoint: STORY_OFFER_PRICE_POINTS.MULTIPLE[0],
6
+ title: 'Product 1',
7
+ price: 99.99,
8
+ image: 'https://example.com/product.jpg',
9
+ category: 'Electronics'
10
+ }, {
11
+ sku: 'TEST002',
12
+ offerPricePoint: STORY_OFFER_PRICE_POINTS.MULTIPLE[1],
13
+ title: 'Product 2',
14
+ price: 149.99,
15
+ image: 'https://example.com/product.jpg',
16
+ category: 'Electronics'
17
+ }],
18
+ googleApiKey: 'AIzaSyCtZ0TqBCGRf1OtLwTmJANQ4_sOpTs5x1w',
19
+ onCheckoutInit: (() => {
20
+ console.log('✅ Checkout initialized');
21
+ }) as OnCheckoutInitCallback,
22
+ onPaymentInfoComplete: ((products: CheckoutCartItem[], totalAmount: number) => {
23
+ console.log('✅ Payment info complete');
24
+ console.log('Total amount:', totalAmount / 100);
25
+ products.forEach(product => {
26
+ console.log(\` - \${product.sku}: \${product.priceInCents / 100} \${product.currency.toUpperCase()}\`);
27
+ });
28
+ }) as OnPaymentInfoCompleteCallback,
29
+ onOrderSubmit: ((products: CheckoutCartItem[], totalAmount: number) => {
30
+ console.log('✅ Order submitted');
31
+ console.log('Submitted amount:', totalAmount / 100);
32
+ products.forEach(product => {
33
+ console.log(\` - \${product.sku}: \${product.priceInCents / 100} \${product.currency.toUpperCase()}\`);
34
+ });
35
+ }) as OnOrderSubmitCallback,
36
+ onOrderSuccess: ((orderCode: string, tradeCode?: string) => {
37
+ console.log('✅ Order successful');
38
+ console.log('Order code:', orderCode);
39
+ if (tradeCode) {
40
+ console.log('Trade code:', tradeCode);
41
+ }
42
+ }) as OnOrderSuccessCallback
43
+ }
44
+ }`,...(s=(a=n.parameters)==null?void 0:a.docs)==null?void 0:s.source}}};const d=["Default"],C=Object.freeze(Object.defineProperty({__proto__:null,Default:n,__namedExportsOrder:d,default:m},Symbol.toStringTag,{value:"Module"}));export{C,n as D};