@alphawebai/medusa-custom-payments-react 0.1.0-rc.40 → 0.1.0-rc.41

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.
@@ -38,7 +38,7 @@ function ClickTimePayPalButton(props) {
38
38
  return { orderId };
39
39
  },
40
40
  savePayment: props.context.savePayment,
41
- commit: true,
41
+ commit: props.context.commit ?? true,
42
42
  presentationMode: "auto",
43
43
  onApprove: async (data) => {
44
44
  if (submittingRef.current) return;
@@ -115,7 +115,13 @@ function PrismClickTimePayPalButton(props) {
115
115
  environment: props.context.environment,
116
116
  components: ["paypal-payments"],
117
117
  pageType: "checkout",
118
- children: /* @__PURE__ */ jsx(ClickTimePayPalButton, { ...props })
118
+ children: /* @__PURE__ */ jsx(
119
+ ClickTimePayPalButton,
120
+ {
121
+ ...props
122
+ },
123
+ `${props.context.commit ?? true}:${props.context.savePayment}`
124
+ )
119
125
  },
120
126
  `${props.context.environment}:${props.context.clientId}`
121
127
  );
@@ -154,7 +160,7 @@ function PayPalButton(props) {
154
160
  disabled: props.disabled || submitting,
155
161
  orderId: props.session.orderId,
156
162
  savePayment: props.session.savePayment,
157
- commit: true,
163
+ commit: props.session.commit ?? true,
158
164
  presentationMode: "auto",
159
165
  onApprove: async (data) => {
160
166
  if (submittingRef.current) return;
@@ -231,7 +237,13 @@ function PrismPayPalPaymentButton(props) {
231
237
  environment: props.session.environment,
232
238
  components: ["paypal-payments"],
233
239
  pageType: "checkout",
234
- children: /* @__PURE__ */ jsx2(PayPalButton, { ...props }, props.session.orderId)
240
+ children: /* @__PURE__ */ jsx2(
241
+ PayPalButton,
242
+ {
243
+ ...props
244
+ },
245
+ `${props.session.orderId}:${props.session.commit ?? true}:${props.session.savePayment}`
246
+ )
235
247
  },
236
248
  `${props.session.environment}:${props.session.clientId}`
237
249
  );
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { P as PrismDeferredPaymentElementProps, a as PrismPaymentElementProps } from './types-DY41P1Ua.mjs';
3
- export { b as PrismCheckoutProviderContext, c as PrismClickTimePayPalButtonProps, d as PrismClickTimePayPalOrder, e as PrismDeferredPaymentSurfaceProps, f as PrismDeferredStripePreparedPayment, g as PrismPayPalApprovalOutcome, h as PrismPayPalCheckoutProviderContext, i as PrismPayPalPaymentButtonClassNames, j as PrismPayPalPaymentButtonProps, k as PrismPaymentBillingDetails, l as PrismPaymentErrorContext, m as PrismPaymentErrorPhase, n as PrismPaymentErrorPresentation, o as PrismPaymentOutcome, p as PrismPaymentSurfaceProps, q as PrismPreparedPayPalPaymentSession, r as PrismPreparedPaymentSession, s as PrismPreparedStripePaymentSession, t as PrismStripeCheckoutProviderContext, u as PrismStripeDisplayPolicy, S as StripeSupportedTermMethod } from './types-DY41P1Ua.mjs';
2
+ import { P as PrismDeferredPaymentElementProps, a as PrismPaymentElementProps } from './types-BNNA0H0d.mjs';
3
+ export { b as PrismCheckoutProviderContext, c as PrismClickTimePayPalButtonProps, d as PrismClickTimePayPalOrder, e as PrismDeferredPaymentSurfaceProps, f as PrismDeferredStripePreparedPayment, g as PrismPayPalApprovalOutcome, h as PrismPayPalCheckoutProviderContext, i as PrismPayPalPaymentButtonClassNames, j as PrismPayPalPaymentButtonProps, k as PrismPaymentBillingDetails, l as PrismPaymentErrorContext, m as PrismPaymentErrorPhase, n as PrismPaymentErrorPresentation, o as PrismPaymentOutcome, p as PrismPaymentSurfaceProps, q as PrismPreparedPayPalPaymentSession, r as PrismPreparedPaymentSession, s as PrismPreparedStripePaymentSession, t as PrismStripeCheckoutProviderContext, u as PrismStripeDisplayPolicy, S as StripeSupportedTermMethod } from './types-BNNA0H0d.mjs';
4
4
  import '@stripe/stripe-js';
5
5
 
6
6
  declare function PrismDeferredPaymentElement(props: PrismDeferredPaymentElementProps): react.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { P as PrismDeferredPaymentElementProps, a as PrismPaymentElementProps } from './types-DY41P1Ua.js';
3
- export { b as PrismCheckoutProviderContext, c as PrismClickTimePayPalButtonProps, d as PrismClickTimePayPalOrder, e as PrismDeferredPaymentSurfaceProps, f as PrismDeferredStripePreparedPayment, g as PrismPayPalApprovalOutcome, h as PrismPayPalCheckoutProviderContext, i as PrismPayPalPaymentButtonClassNames, j as PrismPayPalPaymentButtonProps, k as PrismPaymentBillingDetails, l as PrismPaymentErrorContext, m as PrismPaymentErrorPhase, n as PrismPaymentErrorPresentation, o as PrismPaymentOutcome, p as PrismPaymentSurfaceProps, q as PrismPreparedPayPalPaymentSession, r as PrismPreparedPaymentSession, s as PrismPreparedStripePaymentSession, t as PrismStripeCheckoutProviderContext, u as PrismStripeDisplayPolicy, S as StripeSupportedTermMethod } from './types-DY41P1Ua.js';
2
+ import { P as PrismDeferredPaymentElementProps, a as PrismPaymentElementProps } from './types-BNNA0H0d.js';
3
+ export { b as PrismCheckoutProviderContext, c as PrismClickTimePayPalButtonProps, d as PrismClickTimePayPalOrder, e as PrismDeferredPaymentSurfaceProps, f as PrismDeferredStripePreparedPayment, g as PrismPayPalApprovalOutcome, h as PrismPayPalCheckoutProviderContext, i as PrismPayPalPaymentButtonClassNames, j as PrismPayPalPaymentButtonProps, k as PrismPaymentBillingDetails, l as PrismPaymentErrorContext, m as PrismPaymentErrorPhase, n as PrismPaymentErrorPresentation, o as PrismPaymentOutcome, p as PrismPaymentSurfaceProps, q as PrismPreparedPayPalPaymentSession, r as PrismPreparedPaymentSession, s as PrismPreparedStripePaymentSession, t as PrismStripeCheckoutProviderContext, u as PrismStripeDisplayPolicy, S as StripeSupportedTermMethod } from './types-BNNA0H0d.js';
4
4
  import '@stripe/stripe-js';
5
5
 
6
6
  declare function PrismDeferredPaymentElement(props: PrismDeferredPaymentElementProps): react.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { e as PrismDeferredPaymentSurfaceProps, p as PrismPaymentSurfaceProps } from './types-DY41P1Ua.mjs';
3
- export { b as PrismCheckoutProviderContext, h as PrismPayPalCheckoutProviderContext, l as PrismPaymentErrorContext, m as PrismPaymentErrorPhase, n as PrismPaymentErrorPresentation, r as PrismPreparedPaymentSession, t as PrismStripeCheckoutProviderContext } from './types-DY41P1Ua.mjs';
2
+ import { e as PrismDeferredPaymentSurfaceProps, p as PrismPaymentSurfaceProps } from './types-BNNA0H0d.mjs';
3
+ export { b as PrismCheckoutProviderContext, h as PrismPayPalCheckoutProviderContext, l as PrismPaymentErrorContext, m as PrismPaymentErrorPhase, n as PrismPaymentErrorPresentation, r as PrismPreparedPaymentSession, t as PrismStripeCheckoutProviderContext } from './types-BNNA0H0d.mjs';
4
4
  import '@stripe/stripe-js';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { e as PrismDeferredPaymentSurfaceProps, p as PrismPaymentSurfaceProps } from './types-DY41P1Ua.js';
3
- export { b as PrismCheckoutProviderContext, h as PrismPayPalCheckoutProviderContext, l as PrismPaymentErrorContext, m as PrismPaymentErrorPhase, n as PrismPaymentErrorPresentation, r as PrismPreparedPaymentSession, t as PrismStripeCheckoutProviderContext } from './types-DY41P1Ua.js';
2
+ import { e as PrismDeferredPaymentSurfaceProps, p as PrismPaymentSurfaceProps } from './types-BNNA0H0d.js';
3
+ export { b as PrismCheckoutProviderContext, h as PrismPayPalCheckoutProviderContext, l as PrismPaymentErrorContext, m as PrismPaymentErrorPhase, n as PrismPaymentErrorPresentation, r as PrismPreparedPaymentSession, t as PrismStripeCheckoutProviderContext } from './types-BNNA0H0d.js';
4
4
  import '@stripe/stripe-js';
5
5
 
6
6
  /**
@@ -62,7 +62,7 @@ function ClickTimePayPalButton(props) {
62
62
  return { orderId };
63
63
  },
64
64
  savePayment: props.context.savePayment,
65
- commit: true,
65
+ commit: props.context.commit ?? true,
66
66
  presentationMode: "auto",
67
67
  onApprove: async (data) => {
68
68
  if (submittingRef.current) return;
@@ -139,7 +139,13 @@ function PrismClickTimePayPalButton(props) {
139
139
  environment: props.context.environment,
140
140
  components: ["paypal-payments"],
141
141
  pageType: "checkout",
142
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ClickTimePayPalButton, { ...props })
142
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
143
+ ClickTimePayPalButton,
144
+ {
145
+ ...props
146
+ },
147
+ `${props.context.commit ?? true}:${props.context.savePayment}`
148
+ )
143
149
  },
144
150
  `${props.context.environment}:${props.context.clientId}`
145
151
  );
@@ -471,7 +477,7 @@ function PayPalButton(props) {
471
477
  disabled: props.disabled || submitting,
472
478
  orderId: props.session.orderId,
473
479
  savePayment: props.session.savePayment,
474
- commit: true,
480
+ commit: props.session.commit ?? true,
475
481
  presentationMode: "auto",
476
482
  onApprove: async (data) => {
477
483
  if (submittingRef.current) return;
@@ -548,7 +554,13 @@ function PrismPayPalPaymentButton(props) {
548
554
  environment: props.session.environment,
549
555
  components: ["paypal-payments"],
550
556
  pageType: "checkout",
551
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PayPalButton, { ...props }, props.session.orderId)
557
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
558
+ PayPalButton,
559
+ {
560
+ ...props
561
+ },
562
+ `${props.session.orderId}:${props.session.commit ?? true}:${props.session.savePayment}`
563
+ )
552
564
  },
553
565
  `${props.session.environment}:${props.session.clientId}`
554
566
  );
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  PrismClickTimePayPalButton,
7
7
  PrismPayPalPaymentButton
8
- } from "./chunk-XCUOIQ2U.mjs";
8
+ } from "./chunk-AVZIQKZV.mjs";
9
9
 
10
10
  // src/prism/PrismDeferredPaymentSurface.tsx
11
11
  import { jsx } from "react/jsx-runtime";
package/dist/paypal.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { c as PrismClickTimePayPalButtonProps, j as PrismPayPalPaymentButtonProps } from './types-DY41P1Ua.mjs';
3
- export { d as PrismClickTimePayPalOrder, g as PrismPayPalApprovalOutcome, h as PrismPayPalCheckoutProviderContext, i as PrismPayPalPaymentButtonClassNames, q as PrismPreparedPayPalPaymentSession } from './types-DY41P1Ua.mjs';
2
+ import { c as PrismClickTimePayPalButtonProps, j as PrismPayPalPaymentButtonProps } from './types-BNNA0H0d.mjs';
3
+ export { d as PrismClickTimePayPalOrder, g as PrismPayPalApprovalOutcome, h as PrismPayPalCheckoutProviderContext, i as PrismPayPalPaymentButtonClassNames, q as PrismPreparedPayPalPaymentSession } from './types-BNNA0H0d.mjs';
4
4
  import '@stripe/stripe-js';
5
5
 
6
6
  declare function PrismClickTimePayPalButton(props: PrismClickTimePayPalButtonProps): react.JSX.Element;
package/dist/paypal.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { c as PrismClickTimePayPalButtonProps, j as PrismPayPalPaymentButtonProps } from './types-DY41P1Ua.js';
3
- export { d as PrismClickTimePayPalOrder, g as PrismPayPalApprovalOutcome, h as PrismPayPalCheckoutProviderContext, i as PrismPayPalPaymentButtonClassNames, q as PrismPreparedPayPalPaymentSession } from './types-DY41P1Ua.js';
2
+ import { c as PrismClickTimePayPalButtonProps, j as PrismPayPalPaymentButtonProps } from './types-BNNA0H0d.js';
3
+ export { d as PrismClickTimePayPalOrder, g as PrismPayPalApprovalOutcome, h as PrismPayPalCheckoutProviderContext, i as PrismPayPalPaymentButtonClassNames, q as PrismPreparedPayPalPaymentSession } from './types-BNNA0H0d.js';
4
4
  import '@stripe/stripe-js';
5
5
 
6
6
  declare function PrismClickTimePayPalButton(props: PrismClickTimePayPalButtonProps): react.JSX.Element;
package/dist/paypal.js CHANGED
@@ -62,7 +62,7 @@ function ClickTimePayPalButton(props) {
62
62
  return { orderId };
63
63
  },
64
64
  savePayment: props.context.savePayment,
65
- commit: true,
65
+ commit: props.context.commit ?? true,
66
66
  presentationMode: "auto",
67
67
  onApprove: async (data) => {
68
68
  if (submittingRef.current) return;
@@ -139,7 +139,13 @@ function PrismClickTimePayPalButton(props) {
139
139
  environment: props.context.environment,
140
140
  components: ["paypal-payments"],
141
141
  pageType: "checkout",
142
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ClickTimePayPalButton, { ...props })
142
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
143
+ ClickTimePayPalButton,
144
+ {
145
+ ...props
146
+ },
147
+ `${props.context.commit ?? true}:${props.context.savePayment}`
148
+ )
143
149
  },
144
150
  `${props.context.environment}:${props.context.clientId}`
145
151
  );
@@ -175,7 +181,7 @@ function PayPalButton(props) {
175
181
  disabled: props.disabled || submitting,
176
182
  orderId: props.session.orderId,
177
183
  savePayment: props.session.savePayment,
178
- commit: true,
184
+ commit: props.session.commit ?? true,
179
185
  presentationMode: "auto",
180
186
  onApprove: async (data) => {
181
187
  if (submittingRef.current) return;
@@ -252,7 +258,13 @@ function PrismPayPalPaymentButton(props) {
252
258
  environment: props.session.environment,
253
259
  components: ["paypal-payments"],
254
260
  pageType: "checkout",
255
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PayPalButton, { ...props }, props.session.orderId)
261
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
262
+ PayPalButton,
263
+ {
264
+ ...props
265
+ },
266
+ `${props.session.orderId}:${props.session.commit ?? true}:${props.session.savePayment}`
267
+ )
256
268
  },
257
269
  `${props.session.environment}:${props.session.clientId}`
258
270
  );
package/dist/paypal.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  PrismClickTimePayPalButton,
3
3
  PrismPayPalPaymentButton
4
- } from "./chunk-XCUOIQ2U.mjs";
4
+ } from "./chunk-AVZIQKZV.mjs";
5
5
  export {
6
6
  PrismClickTimePayPalButton,
7
7
  PrismPayPalPaymentButton
@@ -18,6 +18,7 @@ interface PrismPreparedPayPalPaymentSession extends PrismPreparedPaymentSessionB
18
18
  clientId: string;
19
19
  environment: "sandbox" | "production";
20
20
  savePayment: boolean;
21
+ commit?: boolean;
21
22
  }
22
23
  type PrismPreparedPaymentSession = PrismPreparedStripePaymentSession | PrismPreparedPayPalPaymentSession;
23
24
  interface PrismPaymentBillingDetails {
@@ -118,6 +119,7 @@ interface PrismPayPalCheckoutProviderContext {
118
119
  clientId: string;
119
120
  environment: "sandbox" | "production";
120
121
  savePayment: boolean;
122
+ commit?: boolean;
121
123
  }
122
124
  type PrismCheckoutProviderContext = PrismStripeCheckoutProviderContext | PrismPayPalCheckoutProviderContext;
123
125
  interface PrismDeferredStripePreparedPayment {
@@ -18,6 +18,7 @@ interface PrismPreparedPayPalPaymentSession extends PrismPreparedPaymentSessionB
18
18
  clientId: string;
19
19
  environment: "sandbox" | "production";
20
20
  savePayment: boolean;
21
+ commit?: boolean;
21
22
  }
22
23
  type PrismPreparedPaymentSession = PrismPreparedStripePaymentSession | PrismPreparedPayPalPaymentSession;
23
24
  interface PrismPaymentBillingDetails {
@@ -118,6 +119,7 @@ interface PrismPayPalCheckoutProviderContext {
118
119
  clientId: string;
119
120
  environment: "sandbox" | "production";
120
121
  savePayment: boolean;
122
+ commit?: boolean;
121
123
  }
122
124
  type PrismCheckoutProviderContext = PrismStripeCheckoutProviderContext | PrismPayPalCheckoutProviderContext;
123
125
  interface PrismDeferredStripePreparedPayment {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alphawebai/medusa-custom-payments-react",
3
- "version": "0.1.0-rc.40",
3
+ "version": "0.1.0-rc.41",
4
4
  "description": "AlphaWeb-owned Prism Stripe and PayPal checkout surfaces for Medusa storefronts",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",