@nozle-js/react 0.7.0 → 0.7.1

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/index.d.ts CHANGED
@@ -195,6 +195,8 @@ interface CheckoutProps {
195
195
  publishableKey: string;
196
196
  /** Optional Stripe Connect account ID */
197
197
  stripeAccount?: string;
198
+ /** Where Stripe should return the buyer after a redirect-required payment. */
199
+ returnUrl?: string;
198
200
  /** Custom label for the submit button (default: "Pay now") */
199
201
  submitLabel?: string;
200
202
  /** Called with the paymentIntentId when payment succeeds without redirect */
@@ -221,7 +223,7 @@ interface UseCheckoutResult {
221
223
  error: Error | null;
222
224
  }
223
225
  declare function useCheckout(): UseCheckoutResult;
224
- declare function Checkout({ clientSecret, publishableKey, stripeAccount, submitLabel, onSuccess, onComplete, onError, onReady, className, style, children, }: CheckoutProps): React__default.JSX.Element;
226
+ declare function Checkout({ clientSecret, publishableKey, stripeAccount, returnUrl, submitLabel, onSuccess, onComplete, onError, onReady, className, style, children, }: CheckoutProps): React__default.JSX.Element;
225
227
 
226
228
  interface ProrationPreview {
227
229
  credit: number;
package/dist/index.js CHANGED
@@ -873,6 +873,7 @@ function CheckoutInner({
873
873
  onReady,
874
874
  className,
875
875
  style,
876
+ returnUrl,
876
877
  children
877
878
  }) {
878
879
  const stripe = useStripe();
@@ -886,7 +887,7 @@ function CheckoutInner({
886
887
  setError(null);
887
888
  const result = await stripe.confirmPayment({
888
889
  elements,
889
- confirmParams: { return_url: window.location.href },
890
+ confirmParams: { return_url: returnUrl ?? window.location.href },
890
891
  redirect: "if_required"
891
892
  });
892
893
  setIsProcessing(false);
@@ -951,6 +952,7 @@ function Checkout({
951
952
  clientSecret,
952
953
  publishableKey,
953
954
  stripeAccount,
955
+ returnUrl,
954
956
  submitLabel,
955
957
  onSuccess,
956
958
  onComplete,
@@ -982,6 +984,7 @@ function Checkout({
982
984
  onReady,
983
985
  className,
984
986
  style,
987
+ returnUrl,
985
988
  children
986
989
  }
987
990
  ) }, clientSecret);