@juspay-tech/react-native-hyperswitch 1.3.3 → 1.3.4
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/ios/hyperswitchSDK/Core/NativeModule/RNHeadlessManager.swift +13 -7
- package/lib/commonjs/index.bundle.js +2 -2
- package/lib/commonjs/index.bundle.js.map +1 -1
- package/lib/module/index.bundle.js +2 -2
- package/lib/module/index.bundle.js.map +1 -1
- package/lib/typescript/src/views/ApplePayButton.d.ts +3 -1
- package/lib/typescript/src/views/ApplePayButton.d.ts.map +1 -1
- package/lib/typescript/src/views/GooglePayButton.d.ts +3 -1
- package/lib/typescript/src/views/GooglePayButton.d.ts.map +1 -1
- package/lib/typescript/src/views/useWalletReady.d.ts +22 -0
- package/lib/typescript/src/views/useWalletReady.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/views/ApplePayButton.tsx +13 -0
- package/src/views/GooglePayButton.tsx +13 -0
- package/src/views/useWalletReady.ts +109 -0
|
@@ -73,20 +73,26 @@ internal class RNHeadlessManager: RCTDefaultReactNativeFactoryDelegate {
|
|
|
73
73
|
|
|
74
74
|
/// Stops any surface left over from a previous headless flow.
|
|
75
75
|
///
|
|
76
|
-
/// Dropping `rootView` is not enough on the new architecture: the
|
|
77
|
-
/// stays in `Status::Running`, and the next `viewForModule`
|
|
78
|
-
/// live surface, which trips the `SurfaceHandler::setUIManager`
|
|
79
|
-
///
|
|
80
|
-
///
|
|
76
|
+
/// Dropping `rootView` alone is not enough on the new architecture: the
|
|
77
|
+
/// surface stays in `Status::Running`, and the next `viewForModule`
|
|
78
|
+
/// re-points a live surface, which trips the `SurfaceHandler::setUIManager`
|
|
79
|
+
/// assertion. Stopping the surface retires it properly.
|
|
80
|
+
///
|
|
81
|
+
/// The factory is deliberately kept. Releasing it tears down the whole
|
|
82
|
+
/// React instance, and the headless flows share this manager — so a flow
|
|
83
|
+
/// starting up would free the runtime another flow is still executing in,
|
|
84
|
+
/// crashing its JS thread with EXC_BAD_ACCESS.
|
|
81
85
|
internal func teardownRunningSurface() {
|
|
82
|
-
guard rootView != nil
|
|
86
|
+
guard rootView != nil else {
|
|
83
87
|
return
|
|
84
88
|
}
|
|
85
89
|
|
|
86
90
|
let drop = {
|
|
91
|
+
if let hosting = self.rootView as? RCTSurfaceHostingView {
|
|
92
|
+
hosting.surface.stop()
|
|
93
|
+
}
|
|
87
94
|
self.rootView?.removeFromSuperview()
|
|
88
95
|
self.rootView = nil
|
|
89
|
-
self.factory = nil
|
|
90
96
|
}
|
|
91
97
|
|
|
92
98
|
if Thread.isMainThread {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react-native"),t=require("react");const n=e.TurboModuleRegistry.get("NativeHyperswitchModule")??e.NativeModules.NativeHyperswitchModule,r=e.TurboModuleRegistry.get("NativeWidgetHelperModule")??e.NativeModules.NativeWidgetHelperModule;function o(e){switch(e){case"succeeded":case"completed":case"requires_capture":case"success":return"completed";case"cancelled":case"canceled":return"canceled";default:return"failed"}}function a(e){const t=function(e){if("object"==typeof e&&null!==e)return e;try{return JSON.parse(e)}catch{return{status:"failed",message:String(e)}}}(e);return{status:o(t.status),type:t.type??t.code??o(t.status)??"",message:t.message??t.code??""}}const i=new Map;function s(e,t){i.set(e,t)}function l(e){i.delete(e)}function u(e){const t=[...i.values()].map(t=>new Promise(n=>{r.updateIntentCompleteForWidget(t,e,e=>n(a(e)))}));return Promise.all(t)}let c=!1;function y(e){c=e}let p=!1;function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react-native"),t=require("react");const n=e.TurboModuleRegistry.get("NativeHyperswitchModule")??e.NativeModules.NativeHyperswitchModule,r=e.TurboModuleRegistry.get("NativeWidgetHelperModule")??e.NativeModules.NativeWidgetHelperModule;function o(e){switch(e){case"succeeded":case"completed":case"requires_capture":case"success":return"completed";case"cancelled":case"canceled":return"canceled";default:return"failed"}}function a(e){const t=function(e){if("object"==typeof e&&null!==e)return e;try{return JSON.parse(e)}catch{return{status:"failed",message:String(e)}}}(e);return{status:o(t.status),type:t.type??t.code??o(t.status)??"",message:t.message??t.code??""}}const i=new Map;function s(e,t){i.set(e,t)}function l(e){i.delete(e)}function u(e){const t=[...i.values()].map(t=>new Promise(n=>{r.updateIntentCompleteForWidget(t,e,e=>n(a(e)))}));return Promise.all(t)}let c=!1;function y(e){c=e}let p=!1;function f(e){p=e}async function d(e){if(c)return{status:"failed",type:"initialization_in_progress",message:"SDK is reloading. Please wait for initialisation to complete before presenting the payment sheet."};if(p)return{status:"canceled",type:"sheet_already_presented",message:"A payment sheet is already presented."};f(!0);try{return a(await n.presentPaymentSheet({hyperswitchConfig:e.hyperswitchConfig,paymentSessionConfig:e.paymentSessionConfig,configuration:e.configuration}))}finally{f(!1)}}function m(e){if(!e)throw new Error("A widgetId is required to confirm a saved payment method");const t=function(e){return i.get(e)}(e);if(void 0===t)throw new Error(`Widget ${e} not found or not mounted`);return t}function g(e){if(null==e||"string"!=typeof e)return e??null;try{return JSON.parse(e)}catch{return null}}function h(e){try{const t=JSON.parse(e);return{...t,billing:g(t.billing)}}catch{return null}}async function b(e,t,r){const o={hyperswitchConfig:e,paymentSessionConfig:t,configuration:{...r,paymentMethodLayout:{savedMethodCustomization:{hiddenPaymentMethods:r?.hiddenPaymentMethods??[]}}}};return await n.getCustomerSavedPaymentMethods(o),{getCustomerLastUsedPaymentMethodData:async()=>h(await n.getCustomerLastUsedPaymentMethodData()),getCustomerDefaultSavedPaymentMethodData:async()=>h(await n.getCustomerDefaultSavedPaymentMethodData()),getCustomerSavedPaymentMethodData:async()=>h(await n.getCustomerSavedPaymentMethodData()),confirmWithCustomerLastUsedPaymentMethod:async e=>a(await n.confirmWithCustomerLastUsedPaymentMethod(m(e?.id))),confirmWithCustomerDefaultPaymentMethod:async e=>a(await n.confirmWithCustomerDefaultPaymentMethod(m(e?.id)))}}async function v(e,t){const r=await(o=n.getWalletSession({hyperswitchConfig:e,paymentSessionConfig:t}),i="getWalletSession",new Promise((e,t)=>{const n=setTimeout(()=>{t(new Error(`${i} timed out after 15000ms`))},15e3);o.then(t=>{clearTimeout(n),e(t)},e=>{clearTimeout(n),t(e)})}));var o,i;let s,l;try{const e=JSON.parse(r);s=e.status,l=e.message}catch{s=void 0}if("failed"===s)throw new Error(l??"Failed to initialise the wallet session");return{isWalletEligible:e=>n.isWalletEligible(e).catch(()=>!1),isGooglePayEligible:()=>n.isWalletEligible("google_pay").catch(()=>!1),isApplePayEligible:()=>n.isWalletEligible("apple_pay").catch(()=>!1),launchWallet:async e=>a(await n.launchWallet(e)),launchGooglePay:async()=>a(await n.launchWallet("google_pay")),launchApplePay:async()=>a(await n.launchWallet("apple_pay"))}}function S(e){return async function(t){const n=function(e,t,n){const r={...e};return delete r.platformPublishableKey,{hyperswitchConfig:r,paymentSessionConfig:t,configuration:n??{}}}(e.hyperswitchConfig,e.paymentSessionConfig,t);return d(n)}}function w(e){return function(t){return b(e.hyperswitchConfig,e.paymentSessionConfig,t)}}function P(e){return function(){return v(e.hyperswitchConfig,e.paymentSessionConfig)}}async function E(e){let t;try{await function(){const e=[...i.values()].map(e=>new Promise(t=>{r.updateIntentInitForWidget(e,e=>t(a(e)))}));return Promise.all(e)}(),t=await e(),await u(t.sdkAuthorization)}catch{return void await u("")}}function C(e,t){const n={hyperswitchConfig:e,paymentSessionConfig:t};return{presentPaymentSheet:S(n),async confirmPayment(e,t){if("string"==typeof e){return a(await function(e){const t=i.get(e);return void 0===t?Promise.resolve(JSON.stringify({status:"failed",message:`Widget ${e} not found or not mounted`,type:void 0})):new Promise(e=>{r.confirmPayment(t,e)})}(e))}const n=e.current;if(!n)throw new Error("PaymentElement reference is not mounted");return n.confirmPayment(t)},getCustomerSavedPaymentMethods:w(n),getWalletSession:P(n),updateIntent:E}}var _,k={exports:{}},R={};var N,O,A={};
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.development.js
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/function T(){return O||(O=1,"production"!==process.env.NODE_ENV&&function(){function e(t){if(null==t)return null;if("function"==typeof t)return t.$$typeof===_?null:t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case f:return"Fragment";case g:return"Profiler";case m:return"StrictMode";case S:return"Suspense";case w:return"SuspenseList";case C:return"Activity"}if("object"==typeof t)switch("number"==typeof t.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case d:return"Portal";case b:return t.displayName||"Context";case h:return(t._context.displayName||"Context")+".Consumer";case v:var n=t.render;return(t=t.displayName)||(t=""!==(t=n.displayName||n.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case P:return null!==(n=t.displayName||null)?n:e(t.type)||"Memo";case E:n=t._payload,t=t._init;try{return e(t(n))}catch(e){}}return null}function n(e){return""+e}function r(e){try{n(e);var t=!1}catch(e){t=!0}if(t){var r=(t=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),n(e)}}function o(t){if(t===f)return"<>";if("object"==typeof t&&null!==t&&t.$$typeof===E)return"<...>";try{var n=e(t);return n?"<"+n+">":"<...>"}catch(e){return"<...>"}}function a(){return Error("react-stack-top-frame")}function i(){var t=e(this.type);return T[t]||(T[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(t=this.props.ref)?t:null}function s(t,n,o,a,s,u){var y,d=n.children;if(void 0!==d)if(a)if(O(d)){for(a=0;a<d.length;a++)l(d[a]);Object.freeze&&Object.freeze(d)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else l(d);if(N.call(n,"key")){d=e(t);var f=Object.keys(n).filter(function(e){return"key"!==e});a=0<f.length?"{key: someKey, "+f.join(": ..., ")+": ...}":"{key: someKey}",j[d+a]||(f=0<f.length?"{"+f.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',a,d,f,d),j[d+a]=!0)}if(d=null,void 0!==o&&(r(o),d=""+o),function(e){if(N.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(n)&&(r(n.key),d=""+n.key),"key"in n)for(var m in o={},n)"key"!==m&&(o[m]=n[m]);else o=n;return d&&function(e,t){function n(){c||(c=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(o,"function"==typeof t?t.displayName||t.name||"Unknown":t),function(e,t,n,r,o,a){var s=n.ref;return e={$$typeof:p,type:e,key:t,props:n,_owner:r},null!==(void 0!==s?s:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:i}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:o}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(t,d,o,null===(y=k.A)?null:y.getOwner(),s,u)}function l(e){u(e)?e._store&&(e._store.validated=1):"object"==typeof e&&null!==e&&e.$$typeof===E&&("fulfilled"===e._payload.status?u(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function u(e){return"object"==typeof e&&null!==e&&e.$$typeof===p}var c,y=t,p=Symbol.for("react.transitional.element"),d=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),b=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),_=Symbol.for("react.client.reference"),k=y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,O=Array.isArray,R=console.createTask?console.createTask:function(){return null},T={},x=(y={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(y,a)(),M=R(o(a)),j={};A.Fragment=f,A.jsx=function(e,t,n){var r=1e4>k.recentlyCreatedOwnerStacks++;return s(e,t,n,!1,r?Error("react-stack-top-frame"):x,r?R(o(e)):M)},A.jsxs=function(e,t,n){var r=1e4>k.recentlyCreatedOwnerStacks++;return s(e,t,n,!0,r?Error("react-stack-top-frame"):x,r?R(o(e)):M)}}()),A}var x=(R||(R=1,"production"===process.env.NODE_ENV?k.exports=function(){if(_)return N;_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(t,n,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==n.key&&(o=""+n.key),"key"in n)for(var a in r={},n)"key"!==a&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:e,type:t,key:o,ref:void 0!==n?n:null,props:r}}return N.Fragment=t,N.jsx=n,N.jsxs=n,N}():k.exports=T()),k.exports);const M=t.createContext(void 0);function j(){const e=t.useContext(M);if(void 0===e)throw new Error("useHyperElementsContext must be used inside <HyperElements>");return e}function W(){return j().elements}M.displayName="HyperElementsContext";const D=null!=global.nativeFabricUIManager?require("../codegen/components/PaymentWidgetNativeComponent").default:e.requireNativeComponent("RCTNativePaymentWidget");function I(n,r){const[o,a]=t.useState(void 0);return t.useEffect(()=>{if(void 0!==o)return;let t,i=!0;const s=o=>{if(!i)return;if(null==n.current)return void(o<20&&(t=setTimeout(()=>s(o+1),100)));const l=e.findNodeHandle(n.current)??-1;-1!==l?(r?.(),a(l)):o<20&&(t=setTimeout(()=>s(o+1),100))};return s(0),()=>{i=!1,void 0!==t&&clearTimeout(t)}},[o]),o}const H=t.forwardRef((e,n)=>{const{id:r,options:o,onChange:a,onFocus:i,onBlur:u,onPaymentResult:c,style:y,onReady:p}=e,{paymentSessionConfig:d,hyperswitchConfig:f}=j(),m=t.useRef(null),g=I(m,p),h=void 0!==r&&void 0!==g;t.useEffect(()=>{if(!h)return;const e=r;return s(e,g),()=>l(e)},[h]);const b=t.useMemo(()=>{const e=o,t=e?.paymentMethodLayout;return{...e,paymentMethodLayout:{...t,savedMethodCustomization:{...t?.savedMethodCustomization,cvcIcon:e?.cvcIcon??"shown"}}}},[o]);return x.jsx(D,{ref:m,widgetType:"cvcWidget",sdkAuthorization:d?.sdkAuthorization??"",onPaymentEvent:e=>{if(a?.(e.nativeEvent),"CVC_STATUS"===e.nativeEvent.eventName)try{const t=e.nativeEvent.payload,n="string"==typeof t?JSON.parse(t):t;if(!n)return;const r=n.cvcStatus;if(!r)return;const o=Boolean(r.isCvcFocused),a=Boolean(r.isCvcBlur);o&&i?.(),a&&u?.()}catch{}},onPaymentResult:e=>{var t;c?.((t=e.nativeEvent.result??"",JSON.parse(t)))},options:{hyperswitchConfig:f||void 0,paymentSessionConfig:d||void 0,configuration:b},style:y})}),U=["PAYMENT_METHOD_INFO_CARD","PAYMENT_METHOD_STATUS","FORM_STATUS","PAYMENT_METHOD_INFO_ADDRESS","PAYMENT_METHOD_INFO_BILLING_ADDRESS","CVC_STATUS"];function $(e){return{message:`Unknown event(s) subscribed: [${e.join(", ")}]. Valid events are: ${U.join(", ")}`,invalidEvents:e,validEvents:U}}const z=t.forwardRef((n,o)=>{const{widgetId:i,options:u,onPaymentResult:c,onChange:y,onReady:p,style:d}=n,{paymentSessionConfig:f,hyperswitchConfig:m}=j(),g=t.useRef(null),h=I(g,p);t.useEffect(()=>{if(void 0!==h)return s(i,h),()=>l(i)},[h,i]),t.useEffect(()=>{void 0!==h&&e.UIManager.dispatchViewManagerCommand(h,1,[])},[h]),t.useImperativeHandle(o,()=>({confirmPayment:t=>{if(null==g.current)return Promise.resolve({status:"failed",type:"widget_not_ready",message:"Widget not ready"});const n=e.findNodeHandle(g.current)??-1;return-1===n?Promise.resolve({status:"failed",type:"widget_not_ready",message:"Unable to find native view handle"}):new Promise(e=>{r.confirmPayment(n,t=>{e(a(t))})})}}),[h]);const b=t.useRef(!1);t.useEffect(()=>{if(!u||!y||b.current)return;const e=function(e){return e?e.filter(e=>!U.includes(e)):[]}(u.subscribedEvents);if(e.length>0){b.current=!0;const t=$(e);y({eventName:"UNKNOWN_EVENT_SUBSCRIBED",payload:JSON.stringify({message:t.message,invalidEvents:t.invalidEvents,validEvents:t.validEvents})})}},[u,y]);return x.jsx(D,{ref:g,sdkAuthorization:f?.sdkAuthorization??"",widgetType:"widgetPaymentSheet",onPaymentEvent:e=>{y?.(e.nativeEvent)},onPaymentResult:t=>{c(a("ios"===e.Platform.OS?t.nativeEvent.result??"":t.nativeEvent.payload??""))},options:{hyperswitchConfig:m||void 0,paymentSessionConfig:f||void 0,configuration:u},style:{...d,flex:1}})});function B(){return n.isGooglePaySupported().catch(()=>!1)}function F(){return n.isApplePaySupported().catch(()=>!1)}function L({wallet:e,label:n,session:r,onPaymentResult:o}){const a=function(){const e=t.useContext(M);return e?.paymentSession??null}(),{walletSession:i,load:s}=function(){const e=t.useContext(M);return{walletSession:e?.walletSession??null,isGooglePayEligible:e?.walletEligibility.googlePay??!1,isApplePayEligible:e?.walletEligibility.applePay??!1,loading:e?.walletLoading??!1,load:e?.loadWalletSession??(async()=>null)}}(),l=t.useRef(!1);return async()=>{const t=r??a;if(!t&&!i){const e=new Error(`${n} was pressed without a payment session. Pass a "session" prop or render it inside <HyperElements>.`);if(!o)throw e;return void o({status:"failed",type:"no_session",message:e.message})}if(l.current){const e=new Error(`${n} is already processing a payment. Ignoring this press.`);if(!o)throw e;return void o({status:"failed",type:"already_in_progress",message:e.message})}l.current=!0;try{const r=i??await s()??await t.getWalletSession();if(!await r.isWalletEligible(e)){const e=new Error(`${n} is not eligible for this payment.`);if(!o)throw e;return void o({status:"failed",type:"not_eligible",message:e.message})}const a=await r.launchWallet(e);o?.(a)}catch(e){const t=e instanceof Error?e.message:String(e);if(!o)throw e;o({status:"failed",type:"launch_failed",message:t})}finally{l.current=!1}}}const K={BUY:1,BOOK:6,CHECKOUT:5,DONATE:4,ORDER:11,PAY:1e3,SUBSCRIBE:7,PLAIN:1001},G={light:1,dark:2},J={plain:0,buy:1,setUp:2,inStore:3,donate:4,checkout:5,book:6,subscribe:7},q={white:0,whiteOutline:1,black:2};function V(e){return"hidden"===e?.visibility}function Y(e){return e?.appearance?.primaryButton?.shapes?.borderRadius??e?.appearance?.shapes?.borderRadius??4}function X(e,t){const n=e?.appearance?.theme;return"Dark"===n||"Light"!==n&&"dark"===t}const Q=function(){if("android"!==e.Platform.OS)return null;try{return null!=globalThis.nativeFabricUIManager?require("../codegen/components/HyperGooglePayNativeComponent").default:e.requireNativeComponent("HyperGooglePayButton")}catch{return null}}();const Z=function(){if("ios"!==e.Platform.OS)return null;try{return null!=globalThis.nativeFabricUIManager?require("../codegen/components/HyperApplePayNativeComponent").default:e.requireNativeComponent("HyperApplePayButton")}catch{return null}}();function ee(e){return y(!0),n.initialise(e.publishableKey,e.platformPublishableKey??"",e.profileId??"",e.environment??"PROD",e.customEndpoints??{}).then(()=>(y(!1),{publishableKey:e.publishableKey,initPaymentSession:async t=>function(e,t){const n={hyperswitchConfig:e,paymentSessionConfig:t};return{presentPaymentSheet:S(n),getCustomerSavedPaymentMethods:w(n),getWalletSession:P(n),updateIntent:E}}(e,t),async elements(t){return{hyperswitchConfig:n=e,...C(n,t)};var n}})).catch(e=>{throw y(!1),console.error("Error initializing Hyperswitch SDK:",e),e})}const te={init:ee};exports.ApplePayButton=function({options:t,session:n,onPaymentResult:r,disabled:o=!1,style:a}){const i=e.useColorScheme(),s=L({wallet:"apple_pay",label:"Apple Pay",session:n,onPaymentResult:r}),{hidden:l,type:u,buttonStyle:c,borderRadius:y}=function(e,t){const n=e?.walletButtonsConfiguration?.applePay,r=X(e,t),o=r?n?.buttonStyle?.dark:n?.buttonStyle?.light;return{hidden:V(n),type:J[n?.buttonType??"plain"],buttonStyle:q[o??(r?"white":"black")],borderRadius:Y(e)}}(t,"dark"===i?"dark":"light");return l||null==Z?null:x.jsx(e.Pressable,{focusable:!0,accessible:!0,accessibilityRole:"button",accessibilityLabel:"Apple Pay",onPress:s,disabled:o,style:a,children:x.jsx(Z,{type:u,buttonStyle:c,buttonBorderRadius:y,disabled:o,style:e.StyleSheet.absoluteFill})})},exports.CardCVCElement=H,exports.GooglePayButton=function({options:t,session:n,onPaymentResult:r,style:o}){const a=e.useColorScheme(),i=L({wallet:"google_pay",label:"Google Pay",session:n,onPaymentResult:r}),{hidden:s,type:l,appearance:u,borderRadius:c}=function(e,t){const n=e?.walletButtonsConfiguration?.googlePay,r=X(e,t),o=r?n?.buttonStyle?.dark:n?.buttonStyle?.light;return{hidden:V(n),type:K[n?.buttonType??"PLAIN"],appearance:G[o??(r?"dark":"light")],borderRadius:Y(e)}}(t,"dark"===a?"dark":"light");return s||null==Q?null:x.jsx(e.Pressable,{focusable:!0,accessible:!0,accessibilityRole:"button",accessibilityLabel:"Google Pay",onPress:i,style:o,children:x.jsx(Q,{type:l,appearance:u,borderRadius:c,style:e.StyleSheet.absoluteFill})})},exports.HyperElements=function({hyper:e,options:n,children:r}){const[o,a]=t.useState(null),[i,s]=t.useState(null),[l,u]=t.useState(null),[c,y]=t.useState(null),[p,d]=t.useState(null),[f,m]=t.useState(null),[g,h]=t.useState(!0),[b,v]=t.useState(null),[S,w]=t.useState(null),[P,E]=t.useState({googlePay:!1,applePay:!1}),[C,_]=t.useState(!1),k=t.useCallback(async()=>{if(!o)return null;_(!0);try{const e=await o.getWalletSession(),[t,n]=await Promise.all([e.isGooglePayEligible(),e.isApplePayEligible()]);return w(e),E({googlePay:t,applePay:n}),e}catch{return w(null),E({googlePay:!1,applePay:!1}),null}finally{_(!1)}},[o]);return t.useEffect(()=>{w(null),E({googlePay:!1,applePay:!1})},[o]),t.useEffect(()=>{if(!e)return;let t=!1;return(async()=>{try{const r=await Promise.resolve(e),o={sdkAuthorization:n.sdkAuthorization},i=await r.elements(o);t||(a({...i}),u(i.hyperswitchConfig),y(o),s(i),d(r.publishableKey??null),m(n.sdkAuthorization??null),h(!1))}catch(e){t||(v(e instanceof Error?e:new Error(String(e))),h(!1))}})(),()=>{t=!0}},[e,n.sdkAuthorization]),x.jsx(M.Provider,{value:{paymentSession:o,walletSession:S,walletEligibility:P,walletLoading:C,loadWalletSession:k,elements:i,publishableKey:p,sdkAuthorization:f,loading:g,error:b,paymentSessionConfig:c,hyperswitchConfig:l},children:r})},exports.Hyperswitch=te,exports.PaymentElement=z,exports.default=te,exports.isApplePaySupported=F,exports.isGooglePaySupported=B,exports.isPlatformPaySupported=function(){return"ios"===e.Platform.OS?F():"android"===e.Platform.OS?B():Promise.resolve(!1)},exports.isWalletSupported=function(e){return"google_pay"===e?B():F()},exports.loadHyper=ee,exports.useElements=W,exports.usePaymentSession=function(){return j().paymentSession},exports.useWalletSession=function(){const e=j();return{walletSession:e.walletSession,isGooglePayEligible:e.walletEligibility.googlePay,isApplePayEligible:e.walletEligibility.applePay,loading:e.walletLoading,load:e.loadWalletSession}},exports.useWidgets=W;
|
|
10
|
+
*/function T(){return N||(N=1,"production"!==process.env.NODE_ENV&&function(){function e(t){if(null==t)return null;if("function"==typeof t)return t.$$typeof===_?null:t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case d:return"Fragment";case g:return"Profiler";case m:return"StrictMode";case S:return"Suspense";case w:return"SuspenseList";case C:return"Activity"}if("object"==typeof t)switch("number"==typeof t.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case f:return"Portal";case b:return t.displayName||"Context";case h:return(t._context.displayName||"Context")+".Consumer";case v:var n=t.render;return(t=t.displayName)||(t=""!==(t=n.displayName||n.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case P:return null!==(n=t.displayName||null)?n:e(t.type)||"Memo";case E:n=t._payload,t=t._init;try{return e(t(n))}catch(e){}}return null}function n(e){return""+e}function r(e){try{n(e);var t=!1}catch(e){t=!0}if(t){var r=(t=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),n(e)}}function o(t){if(t===d)return"<>";if("object"==typeof t&&null!==t&&t.$$typeof===E)return"<...>";try{var n=e(t);return n?"<"+n+">":"<...>"}catch(e){return"<...>"}}function a(){return Error("react-stack-top-frame")}function i(){var t=e(this.type);return T[t]||(T[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(t=this.props.ref)?t:null}function s(t,n,o,a,s,u){var y,f=n.children;if(void 0!==f)if(a)if(N(f)){for(a=0;a<f.length;a++)l(f[a]);Object.freeze&&Object.freeze(f)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else l(f);if(R.call(n,"key")){f=e(t);var d=Object.keys(n).filter(function(e){return"key"!==e});a=0<d.length?"{key: someKey, "+d.join(": ..., ")+": ...}":"{key: someKey}",j[f+a]||(d=0<d.length?"{"+d.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',a,f,d,f),j[f+a]=!0)}if(f=null,void 0!==o&&(r(o),f=""+o),function(e){if(R.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(n)&&(r(n.key),f=""+n.key),"key"in n)for(var m in o={},n)"key"!==m&&(o[m]=n[m]);else o=n;return f&&function(e,t){function n(){c||(c=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(o,"function"==typeof t?t.displayName||t.name||"Unknown":t),function(e,t,n,r,o,a){var s=n.ref;return e={$$typeof:p,type:e,key:t,props:n,_owner:r},null!==(void 0!==s?s:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:i}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:o}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(t,f,o,null===(y=k.A)?null:y.getOwner(),s,u)}function l(e){u(e)?e._store&&(e._store.validated=1):"object"==typeof e&&null!==e&&e.$$typeof===E&&("fulfilled"===e._payload.status?u(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function u(e){return"object"==typeof e&&null!==e&&e.$$typeof===p}var c,y=t,p=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),b=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),_=Symbol.for("react.client.reference"),k=y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=Object.prototype.hasOwnProperty,N=Array.isArray,O=console.createTask?console.createTask:function(){return null},T={},x=(y={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(y,a)(),M=O(o(a)),j={};A.Fragment=d,A.jsx=function(e,t,n){var r=1e4>k.recentlyCreatedOwnerStacks++;return s(e,t,n,!1,r?Error("react-stack-top-frame"):x,r?O(o(e)):M)},A.jsxs=function(e,t,n){var r=1e4>k.recentlyCreatedOwnerStacks++;return s(e,t,n,!0,r?Error("react-stack-top-frame"):x,r?O(o(e)):M)}}()),A}var x=(O||(O=1,"production"===process.env.NODE_ENV?k.exports=function(){if(_)return R;_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(t,n,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==n.key&&(o=""+n.key),"key"in n)for(var a in r={},n)"key"!==a&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:e,type:t,key:o,ref:void 0!==n?n:null,props:r}}return R.Fragment=t,R.jsx=n,R.jsxs=n,R}():k.exports=T()),k.exports);const M=t.createContext(void 0);function j(){const e=t.useContext(M);if(void 0===e)throw new Error("useHyperElementsContext must be used inside <HyperElements>");return e}function W(){const e=t.useContext(M);return{walletSession:e?.walletSession??null,isGooglePayEligible:e?.walletEligibility.googlePay??!1,isApplePayEligible:e?.walletEligibility.applePay??!1,loading:e?.walletLoading??!1,load:e?.loadWalletSession??(async()=>null)}}function D(){const e=t.useContext(M);return e?.paymentSession??null}function I(){return j().elements}M.displayName="HyperElementsContext";const H=null!=global.nativeFabricUIManager?require("../codegen/components/PaymentWidgetNativeComponent").default:e.requireNativeComponent("RCTNativePaymentWidget");function L(n,r){const[o,a]=t.useState(void 0);return t.useEffect(()=>{if(void 0!==o)return;let t,i=!0;const s=o=>{if(!i)return;if(null==n.current)return void(o<20&&(t=setTimeout(()=>s(o+1),100)));const l=e.findNodeHandle(n.current)??-1;-1!==l?(r?.(),a(l)):o<20&&(t=setTimeout(()=>s(o+1),100))};return s(0),()=>{i=!1,void 0!==t&&clearTimeout(t)}},[o]),o}const U=t.forwardRef((e,n)=>{const{id:r,options:o,onChange:a,onFocus:i,onBlur:u,onPaymentResult:c,style:y,onReady:p}=e,{paymentSessionConfig:f,hyperswitchConfig:d}=j(),m=t.useRef(null),g=L(m,p),h=void 0!==r&&void 0!==g;t.useEffect(()=>{if(!h)return;const e=r;return s(e,g),()=>l(e)},[h]);const b=t.useMemo(()=>{const e=o,t=e?.paymentMethodLayout;return{...e,paymentMethodLayout:{...t,savedMethodCustomization:{...t?.savedMethodCustomization,cvcIcon:e?.cvcIcon??"shown"}}}},[o]);return x.jsx(H,{ref:m,widgetType:"cvcWidget",sdkAuthorization:f?.sdkAuthorization??"",onPaymentEvent:e=>{if(a?.(e.nativeEvent),"CVC_STATUS"===e.nativeEvent.eventName)try{const t=e.nativeEvent.payload,n="string"==typeof t?JSON.parse(t):t;if(!n)return;const r=n.cvcStatus;if(!r)return;const o=Boolean(r.isCvcFocused),a=Boolean(r.isCvcBlur);o&&i?.(),a&&u?.()}catch{}},onPaymentResult:e=>{var t;c?.((t=e.nativeEvent.result??"",JSON.parse(t)))},options:{hyperswitchConfig:d||void 0,paymentSessionConfig:f||void 0,configuration:b},style:y})}),$=["PAYMENT_METHOD_INFO_CARD","PAYMENT_METHOD_STATUS","FORM_STATUS","PAYMENT_METHOD_INFO_ADDRESS","PAYMENT_METHOD_INFO_BILLING_ADDRESS","CVC_STATUS"];function z(e){return{message:`Unknown event(s) subscribed: [${e.join(", ")}]. Valid events are: ${$.join(", ")}`,invalidEvents:e,validEvents:$}}const B=t.forwardRef((n,o)=>{const{widgetId:i,options:u,onPaymentResult:c,onChange:y,onReady:p,style:f}=n,{paymentSessionConfig:d,hyperswitchConfig:m}=j(),g=t.useRef(null),h=L(g,p);t.useEffect(()=>{if(void 0!==h)return s(i,h),()=>l(i)},[h,i]),t.useEffect(()=>{void 0!==h&&e.UIManager.dispatchViewManagerCommand(h,1,[])},[h]),t.useImperativeHandle(o,()=>({confirmPayment:t=>{if(null==g.current)return Promise.resolve({status:"failed",type:"widget_not_ready",message:"Widget not ready"});const n=e.findNodeHandle(g.current)??-1;return-1===n?Promise.resolve({status:"failed",type:"widget_not_ready",message:"Unable to find native view handle"}):new Promise(e=>{r.confirmPayment(n,t=>{e(a(t))})})}}),[h]);const b=t.useRef(!1);t.useEffect(()=>{if(!u||!y||b.current)return;const e=function(e){return e?e.filter(e=>!$.includes(e)):[]}(u.subscribedEvents);if(e.length>0){b.current=!0;const t=z(e);y({eventName:"UNKNOWN_EVENT_SUBSCRIBED",payload:JSON.stringify({message:t.message,invalidEvents:t.invalidEvents,validEvents:t.validEvents})})}},[u,y]);return x.jsx(H,{ref:g,sdkAuthorization:d?.sdkAuthorization??"",widgetType:"widgetPaymentSheet",onPaymentEvent:e=>{y?.(e.nativeEvent)},onPaymentResult:t=>{c(a("ios"===e.Platform.OS?t.nativeEvent.result??"":t.nativeEvent.payload??""))},options:{hyperswitchConfig:m||void 0,paymentSessionConfig:d||void 0,configuration:u},style:{...f,flex:1}})});function F(){return n.isGooglePaySupported().catch(()=>!1)}function G(){return n.isApplePaySupported().catch(()=>!1)}function K({wallet:e,label:n,session:r,onPaymentResult:o}){const a=D(),{walletSession:i,load:s}=W(),l=t.useRef(!1);return async()=>{const t=r??a;if(!t&&!i){const e=new Error(`${n} was pressed without a payment session. Pass a "session" prop or render it inside <HyperElements>.`);if(!o)throw e;return void o({status:"failed",type:"no_session",message:e.message})}if(l.current){const e=new Error(`${n} is already processing a payment. Ignoring this press.`);if(!o)throw e;return void o({status:"failed",type:"already_in_progress",message:e.message})}l.current=!0;try{const r=i??await s()??await t.getWalletSession();if(!await r.isWalletEligible(e)){const e=new Error(`${n} is not eligible for this payment.`);if(!o)throw e;return void o({status:"failed",type:"not_eligible",message:e.message})}const a=await r.launchWallet(e);o?.(a)}catch(e){const t=e instanceof Error?e.message:String(e);if(!o)throw e;o({status:"failed",type:"launch_failed",message:t})}finally{l.current=!1}}}function J({wallet:e,label:n,session:r,onReady:o,onLoadError:a}){const i=D(),{walletSession:s,load:l}=W(),u=t.useRef(o),c=t.useRef(a),y=t.useRef(s),p=t.useRef(l);t.useEffect(()=>{u.current=o,c.current=a,y.current=s,p.current=l},[o,a,s,l]),t.useEffect(()=>{let t=!1;const o=(e,t)=>{c.current?.({status:"failed",type:e,message:t})};return(async()=>{try{const a=await(async()=>r?r.getWalletSession():y.current?y.current:i?p.current():null)();if(t)return;if(!a)return void o("no_session",`${n} has no payment session. Pass a "session" prop or render it inside <HyperElements>.`);const s=await a.isWalletEligible(e);if(t)return;s?u.current?.():o("not_eligible",`${n} is not eligible for this payment.`)}catch(e){if(t)return;o("launch_failed",e instanceof Error?e.message:String(e))}})(),()=>{t=!0}},[r,i,e,n])}const q={BUY:1,BOOK:6,CHECKOUT:5,DONATE:4,ORDER:11,PAY:1e3,SUBSCRIBE:7,PLAIN:1001},V={light:1,dark:2},Y={plain:0,buy:1,setUp:2,inStore:3,donate:4,checkout:5,book:6,subscribe:7},X={white:0,whiteOutline:1,black:2};function Q(e){return"hidden"===e?.visibility}function Z(e){return e?.appearance?.primaryButton?.shapes?.borderRadius??e?.appearance?.shapes?.borderRadius??4}function ee(e,t){const n=e?.appearance?.theme;return"Dark"===n||"Light"!==n&&"dark"===t}const te=function(){if("android"!==e.Platform.OS)return null;try{return null!=globalThis.nativeFabricUIManager?require("../codegen/components/HyperGooglePayNativeComponent").default:e.requireNativeComponent("HyperGooglePayButton")}catch{return null}}();const ne=function(){if("ios"!==e.Platform.OS)return null;try{return null!=globalThis.nativeFabricUIManager?require("../codegen/components/HyperApplePayNativeComponent").default:e.requireNativeComponent("HyperApplePayButton")}catch{return null}}();function re(e){return y(!0),n.initialise(e.publishableKey,e.platformPublishableKey??"",e.profileId??"",e.environment??"PROD",e.customEndpoints??{}).then(()=>(y(!1),{publishableKey:e.publishableKey,initPaymentSession:async t=>function(e,t){const n={hyperswitchConfig:e,paymentSessionConfig:t};return{presentPaymentSheet:S(n),getCustomerSavedPaymentMethods:w(n),getWalletSession:P(n),updateIntent:E}}(e,t),async elements(t){return{hyperswitchConfig:n=e,...C(n,t)};var n}})).catch(e=>{throw y(!1),console.error("Error initializing Hyperswitch SDK:",e),e})}const oe={init:re};exports.ApplePayButton=function({options:t,session:n,onPaymentResult:r,onReady:o,onLoadError:a,disabled:i=!1,style:s}){const l=e.useColorScheme(),u=K({wallet:"apple_pay",label:"Apple Pay",session:n,onPaymentResult:r});J({wallet:"apple_pay",label:"Apple Pay",session:n,onReady:o,onLoadError:a});const{hidden:c,type:y,buttonStyle:p,borderRadius:f}=function(e,t){const n=e?.walletButtonsConfiguration?.applePay,r=ee(e,t),o=r?n?.buttonStyle?.dark:n?.buttonStyle?.light;return{hidden:Q(n),type:Y[n?.buttonType??"plain"],buttonStyle:X[o??(r?"white":"black")],borderRadius:Z(e)}}(t,"dark"===l?"dark":"light");return c||null==ne?null:x.jsx(e.Pressable,{focusable:!0,accessible:!0,accessibilityRole:"button",accessibilityLabel:"Apple Pay",onPress:u,disabled:i,style:s,children:x.jsx(ne,{type:y,buttonStyle:p,buttonBorderRadius:f,disabled:i,style:e.StyleSheet.absoluteFill})})},exports.CardCVCElement=U,exports.GooglePayButton=function({options:t,session:n,onPaymentResult:r,onReady:o,onLoadError:a,style:i}){const s=e.useColorScheme(),l=K({wallet:"google_pay",label:"Google Pay",session:n,onPaymentResult:r});J({wallet:"google_pay",label:"Google Pay",session:n,onReady:o,onLoadError:a});const{hidden:u,type:c,appearance:y,borderRadius:p}=function(e,t){const n=e?.walletButtonsConfiguration?.googlePay,r=ee(e,t),o=r?n?.buttonStyle?.dark:n?.buttonStyle?.light;return{hidden:Q(n),type:q[n?.buttonType??"PLAIN"],appearance:V[o??(r?"dark":"light")],borderRadius:Z(e)}}(t,"dark"===s?"dark":"light");return u||null==te?null:x.jsx(e.Pressable,{focusable:!0,accessible:!0,accessibilityRole:"button",accessibilityLabel:"Google Pay",onPress:l,style:i,children:x.jsx(te,{type:c,appearance:y,borderRadius:p,style:e.StyleSheet.absoluteFill})})},exports.HyperElements=function({hyper:e,options:n,children:r}){const[o,a]=t.useState(null),[i,s]=t.useState(null),[l,u]=t.useState(null),[c,y]=t.useState(null),[p,f]=t.useState(null),[d,m]=t.useState(null),[g,h]=t.useState(!0),[b,v]=t.useState(null),[S,w]=t.useState(null),[P,E]=t.useState({googlePay:!1,applePay:!1}),[C,_]=t.useState(!1),k=t.useCallback(async()=>{if(!o)return null;_(!0);try{const e=await o.getWalletSession(),[t,n]=await Promise.all([e.isGooglePayEligible(),e.isApplePayEligible()]);return w(e),E({googlePay:t,applePay:n}),e}catch{return w(null),E({googlePay:!1,applePay:!1}),null}finally{_(!1)}},[o]);return t.useEffect(()=>{w(null),E({googlePay:!1,applePay:!1})},[o]),t.useEffect(()=>{if(!e)return;let t=!1;return(async()=>{try{const r=await Promise.resolve(e),o={sdkAuthorization:n.sdkAuthorization},i=await r.elements(o);t||(a({...i}),u(i.hyperswitchConfig),y(o),s(i),f(r.publishableKey??null),m(n.sdkAuthorization??null),h(!1))}catch(e){t||(v(e instanceof Error?e:new Error(String(e))),h(!1))}})(),()=>{t=!0}},[e,n.sdkAuthorization]),x.jsx(M.Provider,{value:{paymentSession:o,walletSession:S,walletEligibility:P,walletLoading:C,loadWalletSession:k,elements:i,publishableKey:p,sdkAuthorization:d,loading:g,error:b,paymentSessionConfig:c,hyperswitchConfig:l},children:r})},exports.Hyperswitch=oe,exports.PaymentElement=B,exports.default=oe,exports.isApplePaySupported=G,exports.isGooglePaySupported=F,exports.isPlatformPaySupported=function(){return"ios"===e.Platform.OS?G():"android"===e.Platform.OS?F():Promise.resolve(!1)},exports.isWalletSupported=function(e){return"google_pay"===e?F():G()},exports.loadHyper=re,exports.useElements=I,exports.usePaymentSession=function(){return j().paymentSession},exports.useWalletSession=function(){const e=j();return{walletSession:e.walletSession,isGooglePayEligible:e.walletEligibility.googlePay,isApplePayEligible:e.walletEligibility.applePay,loading:e.walletLoading,load:e.loadWalletSession}},exports.useWidgets=I;
|
|
11
11
|
//# sourceMappingURL=index.bundle.js.map
|