react-native-hyperswitch-dev-sdk 0.4.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.
Files changed (262) hide show
  1. package/HyperswitchSdkReactNative.podspec +42 -0
  2. package/LICENSE +201 -0
  3. package/android/build.gradle +161 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/hyperswitch_autolinking.gradle +378 -0
  6. package/android/proguard-rules.pro +72 -0
  7. package/android/src/legacy/java/com/facebook/react/viewmanagers/GooglePayButtonManagerDelegate.java +41 -0
  8. package/android/src/legacy/java/com/facebook/react/viewmanagers/GooglePayButtonManagerInterface.java +20 -0
  9. package/android/src/legacy/java/com/facebook/react/viewmanagers/NativePaymentWidgetManagerDelegate.java +38 -0
  10. package/android/src/legacy/java/com/facebook/react/viewmanagers/NativePaymentWidgetManagerInterface.java +21 -0
  11. package/android/src/legacy/java/com/hyperswitchsdkreactnative/NativeHyperswitchSdkNativeSpec.java +106 -0
  12. package/android/src/legacy/java/com/hyperswitchsdkreactnative/NativeHyperswitchSdkReactNativeSpec.java +77 -0
  13. package/android/src/legacy/java/com/hyperswitchsdkreactnative/NativePaymentWidgetNativeSpec.java +36 -0
  14. package/android/src/main/AndroidManifest.xml +15 -0
  15. package/android/src/main/assets/hyperswitch.bundle +1535 -0
  16. package/android/src/main/java/com/hyperswitchsdkreactnative/HyperswitchSdkReactNativePackage.kt +47 -0
  17. package/android/src/main/java/com/hyperswitchsdkreactnative/modules/NativePaymentWidgetModule.kt +173 -0
  18. package/android/src/main/java/com/hyperswitchsdkreactnative/modules/ReactNativeHyperswitchModule.kt +396 -0
  19. package/android/src/main/java/com/hyperswitchsdkreactnative/views/PaymentElementViewManager.kt +99 -0
  20. package/android/src/main/java/io/hyperswitch/HyperswitchReactPackageProvider.kt +19 -0
  21. package/android/src/main/java/io/hyperswitch/PaymentEventType.kt +18 -0
  22. package/android/src/main/java/io/hyperswitch/model/ElementConfiguration.kt +58 -0
  23. package/android/src/main/java/io/hyperswitch/paymentsession/ExitHeadlessCallBackManager.kt +47 -0
  24. package/android/src/main/java/io/hyperswitch/paymentsession/GetPaymentSessionCallBackManager.kt +23 -0
  25. package/android/src/main/java/io/hyperswitch/paymentsession/PaymentMethod.kt +167 -0
  26. package/android/src/main/java/io/hyperswitch/paymentsession/PaymentSessionHandler.kt +68 -0
  27. package/android/src/main/java/io/hyperswitch/paymentsession/PaymentSessionHandlerImpl.kt +179 -0
  28. package/android/src/main/java/io/hyperswitch/paymentsession/PaymentSessionReactLauncher.kt +226 -0
  29. package/android/src/main/java/io/hyperswitch/paymentsession/PaymentSheetCallbackManager.kt +40 -0
  30. package/android/src/main/java/io/hyperswitch/paymentsheet/PaymentResult.kt +63 -0
  31. package/android/src/main/java/io/hyperswitch/react/GooglePayButtonManager.kt +54 -0
  32. package/android/src/main/java/io/hyperswitch/react/HyperActivity.kt +73 -0
  33. package/android/src/main/java/io/hyperswitch/react/HyperEventEmitter.kt +144 -0
  34. package/android/src/main/java/io/hyperswitch/react/HyperFragment.kt +429 -0
  35. package/android/src/main/java/io/hyperswitch/react/HyperFragmentManager.kt +155 -0
  36. package/android/src/main/java/io/hyperswitch/react/HyperHeadlessModule.kt +43 -0
  37. package/android/src/main/java/io/hyperswitch/react/HyperModule.kt +405 -0
  38. package/android/src/main/java/io/hyperswitch/react/HyperPackage.kt +16 -0
  39. package/android/src/main/java/io/hyperswitch/react/ReactNativeController.kt +251 -0
  40. package/android/src/main/java/io/hyperswitch/utils/ConversionUtils.kt +256 -0
  41. package/android/src/main/java/io/hyperswitch/utils/StandardResult.kt +45 -0
  42. package/android/src/main/java/io/hyperswitch/view/GooglePayButtonView.kt +59 -0
  43. package/android/src/main/java/io/hyperswitch/view/PaymentWidgetView.kt +405 -0
  44. package/android/src/main/res/values/attrs.xml +6 -0
  45. package/android/src/main/res/values/strings.xml +5 -0
  46. package/android/src/main/res/values/theme.xml +16 -0
  47. package/ios/Modules/ReactNative/HyperswitchModule.swift +470 -0
  48. package/ios/Modules/ReactNative/HyperswitchSdkReactNative.h +5 -0
  49. package/ios/Modules/ReactNative/HyperswitchSdkReactNative.mm +121 -0
  50. package/ios/Modules/ReactNative/NativeHyperswitchModule.h +18 -0
  51. package/ios/Modules/ReactNative/NativeHyperswitchModule.mm +165 -0
  52. package/ios/Modules/ReactNative/NativeHyperswitchModuleImpl.swift +290 -0
  53. package/ios/Modules/ReactNative/NativePaymentElementModule.mm +129 -0
  54. package/ios/Views/Fabric/ApplePayView.h +14 -0
  55. package/ios/Views/Fabric/ApplePayView.mm +89 -0
  56. package/ios/Views/Fabric/NativePaymentElementView.h +21 -0
  57. package/ios/Views/Fabric/NativePaymentElementView.mm +200 -0
  58. package/ios/Views/Fabric/NativePaymentWidgetViewRegistry.h +37 -0
  59. package/ios/Views/Fabric/NativePaymentWidgetViewRegistry.m +45 -0
  60. package/ios/Views/Native/NativePaymentWidget.m +26 -0
  61. package/ios/Views/Native/NativePaymentWidget.swift +420 -0
  62. package/ios/hyperswitchSDK/Core/ApplePay/ApplePayHandler.swift +261 -0
  63. package/ios/hyperswitchSDK/Core/ApplePay/ApplePayViewManager.m +18 -0
  64. package/ios/hyperswitchSDK/Core/ApplePay/ApplePayViewManager.swift +126 -0
  65. package/ios/hyperswitchSDK/Core/DeviceDataCollection/HeadlessWebView.swift +144 -0
  66. package/ios/hyperswitchSDK/Core/HyperCVCWidget/CVCWidget.swift +136 -0
  67. package/ios/hyperswitchSDK/Core/HyperExpressCheckout/ExpressCheckoutLauncher.swift +116 -0
  68. package/ios/hyperswitchSDK/Core/HyperExpressCheckout/ExpressCheckoutWidget.swift +42 -0
  69. package/ios/hyperswitchSDK/Core/HyperPaymentCardTextField/PaymentCardTextField+SwiftUI.swift +67 -0
  70. package/ios/hyperswitchSDK/Core/HyperPaymentCardTextField/PaymentCardTextField.swift +44 -0
  71. package/ios/hyperswitchSDK/Core/HyperPaymentCardTextField/PaymentHandler.swift +59 -0
  72. package/ios/hyperswitchSDK/Core/HyperPaymentCardTextField/PaymentIntentParams.swift +31 -0
  73. package/ios/hyperswitchSDK/Core/HyperPaymentCardTextField/PaymentMethodParams.swift +25 -0
  74. package/ios/hyperswitchSDK/Core/HyperPaymentMethodManagement/PaymentManagementConfiguration.swift +213 -0
  75. package/ios/hyperswitchSDK/Core/HyperPaymentMethodManagement/PaymentMethodManagementWidget.swift +92 -0
  76. package/ios/hyperswitchSDK/Core/HyperPaymentSheet/PaymentSheet+Events.swift +36 -0
  77. package/ios/hyperswitchSDK/Core/HyperPaymentSheet/PaymentSheetView+SwiftUI.swift +49 -0
  78. package/ios/hyperswitchSDK/Core/HyperPaymentSheet/PaymentSheetView+UIKit.swift +49 -0
  79. package/ios/hyperswitchSDK/Core/HyperPaymentSheet/PaymentSheetView.swift +68 -0
  80. package/ios/hyperswitchSDK/Core/HyperPaymentWidget/PaymentWidget.swift +212 -0
  81. package/ios/hyperswitchSDK/Core/HyperSession/PaymentSession+UIKit.swift +228 -0
  82. package/ios/hyperswitchSDK/Core/HyperSession/PaymentSessionTypes.swift +174 -0
  83. package/ios/hyperswitchSDK/Core/NativeModule/HyperHeadless.m +15 -0
  84. package/ios/hyperswitchSDK/Core/NativeModule/HyperHeadless.swift +108 -0
  85. package/ios/hyperswitchSDK/Core/NativeModule/HyperModule.m +31 -0
  86. package/ios/hyperswitchSDK/Core/NativeModule/HyperModule.swift +343 -0
  87. package/ios/hyperswitchSDK/Core/NativeModule/OTAServices.swift +117 -0
  88. package/ios/hyperswitchSDK/Core/NativeModule/RNHeadlessManager.swift +47 -0
  89. package/ios/hyperswitchSDK/Core/NativeModule/RNResponseHandler.swift +12 -0
  90. package/ios/hyperswitchSDK/Core/NativeModule/RNViewManager.swift +55 -0
  91. package/ios/hyperswitchSDK/Core/NativeModule/WidgetAction.swift +30 -0
  92. package/ios/hyperswitchSDK/Core/NativeModule/WidgetResponseRegistry.swift +92 -0
  93. package/ios/hyperswitchSDK/Core/NativeModule/hyper-Bridging-Header.h +12 -0
  94. package/ios/hyperswitchSDK/Core/Resources/HyperOTA.plist +20 -0
  95. package/ios/hyperswitchSDK/Core/Resources/hyperswitch.bundle +1531 -0
  96. package/ios/hyperswitchSDK/CoreLite/ApplePayHandlerLite.swift +251 -0
  97. package/ios/hyperswitchSDK/CoreLite/PaymentSession+Lite.swift +25 -0
  98. package/ios/hyperswitchSDK/CoreLite/PaymentSheetView+Lite.swift +45 -0
  99. package/ios/hyperswitchSDK/CoreLite/SwiftUI+Lite.swift +48 -0
  100. package/ios/hyperswitchSDK/CoreLite/WebViewController.swift +278 -0
  101. package/ios/hyperswitchSDK/Shared/APIClient.swift +22 -0
  102. package/ios/hyperswitchSDK/Shared/Codable+UIKit.swift +75 -0
  103. package/ios/hyperswitchSDK/Shared/CustomEndpointConfiguration.swift +67 -0
  104. package/ios/hyperswitchSDK/Shared/DictionaryConverter.swift +104 -0
  105. package/ios/hyperswitchSDK/Shared/Environment.swift +24 -0
  106. package/ios/hyperswitchSDK/Shared/Extensions.swift +101 -0
  107. package/ios/hyperswitchSDK/Shared/Helper.swift +40 -0
  108. package/ios/hyperswitchSDK/Shared/HyperEvents/PaymentEventData.swift +125 -0
  109. package/ios/hyperswitchSDK/Shared/HyperEvents/PaymentEventSubscriptionBuilder.swift +45 -0
  110. package/ios/hyperswitchSDK/Shared/HyperEvents/PaymentEventType.swift +30 -0
  111. package/ios/hyperswitchSDK/Shared/HyperNetworking.swift +151 -0
  112. package/ios/hyperswitchSDK/Shared/HyperParams.swift +44 -0
  113. package/ios/hyperswitchSDK/Shared/HyperUIViewController.swift +27 -0
  114. package/ios/hyperswitchSDK/Shared/Hyperswitch.swift +20 -0
  115. package/ios/hyperswitchSDK/Shared/HyperswitchConfigurationSchema.swift +54 -0
  116. package/ios/hyperswitchSDK/Shared/HyperswitchEnvironment.swift +11 -0
  117. package/ios/hyperswitchSDK/Shared/NativeLogger/Debouncer.swift +37 -0
  118. package/ios/hyperswitchSDK/Shared/NativeLogger/LogBuilder.swift +113 -0
  119. package/ios/hyperswitchSDK/Shared/NativeLogger/LogFileManager.swift +76 -0
  120. package/ios/hyperswitchSDK/Shared/NativeLogger/LogManager.swift +113 -0
  121. package/ios/hyperswitchSDK/Shared/NativeLogger/LogPayload.swift +91 -0
  122. package/ios/hyperswitchSDK/Shared/PaymentMethodType.swift +15 -0
  123. package/ios/hyperswitchSDK/Shared/PaymentSession.swift +98 -0
  124. package/ios/hyperswitchSDK/Shared/PaymentSessionConfiguration.swift +14 -0
  125. package/ios/hyperswitchSDK/Shared/PaymentSheet.swift +33 -0
  126. package/ios/hyperswitchSDK/Shared/PaymentSheetAppearance+Codable.swift +182 -0
  127. package/ios/hyperswitchSDK/Shared/PaymentSheetAppearance.swift +238 -0
  128. package/ios/hyperswitchSDK/Shared/PaymentSheetConfiguration.swift +161 -0
  129. package/ios/hyperswitchSDK/Shared/SDKParams.swift +43 -0
  130. package/ios/hyperswitchSDK/Shared/SavedPaymentMethodsConfiguration.swift +20 -0
  131. package/ios/hyperswitchSDK/Shared/SwiftUIManager.swift +28 -0
  132. package/ios/hyperswitchSDK/Shared/Version.swift +12 -0
  133. package/lib/bs/JuspayTechReactNativeHyperswitch.cmi +0 -0
  134. package/lib/bs/JuspayTechReactNativeHyperswitch.cmj +0 -0
  135. package/lib/bs/JuspayTechReactNativeHyperswitch.cmt +0 -0
  136. package/lib/bs/JuspayTechReactNativeHyperswitch.mlmap +0 -0
  137. package/lib/bs/build.ninja +8 -0
  138. package/lib/bs/install.ninja +9 -0
  139. package/lib/bs/src/context/HyperProvider-JuspayTechReactNativeHyperswitch.cmt +0 -0
  140. package/lib/bs/src/context/WidgetRegistry-JuspayTechReactNativeHyperswitch.cmt +0 -0
  141. package/lib/bs/src/core/Hyper-JuspayTechReactNativeHyperswitch.cmt +0 -0
  142. package/lib/bs/src/core/HyperElements-JuspayTechReactNativeHyperswitch.cmt +0 -0
  143. package/lib/bs/src/hooks/usePaymentSession-JuspayTechReactNativeHyperswitch.cmt +0 -0
  144. package/lib/bs/src/hooks/useWidget-JuspayTechReactNativeHyperswitch.cmt +0 -0
  145. package/lib/bs/src/modules/NativeHyperswitchSdk-JuspayTechReactNativeHyperswitch.cmt +0 -0
  146. package/lib/bs/src/types/HyperTypes-JuspayTechReactNativeHyperswitch.cmt +0 -0
  147. package/lib/bs/src/types/NativeModuleTypes-JuspayTechReactNativeHyperswitch.cmt +0 -0
  148. package/lib/bs/src/types/PaymentSheetConfiguration-JuspayTechReactNativeHyperswitch.cmt +0 -0
  149. package/lib/bs/src/utils/AppearanceTransformer-JuspayTechReactNativeHyperswitch.cmt +0 -0
  150. package/lib/bs/src/utils/EventValidator-JuspayTechReactNativeHyperswitch.cmt +0 -0
  151. package/lib/bs/src/utils/NewArchUtils-JuspayTechReactNativeHyperswitch.cmt +0 -0
  152. package/lib/bs/src/utils/PaymentSheetEventManager-JuspayTechReactNativeHyperswitch.cmt +0 -0
  153. package/lib/bs/src/utils/ReactNativeUtils-JuspayTechReactNativeHyperswitch.cmt +0 -0
  154. package/lib/bs/src/utils/ResponseHandler-JuspayTechReactNativeHyperswitch.cmt +0 -0
  155. package/lib/bs/src/views/CVCElement-JuspayTechReactNativeHyperswitch.cmt +0 -0
  156. package/lib/bs/src/views/NativePaymentWidget-JuspayTechReactNativeHyperswitch.cmt +0 -0
  157. package/lib/bs/src/views/NativePaymentWidgetImpl-JuspayTechReactNativeHyperswitch.cmt +0 -0
  158. package/lib/bs/src/views/PaymentElement-JuspayTechReactNativeHyperswitch.cmt +0 -0
  159. package/lib/commonjs/index.bundle.js +2 -0
  160. package/lib/commonjs/index.bundle.js.map +1 -0
  161. package/lib/module/index.bundle.js +2 -0
  162. package/lib/module/index.bundle.js.map +1 -0
  163. package/lib/typescript/babel.config.d.ts +10 -0
  164. package/lib/typescript/babel.config.d.ts.map +1 -0
  165. package/lib/typescript/eslint.config.d.mts +3 -0
  166. package/lib/typescript/eslint.config.d.mts.map +1 -0
  167. package/lib/typescript/rollup.config.d.ts +23 -0
  168. package/lib/typescript/rollup.config.d.ts.map +1 -0
  169. package/lib/typescript/scripts/bootstrap.d.ts +2 -0
  170. package/lib/typescript/scripts/bootstrap.d.ts.map +1 -0
  171. package/lib/typescript/src/context/Elements.d.ts +7 -0
  172. package/lib/typescript/src/context/Elements.d.ts.map +1 -0
  173. package/lib/typescript/src/context/HyperElements.d.ts +23 -0
  174. package/lib/typescript/src/context/HyperElements.d.ts.map +1 -0
  175. package/lib/typescript/src/context/PaymentSession.d.ts +15 -0
  176. package/lib/typescript/src/context/PaymentSession.d.ts.map +1 -0
  177. package/lib/typescript/src/context/SavedPaymentMethods.d.ts +5 -0
  178. package/lib/typescript/src/context/SavedPaymentMethods.d.ts.map +1 -0
  179. package/lib/typescript/src/context/WidgetRegistry.d.ts +8 -0
  180. package/lib/typescript/src/context/WidgetRegistry.d.ts.map +1 -0
  181. package/lib/typescript/src/context/hooks.d.ts +5 -0
  182. package/lib/typescript/src/context/hooks.d.ts.map +1 -0
  183. package/lib/typescript/src/index.d.ts +10 -0
  184. package/lib/typescript/src/index.d.ts.map +1 -0
  185. package/lib/typescript/src/modules/NativeHyperswitchSdk.d.ts +61 -0
  186. package/lib/typescript/src/modules/NativeHyperswitchSdk.d.ts.map +1 -0
  187. package/lib/typescript/src/specs/ApplePayViewNativeComponent.d.ts +10 -0
  188. package/lib/typescript/src/specs/ApplePayViewNativeComponent.d.ts.map +1 -0
  189. package/lib/typescript/src/specs/NativeHyperHeadless.d.ts +14 -0
  190. package/lib/typescript/src/specs/NativeHyperHeadless.d.ts.map +1 -0
  191. package/lib/typescript/src/specs/NativeHyperswitchModule.d.ts +32 -0
  192. package/lib/typescript/src/specs/NativeHyperswitchModule.d.ts.map +1 -0
  193. package/lib/typescript/src/specs/NativeHyperswitchSdkNative.d.ts +33 -0
  194. package/lib/typescript/src/specs/NativeHyperswitchSdkNative.d.ts.map +1 -0
  195. package/lib/typescript/src/specs/NativePaymentElementModule.d.ts +9 -0
  196. package/lib/typescript/src/specs/NativePaymentElementModule.d.ts.map +1 -0
  197. package/lib/typescript/src/specs/PaymentElementNativeComponent.d.ts +19 -0
  198. package/lib/typescript/src/specs/PaymentElementNativeComponent.d.ts.map +1 -0
  199. package/lib/typescript/src/specs/utils.d.ts +15 -0
  200. package/lib/typescript/src/specs/utils.d.ts.map +1 -0
  201. package/lib/typescript/src/types/NativeModuleTypes.d.ts +67 -0
  202. package/lib/typescript/src/types/NativeModuleTypes.d.ts.map +1 -0
  203. package/lib/typescript/src/types/PaymentSheetConfiguration.d.ts +255 -0
  204. package/lib/typescript/src/types/PaymentSheetConfiguration.d.ts.map +1 -0
  205. package/lib/typescript/src/types/definitions.d.ts +85 -0
  206. package/lib/typescript/src/types/definitions.d.ts.map +1 -0
  207. package/lib/typescript/src/types/elements/index.d.ts +23 -0
  208. package/lib/typescript/src/types/elements/index.d.ts.map +1 -0
  209. package/lib/typescript/src/types/paymentresult/index.d.ts +5 -0
  210. package/lib/typescript/src/types/paymentresult/index.d.ts.map +1 -0
  211. package/lib/typescript/src/types/savedPaymentMethods/index.d.ts +69 -0
  212. package/lib/typescript/src/types/savedPaymentMethods/index.d.ts.map +1 -0
  213. package/lib/typescript/src/utils/EventValidator.d.ts +9 -0
  214. package/lib/typescript/src/utils/EventValidator.d.ts.map +1 -0
  215. package/lib/typescript/src/utils/InitializationState.d.ts +13 -0
  216. package/lib/typescript/src/utils/InitializationState.d.ts.map +1 -0
  217. package/lib/typescript/src/utils/LaunchOptions.d.ts +7 -0
  218. package/lib/typescript/src/utils/LaunchOptions.d.ts.map +1 -0
  219. package/lib/typescript/src/utils/NewArchUtils.d.ts +7 -0
  220. package/lib/typescript/src/utils/NewArchUtils.d.ts.map +1 -0
  221. package/lib/typescript/src/utils/ReactNativeUtils.d.ts +3 -0
  222. package/lib/typescript/src/utils/ReactNativeUtils.d.ts.map +1 -0
  223. package/lib/typescript/src/views/CVCElement.d.ts +15 -0
  224. package/lib/typescript/src/views/CVCElement.d.ts.map +1 -0
  225. package/lib/typescript/src/views/NativePaymentWidget.d.ts +3 -0
  226. package/lib/typescript/src/views/NativePaymentWidget.d.ts.map +1 -0
  227. package/lib/typescript/src/views/NativePaymentWidgetImpl.d.ts +5 -0
  228. package/lib/typescript/src/views/NativePaymentWidgetImpl.d.ts.map +1 -0
  229. package/lib/typescript/src/views/PaymentElement.d.ts +18 -0
  230. package/lib/typescript/src/views/PaymentElement.d.ts.map +1 -0
  231. package/package.json +184 -0
  232. package/src/context/Elements.ts +80 -0
  233. package/src/context/HyperElements.tsx +81 -0
  234. package/src/context/PaymentSession.ts +121 -0
  235. package/src/context/SavedPaymentMethods.ts +80 -0
  236. package/src/context/WidgetRegistry.ts +74 -0
  237. package/src/context/hooks.ts +79 -0
  238. package/src/index.ts +53 -0
  239. package/src/modules/NativeHyperswitchSdk.ts +155 -0
  240. package/src/specs/ApplePayViewNativeComponent.ts +11 -0
  241. package/src/specs/NativeHyperHeadless.ts +22 -0
  242. package/src/specs/NativeHyperswitchModule.ts +51 -0
  243. package/src/specs/NativeHyperswitchSdkNative.ts +62 -0
  244. package/src/specs/NativePaymentElementModule.ts +25 -0
  245. package/src/specs/PaymentElementNativeComponent.ts +21 -0
  246. package/src/specs/utils.ts +15 -0
  247. package/src/types/NativeModuleTypes.ts +73 -0
  248. package/src/types/PaymentSheetConfiguration.ts +360 -0
  249. package/src/types/definitions.ts +109 -0
  250. package/src/types/elements/index.ts +33 -0
  251. package/src/types/paymentresult/index.ts +4 -0
  252. package/src/types/savedPaymentMethods/index.ts +74 -0
  253. package/src/utils/EventValidator.ts +39 -0
  254. package/src/utils/InitializationState.ts +28 -0
  255. package/src/utils/LaunchOptions.ts +41 -0
  256. package/src/utils/NewArchUtils.ts +18 -0
  257. package/src/utils/ReactNativeUtils.ts +13 -0
  258. package/src/views/CVCElement.tsx +122 -0
  259. package/src/views/NativePaymentWidget.ts +2 -0
  260. package/src/views/NativePaymentWidgetImpl.ts +16 -0
  261. package/src/views/PaymentElement.tsx +189 -0
  262. package/tsconfig.build.json +21 -0
@@ -0,0 +1,161 @@
1
+ //
2
+ // PaymentSheetConfiguration.swift
3
+ // Hyperswitch
4
+ //
5
+ // Created by Balaganesh on 09/12/22.
6
+ //
7
+
8
+ import Foundation
9
+ import PassKit
10
+ import UIKit
11
+
12
+ // MARK: - Configuration
13
+ extension PaymentSheet {
14
+
15
+ /// Configuration for PaymentSheet
16
+ public struct Configuration: Codable {
17
+
18
+ /// Initializes a Configuration with default values
19
+ public init() {}
20
+
21
+ /// If true, allows payment methods that do not move money at the end of the checkout. Defaults to false.
22
+ /// - Description: Some payment methods can't guarantee you will receive funds from your customer at the end of the checkout because they take time to settle (eg. most bank debits, like SEPA or ACH) or require customer action to complete (e.g. OXXO, Konbini, Boleto). If this is set to true, make sure your integration listens to webhooks for notifications on whether a payment has succeeded or not.
23
+ public var allowsDelayedPaymentMethods: Bool?
24
+
25
+ /// If `true`, allows payment methods that require a shipping address, like Afterpay and Affirm. Defaults to `false`.
26
+ /// Set this to `true` if you collect shipping addresses and set `Configuration.shippingDetails` or set `shipping` details directly on the PaymentIntent.
27
+ /// - Note: PaymentSheet considers this property `true` and allows payment methods that require a shipping address if `shipping` details are present on the PaymentIntent when PaymentSheet loads.
28
+ public var allowsPaymentMethodsRequiringShippingAddress: Bool?
29
+
30
+ /// The label to use for the primary button.
31
+ ///
32
+ /// If not set, Payment Sheet will display suitable default labels
33
+ /// for payment and setup intents.
34
+ public var primaryButtonLabel: String?
35
+
36
+ public var paymentSheetHeaderLabel: String?
37
+
38
+ public var savedPaymentSheetHeaderLabel: String?
39
+
40
+ /// Your customer-facing business name.
41
+ /// The default value is the name of your app, using CFBundleDisplayName or CFBundleName
42
+ public var merchantDisplayName: String?
43
+
44
+ ///
45
+ /// toggle to disable SaveCard CheckBox
46
+ public var displaySavedPaymentMethodsCheckbox: Bool?
47
+
48
+ ///
49
+ /// toggle to disable SavedCard Screen
50
+ public var displaySavedPaymentMethods: Bool?
51
+
52
+ ///
53
+ /// toggle to disable Branding
54
+ public var disableBranding: Bool?
55
+
56
+ ///
57
+ /// add custom placeholder text
58
+ public var placeholder: PlaceHolder = PlaceHolder()
59
+
60
+ ///
61
+ /// toggle to disable Default Saved Payment Icon
62
+ public var displayDefaultSavedPaymentIcon: Bool?
63
+
64
+ /// A URL that redirects back to your app that PaymentSheet can use to auto-dismiss
65
+ /// web views used for additional authentication, e.g. 3DS2
66
+ public var returnURL: String?
67
+
68
+ /// DefaultView = `true` launches PaymentSheet with cardForm, never shows the loading state.
69
+ /// Default value is `false`
70
+ public var defaultView: Bool?
71
+
72
+ /// Describes the appearance of PaymentSheet
73
+ public var appearance: PaymentSheet.Appearance = PaymentSheet.Appearance()
74
+
75
+ /// PaymentSheet pre-populates fields with the values provided.
76
+ /// be attached to the payment method even if they are not collected by the PaymentSheet UI.
77
+ public var defaultBillingDetails: AddressDetails = AddressDetails()
78
+
79
+ /// A closure that returns the customer's shipping details.
80
+ /// This is used to display a "Billing address is same as shipping" checkbox if `defaultBillingDetails` is not provided
81
+ public var shippingDetails: AddressDetails = AddressDetails()
82
+
83
+ /// Optional configuration to display a custom message when a saved payment method is removed.
84
+ public var removeSavedPaymentMethodMessage: String?
85
+
86
+ /// By default, PaymentSheet will use a dynamic ordering that optimizes payment method display for the customer.
87
+ /// You can override the default order in which payment methods are displayed in PaymentSheet with a list of payment method types.
88
+ /// See https://docs.hyperswitch.io/api/payment_methods/object#payment_method_object-type for the list of valid types. You may also pass external payment methods.
89
+ /// - Example: ["card", "external_paypal", "klarna"]
90
+ /// - Note: If you omit payment methods from this list, they’ll be automatically ordered by Hyperswitch after the ones you provide. Invalid payment methods are ignored.
91
+ public var paymentMethodOrder: [String]?
92
+
93
+ /// Api key used to invoke netcetera sdk for redirection-less 3DS authentication.
94
+ public var netceteraSDKApiKey: String?
95
+
96
+ /// hide confirm button for external confirm action
97
+ public var hideConfirmButton: Bool?
98
+
99
+ public struct PlaceHolder: Codable {
100
+
101
+ public init() {}
102
+
103
+ public var cardNumber: String?
104
+
105
+ public var expiryDate: String? // MM/YY
106
+
107
+ public var cvv: String?
108
+ }
109
+
110
+ /// Billing details of a customer
111
+ public struct AddressDetails: Codable {
112
+
113
+ /// Initializes billing details
114
+ public init() {}
115
+
116
+ /// The customer's billing address
117
+ public var address: Address = Address()
118
+
119
+ /// The customer's email
120
+ /// - Note: The value set is displayed in the payment sheet as-is. Depending on the payment method, the customer may be required to edit this value.
121
+ public var email: String?
122
+
123
+ /// The customer's full name
124
+ /// - Note: The value set is displayed in the payment sheet as-is. Depending on the payment method, the customer may be required to edit this value.
125
+ public var name: String?
126
+
127
+ /// The customer's phone number without formatting (e.g. 5551234567)
128
+ public var phone: String?
129
+ }
130
+
131
+ /// An address.
132
+ public struct Address: Codable {
133
+
134
+ /// Initializes an Address
135
+ public init() {}
136
+
137
+ /// City, district, suburb, town, or village.
138
+ /// - Note: The value set is displayed in the payment sheet as-is. Depending on the payment method, the customer may be required to edit this value.
139
+ public var city: String?
140
+
141
+ /// Two-letter country code (ISO 3166-1 alpha-2).
142
+ public var country: String?
143
+
144
+ /// Address line 1 (e.g., street, PO Box, or company name).
145
+ /// - Note: The value set is displayed in the payment sheet as-is. Depending on the payment method, the customer may be required to edit this value.
146
+ public var line1: String?
147
+
148
+ /// Address line 2 (e.g., apartment, suite, unit, or building).
149
+ /// - Note: The value set is displayed in the payment sheet as-is. Depending on the payment method, the customer may be required to edit this value.
150
+ public var line2: String?
151
+
152
+ /// ZIP or postal code.
153
+ /// - Note: The value set is displayed in the payment sheet as-is. Depending on the payment method, the customer may be required to edit this value.
154
+ public var postalCode: String?
155
+
156
+ /// State, county, province, or region.
157
+ /// - Note: The value set is displayed in the payment sheet as-is. Depending on the payment method, the customer may be required to edit this value.
158
+ public var state: String?
159
+ }
160
+ }
161
+ }
@@ -0,0 +1,43 @@
1
+ //
2
+ // HyperParams.swift
3
+ // hyperswitch
4
+ //
5
+ // Created by Shivam Nan on 15/01/25.
6
+ //
7
+
8
+ import UIKit
9
+
10
+ class SDKParams {
11
+ static let appId: String? = Bundle.main.bundleIdentifier
12
+ static let sdkVersion: String = SDKVersion.current
13
+ static let country: String? = NSLocale.current.regionCode
14
+ // static let userAgent: String? = WKWebView().value(forKey: "userAgent") as? String
15
+ static let deviceModel: String = UIDevice.current.model
16
+ static let osVersion: String = UIDevice.current.systemVersion
17
+
18
+ // static func getSafeAreaInsets() -> UIEdgeInsets {
19
+ // let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene
20
+ // return windowScene?.windows.first?.safeAreaInsets ?? UIEdgeInsets.zero
21
+ // }
22
+
23
+ static func getSDKParams() -> [String: Any?] {
24
+
25
+ // let safeAreaInset = getSafeAreaInsets()
26
+
27
+ let params: [String: Any?] = [
28
+ "appId": appId,
29
+ "sdkVersion": sdkVersion,
30
+ "country": country,
31
+ // "user-agent": userAgent,
32
+ "device_model": deviceModel,
33
+ "os_version": osVersion,
34
+ "os_type": "ios",
35
+ "launchTime": Int(Date().timeIntervalSince1970 * 1000),
36
+ // "topInset": safeAreaInset.top,
37
+ // "bottomInset": safeAreaInset.bottom,
38
+ // "leftInset": safeAreaInset.left,
39
+ // "rightInset": safeAreaInset.right,
40
+ ]
41
+ return params
42
+ }
43
+ }
@@ -0,0 +1,20 @@
1
+ //
2
+ // SavedPaymentMethodsConfiguration.swift
3
+ // hyperswitch
4
+ //
5
+
6
+ import Foundation
7
+
8
+ /// Configuration for filtering saved payment methods returned by
9
+ /// `PaymentSession.getCustomerSavedPaymentMethods`.
10
+ ///
11
+ /// - Parameter hiddenPaymentMethods: Payment method types to exclude from the
12
+ /// saved methods list (e.g. `["apple_pay", "paypal"]`). Values are matched against
13
+ /// the `payment_method_type` field returned by the Hyperswitch API.
14
+ public struct SavedPaymentMethodsConfiguration: Codable {
15
+ public var hiddenPaymentMethods: [String]
16
+
17
+ public init(hiddenPaymentMethods: [String]) {
18
+ self.hiddenPaymentMethods = hiddenPaymentMethods
19
+ }
20
+ }
@@ -0,0 +1,28 @@
1
+ //
2
+ // SwiftUIManager.swift
3
+ // Hyperswitch
4
+ //
5
+ // Created by Shivam Shashank on 02/12/22.
6
+ //
7
+
8
+ import SwiftUI
9
+
10
+ struct ViewControllerHolder {
11
+ weak var value: UIViewController?
12
+ }
13
+
14
+ @available(iOS 13.0, *)
15
+ struct ViewControllerKey: EnvironmentKey {
16
+ static var defaultValue: ViewControllerHolder {
17
+ let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene
18
+ return ViewControllerHolder(value: windowScene?.windows.first?.rootViewController)
19
+ }
20
+ }
21
+
22
+ @available(iOS 13.0, *)
23
+ extension EnvironmentValues {
24
+ var viewController: UIViewController? {
25
+ get { return self[ViewControllerKey.self].value }
26
+ set { self[ViewControllerKey.self].value = newValue }
27
+ }
28
+ }
@@ -0,0 +1,12 @@
1
+ //
2
+ // Version.swift
3
+ // hyperswitch
4
+ //
5
+ // Created by Harshit Srivastava on 05/09/24.
6
+ //
7
+
8
+ import Foundation
9
+
10
+ public struct SDKVersion {
11
+ public static let current = "0.5.4"
12
+ }
@@ -0,0 +1,8 @@
1
+ rescript = 1
2
+ g_finger := /Users/kuntimaddi.manideep/hyperswitch-base/frontend/react-native-hs/react-native-hyperswitch/packages/@juspay-tech/react-native-hyperswitch/node_modules/@rescript/react/lib/ocaml/install.stamp
3
+ g_finger := /Users/kuntimaddi.manideep/hyperswitch-base/frontend/react-native-hs/react-native-hyperswitch/packages/@juspay-tech/react-native-hyperswitch/node_modules/rescript-react-native/lib/ocaml/install.stamp
4
+ g_finger := /Users/kuntimaddi.manideep/hyperswitch-base/frontend/react-native-hs/react-native-hyperswitch/packages/@juspay-tech/react-native-hyperswitch/node_modules/@rescript/core/lib/ocaml/install.stamp
5
+ rule build_package
6
+ command = /Users/kuntimaddi.manideep/hyperswitch-base/frontend/react-native-hs/react-native-hyperswitch/packages/@juspay-tech/react-native-hyperswitch/node_modules/rescript/darwinarm64/bsc.exe -w -49 -color always -no-alias-deps $i
7
+ restat = 1
8
+ o JuspayTechReactNativeHyperswitch.cmi : build_package JuspayTechReactNativeHyperswitch.mlmap
@@ -0,0 +1,9 @@
1
+ rescript = 1
2
+ rule cp
3
+ command = cp $i $out
4
+ rule touch
5
+ command = touch $out
6
+ o JuspayTechReactNativeHyperswitch.cmi : cp ../bs/JuspayTechReactNativeHyperswitch.cmi
7
+ o JuspayTechReactNativeHyperswitch.cmj : cp ../bs/JuspayTechReactNativeHyperswitch.cmj
8
+ o JuspayTechReactNativeHyperswitch.cmt : cp ../bs/JuspayTechReactNativeHyperswitch.cmt
9
+ build install.stamp : touch JuspayTechReactNativeHyperswitch.cmi JuspayTechReactNativeHyperswitch.cmj
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react-native");const t=e.TurboModuleRegistry.get("NativeHyperswitchModule")??e.NativeModules.NativeHyperswitchModule;function n(e,t,n={}){const{platformPublishableKey:a,...s}=e;return{hyperswitchConfig:s,paymentSessionConfig:t,configuration:n}}function a(e){const t=JSON.parse(e);if(t.billing&&"string"==typeof t.billing)try{t.billing=JSON.parse(t.billing)}catch{t.billing=null}return t}async function s(e,s,i){const r=n(e,s,i);return await t.getCustomerSavedPaymentMethods(r),{getCustomerLastUsedPaymentMethodData:async()=>a(await t.getCustomerLastUsedPaymentMethodData()),getCustomerDefaultSavedPaymentMethodData:async()=>a(await t.getCustomerDefaultSavedPaymentMethodData()),getCustomerSavedPaymentMethodData:async()=>a(await t.getCustomerSavedPaymentMethodData()),async confirmWithCustomerLastUsedPaymentMethod(e){await t.confirmWithCustomerLastUsedPaymentMethod()},async confirmWithCustomerDefaultPaymentMethod(e){await t.confirmWithCustomerDefaultPaymentMethod()}}}console.log("NativeHyperswitchModule",t);let i=!1;function r(e){i=e}let o=!1;function c(e){o=e}function u(e){switch(e){case"succeeded":case"completed":case"success":return"completed";case"cancelled":case"canceled":return"canceled";default:return"failed"}}function l(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{type:u(t.status),message:t.message}}async function y(e){if(i)return{type:"failed",message:"SDK is reloading. Please wait for initialisation to complete before presenting the payment sheet."};if(o)return{type:"canceled",message:"A payment sheet is already presented."};c(!0);try{return l(await t.presentPaymentSheet({hyperswitchConfig:e.hyperswitchConfig,paymentSessionConfig:e.paymentSessionConfig,configuration:e.configuration}))}finally{c(!1)}}async function m(e){}function d(e,t){return{presentPaymentSheet:async a=>y(n(e,t,a)),async confirmPayment(e,t){},getCustomerSavedPaymentMethods:async n=>s(e,t,n),updateIntent:m}}function f(e){return r(!0),t.initialise(e.publishableKey,e.platformPublishableKey??"",e.profileId??"",e.environment??"PROD",e.customEndpoints??{}).then(()=>(r(!1),{publishableKey:e.publishableKey,async initPaymentSession(t){return a=e,i=t,{presentPaymentSheet:async e=>y(n(a,i,e)),getCustomerSavedPaymentMethods:async e=>s(a,i,e),updateIntent:m};var a,i},elements:async t=>({...d(e,t)})})).catch(e=>{throw r(!1),console.error("Error initializing Hyperswitch SDK:",e),e})}const h={init:f};exports.Hyperswitch=h,exports.loadHyper=f;
2
+ //# sourceMappingURL=index.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.bundle.js","sources":["../../../../src/specs/NativeHyperswitchModule.ts","../../../../src/utils/LaunchOptions.ts","../../../../src/context/SavedPaymentMethods.ts","../../../../src/utils/InitializationState.ts","../../../../src/context/PaymentSession.ts","../../../../src/context/Elements.ts","../../../../src/index.ts"],"sourcesContent":["import type { TurboModule } from 'react-native';\nimport { NativeModules, TurboModuleRegistry } from 'react-native';\n\nexport type CustomEndpoints = Object;\n\nexport interface SessionData {\n hyperswitchConfig: Object;\n paymentSessionConfig: { sdkAuthorization: string };\n configuration: Object;\n}\n\nexport interface SavedPaymentMethodsConfiguration {\n hiddenPaymentMethods?: string[];\n}\n\nexport interface Spec extends TurboModule {\n initialise(\n publishableKey: string,\n platformPublishableKey: string,\n profileId: string,\n environment: string,\n customEndpoints: CustomEndpoints\n ): Promise<string>;\n\n presentPaymentSheet(params: SessionData): Promise<string>;\n\n getCustomerSavedPaymentMethods(params?: SessionData): Promise<string>;\n\n getCustomerLastUsedPaymentMethodData(): Promise<string>;\n\n getCustomerDefaultSavedPaymentMethodData(): Promise<string>;\n\n getCustomerSavedPaymentMethodData(): Promise<string>;\n\n confirmWithCustomerLastUsedPaymentMethod(reactTag: number): Promise<string>;\n\n confirmWithCustomerDefaultPaymentMethod(reactTag: number): Promise<string>;\n\n confirmWithCustomerPaymentToken(reactTag: number, token: string): Promise<string>;\n}\n\n/**\n * Use `TurboModuleRegistry.get` first for new-arch TurboModules, and fall back\n * to `NativeModules` for legacy/old-arch support.\n */\nconst NativeHyperswitchModule =\n TurboModuleRegistry.get<Spec>('NativeHyperswitchModule') ??\n NativeModules.NativeHyperswitchModule;\nconsole.log('NativeHyperswitchModule', NativeHyperswitchModule);\nexport default NativeHyperswitchModule as Spec;\nexport { NativeHyperswitchModule };\n","import type {\n HyperswitchConfiguration,\n NativePaymentSheetPayload,\n} from '../types/definitions';\nimport type { PaymentSessionConfiguration } from '../types/definitions';\nimport { PaymentResult } from '../types/paymentresult';\n\nfunction buildPresentPaymentSheetPayload(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration,\n configuration: Record<string, unknown> = {},\n): NativePaymentSheetPayload {\n // platformPublishableKey is internal to the RN bridge; it is not part of the\n // merchant-facing hyperswitchConfig payload.\n const { platformPublishableKey: _platformPublishableKey, ...restConfig } =\n hyperswitchConfig;\n\n return {\n hyperswitchConfig: restConfig as Record<string, unknown>,\n paymentSessionConfig: paymentSessionConfig,\n configuration,\n };\n}\n\nfunction mapStatus(status: string): PaymentResult['type'] {\n switch (status) {\n case 'succeeded':\n case 'completed':\n case 'success':\n return 'completed';\n case 'cancelled':\n case 'canceled':\n return 'canceled';\n case 'failed':\n case 'error':\n default:\n return 'failed';\n }\n}\n\nexport { buildPresentPaymentSheetPayload, mapStatus };\n","import NativeHyperswitchModule from '../specs/NativeHyperswitchModule';\nimport {\n HyperswitchConfiguration,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport {\n CustomerSavedPaymentMethodsSession,\n CustomerLastUsedPaymentMethod,\n} from '../types/savedPaymentMethods';\nimport { buildPresentPaymentSheetPayload } from '../utils/LaunchOptions';\n\nfunction parsePaymentMethod(raw: string): CustomerLastUsedPaymentMethod {\n const parsed = JSON.parse(raw) as CustomerLastUsedPaymentMethod & {\n billing?: string | object | null;\n };\n if (parsed.billing && typeof parsed.billing === 'string') {\n try {\n parsed.billing = JSON.parse(parsed.billing);\n } catch {\n parsed.billing = null;\n }\n }\n return parsed as CustomerLastUsedPaymentMethod;\n}\n\nexport function createCustomerSavedPaymentMethodsSession(): CustomerSavedPaymentMethodsSession {\n return {\n async getCustomerLastUsedPaymentMethodData(): Promise<CustomerLastUsedPaymentMethod | null> {\n const raw =\n await NativeHyperswitchModule.getCustomerLastUsedPaymentMethodData();\n return parsePaymentMethod(raw);\n },\n\n async getCustomerDefaultSavedPaymentMethodData(): Promise<CustomerLastUsedPaymentMethod | null> {\n const raw =\n await NativeHyperswitchModule.getCustomerDefaultSavedPaymentMethodData();\n return parsePaymentMethod(raw);\n },\n\n async getCustomerSavedPaymentMethodData(): Promise<CustomerLastUsedPaymentMethod | null> {\n const raw =\n await NativeHyperswitchModule.getCustomerSavedPaymentMethodData();\n return parsePaymentMethod(raw);\n },\n\n async confirmWithCustomerLastUsedPaymentMethod(args?: {\n id?: string;\n }): Promise<any> {\n const raw = await NativeHyperswitchModule\n .confirmWithCustomerLastUsedPaymentMethod\n // args?.id\n ();\n // return mapNativeResponseToPaymentResult(raw);\n },\n\n async confirmWithCustomerDefaultPaymentMethod(args?: {\n id?: string;\n }): Promise<any> {\n const raw = await NativeHyperswitchModule\n .confirmWithCustomerDefaultPaymentMethod\n // args?.id\n ();\n // return mapNativeResponseToPaymentResult(raw);\n },\n };\n}\n\nexport async function getCustomerSavedPaymentMethods(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration,\n configuration?: Record<string, unknown>\n): Promise<CustomerSavedPaymentMethodsSession> {\n const payload = buildPresentPaymentSheetPayload(\n hyperswitchConfig,\n paymentSessionConfig,\n configuration\n );\n await NativeHyperswitchModule.getCustomerSavedPaymentMethods(payload);\n return createCustomerSavedPaymentMethodsSession();\n}\n","/**\n * Tracks whether the Hyperswitch SDK is currently initialising (or re-initialising\n * after a reload). presentPaymentSheet should be blocked while this flag is true\n * so the native SDK is not asked to open a sheet before it is ready.\n *\n * Also tracks whether a payment sheet is currently presented so that a hot-reload\n * (or any other code path) cannot stack a second sheet on top of an open one.\n */\n\nlet _isInitializing = false;\n\nexport function setInitializing(value: boolean): void {\n _isInitializing = value;\n}\n\nexport function isInitializing(): boolean {\n return _isInitializing;\n}\n\nlet _isSheetPresented = false;\n\nexport function setSheetPresented(value: boolean): void {\n _isSheetPresented = value;\n}\n\nexport function isSheetPresented(): boolean {\n return _isSheetPresented;\n}\n","import NativeHyperswitchModule from '../specs/NativeHyperswitchModule';\nimport type {\n HyperswitchConfiguration,\n NativePaymentSheetPayload,\n PaymentSession,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport { buildPresentPaymentSheetPayload } from '../utils/LaunchOptions';\nimport { getCustomerSavedPaymentMethods } from './SavedPaymentMethods';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { CustomerSavedPaymentMethodsSession } from '../types/savedPaymentMethods';\nimport { isInitializing, isSheetPresented, setSheetPresented } from '../utils/InitializationState';\n\ninterface NativeResponse {\n status: string;\n message: string;\n data?: any;\n}\n\nexport function parseNativeResponse(\n raw: string | NativeResponse\n): NativeResponse {\n if (typeof raw === 'object' && raw !== null) {\n return raw as NativeResponse;\n }\n try {\n return JSON.parse(raw as string) as NativeResponse;\n } catch {\n return { status: 'failed', message: String(raw) };\n }\n}\n\nexport function mapStatus(status: string): PaymentResult['type'] {\n switch (status) {\n case 'succeeded':\n case 'completed':\n case 'success':\n return 'completed';\n case 'cancelled':\n case 'canceled':\n return 'canceled';\n case 'failed':\n case 'error':\n default:\n return 'failed';\n }\n}\n\nexport function mapNativeResponseToPaymentResult(\n raw: string | NativeResponse\n): PaymentResult {\n const parsed = parseNativeResponse(raw);\n return {\n type: mapStatus(parsed.status),\n message: parsed.message,\n };\n}\n\nexport async function presentPaymentSheetWithPayload(\n payload: NativePaymentSheetPayload\n): Promise<PaymentResult> {\n if (isInitializing()) {\n return {\n type: 'failed',\n message: 'SDK is reloading. Please wait for initialisation to complete before presenting the payment sheet.',\n };\n }\n if (isSheetPresented()) {\n // A sheet is already open (e.g. a hot-reload fired while the sheet was visible).\n // Silently skip so the existing sheet is not covered by a new one.\n return {\n type: 'canceled',\n message: 'A payment sheet is already presented.',\n };\n }\n setSheetPresented(true);\n try {\n const raw = await NativeHyperswitchModule.presentPaymentSheet({\n hyperswitchConfig: payload.hyperswitchConfig,\n paymentSessionConfig: payload.paymentSessionConfig,\n configuration: payload.configuration,\n });\n return mapNativeResponseToPaymentResult(raw);\n } finally {\n setSheetPresented(false);\n }\n}\n\nexport async function updateIntent(\n _intentResolver: () => Promise<PaymentSessionConfiguration>\n): Promise<void> {\n}\n\nexport function createPaymentSession(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration\n): PaymentSession {\n return {\n async presentPaymentSheet(\n configuration?: Record<string, unknown>\n ): Promise<PaymentResult> {\n const payload = buildPresentPaymentSheetPayload(\n hyperswitchConfig,\n paymentSessionConfig,\n configuration\n );\n return presentPaymentSheetWithPayload(payload);\n },\n\n async getCustomerSavedPaymentMethods(\n configuration?: Record<string, unknown>\n ): Promise<CustomerSavedPaymentMethodsSession> {\n return getCustomerSavedPaymentMethods(\n hyperswitchConfig,\n paymentSessionConfig,\n configuration\n );\n },\n updateIntent,\n };\n}\n","import type {\n HyperswitchConfiguration,\n PaymentElementHandle,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport { buildPresentPaymentSheetPayload } from '../utils/LaunchOptions';\nimport {\n presentPaymentSheetWithPayload,\n updateIntent,\n} from '../context/PaymentSession';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { CustomerSavedPaymentMethodsSession } from '../types/savedPaymentMethods';\n\nimport { getCustomerSavedPaymentMethods } from './SavedPaymentMethods';\nimport { Elements } from '../types/elements';\n\ntype ElementsNativeActions = Pick<\n Elements,\n | 'confirmPayment'\n | 'presentPaymentSheet'\n | 'getCustomerSavedPaymentMethods'\n | 'updateIntent'\n>;\n\nexport function createElementsNativeActions(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration\n): ElementsNativeActions {\n return {\n async presentPaymentSheet(\n configuration?: Record<string, unknown>\n ): Promise<PaymentResult> {\n const payload = buildPresentPaymentSheetPayload(\n hyperswitchConfig,\n paymentSessionConfig,\n configuration\n );\n return presentPaymentSheetWithPayload(payload);\n },\n\n async confirmPayment(\n paymentElementRef: { current: PaymentElementHandle | null } | string,\n _confirmOptions?: { confirmParams?: Record<string, any> }\n ): Promise<any> {\n // if (typeof paymentElementRef === 'string') {\n // const result = await widgetConfirm(paymentElementRef);\n // return {\n // type: mapStatus(result.status),\n // message: result.message,\n // };\n // }\n // const ref = paymentElementRef.current;\n // if (!ref) {\n // throw new Error('PaymentElement reference is not mounted');\n // }\n // return ref.confirmPayment(_confirmOptions);\n },\n\n async getCustomerSavedPaymentMethods(\n configuration?: Record<string, unknown>\n ): Promise<CustomerSavedPaymentMethodsSession> {\n return getCustomerSavedPaymentMethods(\n hyperswitchConfig,\n paymentSessionConfig,\n configuration\n );\n },\n\n updateIntent: updateIntent,\n };\n}\n\nexport function createElements(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration\n): Elements {\n return {\n ...createElementsNativeActions(hyperswitchConfig, paymentSessionConfig),\n };\n}\n","import type {\n HyperswitchConfiguration,\n PaymentSession,\n PaymentSessionConfiguration,\n HyperswitchSession\n} from './types/definitions';\n\nexport type * from './types/definitions';\nexport type * from './types/elements';\nexport type * from './types/NativeModuleTypes';\nexport type * from './types/PaymentSheetConfiguration'\n\nimport NativeHyperswitchModule from './specs/NativeHyperswitchModule';\nimport { createPaymentSession } from './context/PaymentSession';\nimport { Elements } from './types/elements';\nimport { createElements } from './context/Elements';\nimport { setInitializing } from './utils/InitializationState';\n\nexport function loadHyper(\n config: HyperswitchConfiguration\n): Promise<HyperswitchSession> {\n setInitializing(true);\n return NativeHyperswitchModule.initialise(\n config.publishableKey,\n config.platformPublishableKey ?? '',\n config.profileId ?? '',\n config.environment ?? 'PROD',\n config.customEndpoints ?? {}\n ).then(() => {\n setInitializing(false);\n return {\n publishableKey: config.publishableKey,\n async initPaymentSession(\n options: PaymentSessionConfiguration\n ): Promise<PaymentSession> {\n return createPaymentSession(config, options);\n },\n async elements(options: PaymentSessionConfiguration): Promise<Elements> {\n return createElements(config, options);\n },\n }\n }).catch((error) => {\n setInitializing(false);\n console.error('Error initializing Hyperswitch SDK:', error);\n throw error;\n });\n\n}\n\n\nexport const Hyperswitch = {\n init: loadHyper,\n};"],"names":["NativeHyperswitchModule","TurboModuleRegistry","get","NativeModules","buildPresentPaymentSheetPayload","hyperswitchConfig","paymentSessionConfig","configuration","platformPublishableKey","_platformPublishableKey","restConfig","parsePaymentMethod","raw","parsed","JSON","parse","billing","async","getCustomerSavedPaymentMethods","payload","getCustomerLastUsedPaymentMethodData","getCustomerDefaultSavedPaymentMethodData","getCustomerSavedPaymentMethodData","confirmWithCustomerLastUsedPaymentMethod","args","confirmWithCustomerDefaultPaymentMethod","console","log","_isInitializing","setInitializing","value","_isSheetPresented","setSheetPresented","mapStatus","status","mapNativeResponseToPaymentResult","message","String","parseNativeResponse","type","presentPaymentSheetWithPayload","presentPaymentSheet","updateIntent","_intentResolver","createElementsNativeActions","confirmPayment","paymentElementRef","_confirmOptions","loadHyper","config","initialise","publishableKey","profileId","environment","customEndpoints","then","initPaymentSession","options","catch","error","Hyperswitch","init"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import{TurboModuleRegistry as e,NativeModules as t}from"react-native";const n=e.get("NativeHyperswitchModule")??t.NativeHyperswitchModule;function a(e,t,n={}){const{platformPublishableKey:a,...s}=e;return{hyperswitchConfig:s,paymentSessionConfig:t,configuration:n}}function s(e){const t=JSON.parse(e);if(t.billing&&"string"==typeof t.billing)try{t.billing=JSON.parse(t.billing)}catch{t.billing=null}return t}async function i(e,t,i){const o=a(e,t,i);return await n.getCustomerSavedPaymentMethods(o),{getCustomerLastUsedPaymentMethodData:async()=>s(await n.getCustomerLastUsedPaymentMethodData()),getCustomerDefaultSavedPaymentMethodData:async()=>s(await n.getCustomerDefaultSavedPaymentMethodData()),getCustomerSavedPaymentMethodData:async()=>s(await n.getCustomerSavedPaymentMethodData()),async confirmWithCustomerLastUsedPaymentMethod(e){await n.confirmWithCustomerLastUsedPaymentMethod()},async confirmWithCustomerDefaultPaymentMethod(e){await n.confirmWithCustomerDefaultPaymentMethod()}}}console.log("NativeHyperswitchModule",n);let o=!1;function r(e){o=e}let c=!1;function u(e){c=e}function l(e){switch(e){case"succeeded":case"completed":case"success":return"completed";case"cancelled":case"canceled":return"canceled";default:return"failed"}}function y(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{type:l(t.status),message:t.message}}async function m(e){if(o)return{type:"failed",message:"SDK is reloading. Please wait for initialisation to complete before presenting the payment sheet."};if(c)return{type:"canceled",message:"A payment sheet is already presented."};u(!0);try{return y(await n.presentPaymentSheet({hyperswitchConfig:e.hyperswitchConfig,paymentSessionConfig:e.paymentSessionConfig,configuration:e.configuration}))}finally{u(!1)}}async function f(e){}function d(e,t){return{presentPaymentSheet:async n=>m(a(e,t,n)),async confirmPayment(e,t){},getCustomerSavedPaymentMethods:async n=>i(e,t,n),updateIntent:f}}function h(e){return r(!0),n.initialise(e.publishableKey,e.platformPublishableKey??"",e.profileId??"",e.environment??"PROD",e.customEndpoints??{}).then(()=>(r(!1),{publishableKey:e.publishableKey,async initPaymentSession(t){return n=e,s=t,{presentPaymentSheet:async e=>m(a(n,s,e)),getCustomerSavedPaymentMethods:async e=>i(n,s,e),updateIntent:f};var n,s},elements:async t=>({...d(e,t)})})).catch(e=>{throw r(!1),console.error("Error initializing Hyperswitch SDK:",e),e})}const p={init:h};export{p as Hyperswitch,h as loadHyper};
2
+ //# sourceMappingURL=index.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.bundle.js","sources":["../../../../src/specs/NativeHyperswitchModule.ts","../../../../src/utils/LaunchOptions.ts","../../../../src/context/SavedPaymentMethods.ts","../../../../src/utils/InitializationState.ts","../../../../src/context/PaymentSession.ts","../../../../src/context/Elements.ts","../../../../src/index.ts"],"sourcesContent":["import type { TurboModule } from 'react-native';\nimport { NativeModules, TurboModuleRegistry } from 'react-native';\n\nexport type CustomEndpoints = Object;\n\nexport interface SessionData {\n hyperswitchConfig: Object;\n paymentSessionConfig: { sdkAuthorization: string };\n configuration: Object;\n}\n\nexport interface SavedPaymentMethodsConfiguration {\n hiddenPaymentMethods?: string[];\n}\n\nexport interface Spec extends TurboModule {\n initialise(\n publishableKey: string,\n platformPublishableKey: string,\n profileId: string,\n environment: string,\n customEndpoints: CustomEndpoints\n ): Promise<string>;\n\n presentPaymentSheet(params: SessionData): Promise<string>;\n\n getCustomerSavedPaymentMethods(params?: SessionData): Promise<string>;\n\n getCustomerLastUsedPaymentMethodData(): Promise<string>;\n\n getCustomerDefaultSavedPaymentMethodData(): Promise<string>;\n\n getCustomerSavedPaymentMethodData(): Promise<string>;\n\n confirmWithCustomerLastUsedPaymentMethod(reactTag: number): Promise<string>;\n\n confirmWithCustomerDefaultPaymentMethod(reactTag: number): Promise<string>;\n\n confirmWithCustomerPaymentToken(reactTag: number, token: string): Promise<string>;\n}\n\n/**\n * Use `TurboModuleRegistry.get` first for new-arch TurboModules, and fall back\n * to `NativeModules` for legacy/old-arch support.\n */\nconst NativeHyperswitchModule =\n TurboModuleRegistry.get<Spec>('NativeHyperswitchModule') ??\n NativeModules.NativeHyperswitchModule;\nconsole.log('NativeHyperswitchModule', NativeHyperswitchModule);\nexport default NativeHyperswitchModule as Spec;\nexport { NativeHyperswitchModule };\n","import type {\n HyperswitchConfiguration,\n NativePaymentSheetPayload,\n} from '../types/definitions';\nimport type { PaymentSessionConfiguration } from '../types/definitions';\nimport { PaymentResult } from '../types/paymentresult';\n\nfunction buildPresentPaymentSheetPayload(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration,\n configuration: Record<string, unknown> = {},\n): NativePaymentSheetPayload {\n // platformPublishableKey is internal to the RN bridge; it is not part of the\n // merchant-facing hyperswitchConfig payload.\n const { platformPublishableKey: _platformPublishableKey, ...restConfig } =\n hyperswitchConfig;\n\n return {\n hyperswitchConfig: restConfig as Record<string, unknown>,\n paymentSessionConfig: paymentSessionConfig,\n configuration,\n };\n}\n\nfunction mapStatus(status: string): PaymentResult['type'] {\n switch (status) {\n case 'succeeded':\n case 'completed':\n case 'success':\n return 'completed';\n case 'cancelled':\n case 'canceled':\n return 'canceled';\n case 'failed':\n case 'error':\n default:\n return 'failed';\n }\n}\n\nexport { buildPresentPaymentSheetPayload, mapStatus };\n","import NativeHyperswitchModule from '../specs/NativeHyperswitchModule';\nimport {\n HyperswitchConfiguration,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport {\n CustomerSavedPaymentMethodsSession,\n CustomerLastUsedPaymentMethod,\n} from '../types/savedPaymentMethods';\nimport { buildPresentPaymentSheetPayload } from '../utils/LaunchOptions';\n\nfunction parsePaymentMethod(raw: string): CustomerLastUsedPaymentMethod {\n const parsed = JSON.parse(raw) as CustomerLastUsedPaymentMethod & {\n billing?: string | object | null;\n };\n if (parsed.billing && typeof parsed.billing === 'string') {\n try {\n parsed.billing = JSON.parse(parsed.billing);\n } catch {\n parsed.billing = null;\n }\n }\n return parsed as CustomerLastUsedPaymentMethod;\n}\n\nexport function createCustomerSavedPaymentMethodsSession(): CustomerSavedPaymentMethodsSession {\n return {\n async getCustomerLastUsedPaymentMethodData(): Promise<CustomerLastUsedPaymentMethod | null> {\n const raw =\n await NativeHyperswitchModule.getCustomerLastUsedPaymentMethodData();\n return parsePaymentMethod(raw);\n },\n\n async getCustomerDefaultSavedPaymentMethodData(): Promise<CustomerLastUsedPaymentMethod | null> {\n const raw =\n await NativeHyperswitchModule.getCustomerDefaultSavedPaymentMethodData();\n return parsePaymentMethod(raw);\n },\n\n async getCustomerSavedPaymentMethodData(): Promise<CustomerLastUsedPaymentMethod | null> {\n const raw =\n await NativeHyperswitchModule.getCustomerSavedPaymentMethodData();\n return parsePaymentMethod(raw);\n },\n\n async confirmWithCustomerLastUsedPaymentMethod(args?: {\n id?: string;\n }): Promise<any> {\n const raw = await NativeHyperswitchModule\n .confirmWithCustomerLastUsedPaymentMethod\n // args?.id\n ();\n // return mapNativeResponseToPaymentResult(raw);\n },\n\n async confirmWithCustomerDefaultPaymentMethod(args?: {\n id?: string;\n }): Promise<any> {\n const raw = await NativeHyperswitchModule\n .confirmWithCustomerDefaultPaymentMethod\n // args?.id\n ();\n // return mapNativeResponseToPaymentResult(raw);\n },\n };\n}\n\nexport async function getCustomerSavedPaymentMethods(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration,\n configuration?: Record<string, unknown>\n): Promise<CustomerSavedPaymentMethodsSession> {\n const payload = buildPresentPaymentSheetPayload(\n hyperswitchConfig,\n paymentSessionConfig,\n configuration\n );\n await NativeHyperswitchModule.getCustomerSavedPaymentMethods(payload);\n return createCustomerSavedPaymentMethodsSession();\n}\n","/**\n * Tracks whether the Hyperswitch SDK is currently initialising (or re-initialising\n * after a reload). presentPaymentSheet should be blocked while this flag is true\n * so the native SDK is not asked to open a sheet before it is ready.\n *\n * Also tracks whether a payment sheet is currently presented so that a hot-reload\n * (or any other code path) cannot stack a second sheet on top of an open one.\n */\n\nlet _isInitializing = false;\n\nexport function setInitializing(value: boolean): void {\n _isInitializing = value;\n}\n\nexport function isInitializing(): boolean {\n return _isInitializing;\n}\n\nlet _isSheetPresented = false;\n\nexport function setSheetPresented(value: boolean): void {\n _isSheetPresented = value;\n}\n\nexport function isSheetPresented(): boolean {\n return _isSheetPresented;\n}\n","import NativeHyperswitchModule from '../specs/NativeHyperswitchModule';\nimport type {\n HyperswitchConfiguration,\n NativePaymentSheetPayload,\n PaymentSession,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport { buildPresentPaymentSheetPayload } from '../utils/LaunchOptions';\nimport { getCustomerSavedPaymentMethods } from './SavedPaymentMethods';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { CustomerSavedPaymentMethodsSession } from '../types/savedPaymentMethods';\nimport { isInitializing, isSheetPresented, setSheetPresented } from '../utils/InitializationState';\n\ninterface NativeResponse {\n status: string;\n message: string;\n data?: any;\n}\n\nexport function parseNativeResponse(\n raw: string | NativeResponse\n): NativeResponse {\n if (typeof raw === 'object' && raw !== null) {\n return raw as NativeResponse;\n }\n try {\n return JSON.parse(raw as string) as NativeResponse;\n } catch {\n return { status: 'failed', message: String(raw) };\n }\n}\n\nexport function mapStatus(status: string): PaymentResult['type'] {\n switch (status) {\n case 'succeeded':\n case 'completed':\n case 'success':\n return 'completed';\n case 'cancelled':\n case 'canceled':\n return 'canceled';\n case 'failed':\n case 'error':\n default:\n return 'failed';\n }\n}\n\nexport function mapNativeResponseToPaymentResult(\n raw: string | NativeResponse\n): PaymentResult {\n const parsed = parseNativeResponse(raw);\n return {\n type: mapStatus(parsed.status),\n message: parsed.message,\n };\n}\n\nexport async function presentPaymentSheetWithPayload(\n payload: NativePaymentSheetPayload\n): Promise<PaymentResult> {\n if (isInitializing()) {\n return {\n type: 'failed',\n message: 'SDK is reloading. Please wait for initialisation to complete before presenting the payment sheet.',\n };\n }\n if (isSheetPresented()) {\n // A sheet is already open (e.g. a hot-reload fired while the sheet was visible).\n // Silently skip so the existing sheet is not covered by a new one.\n return {\n type: 'canceled',\n message: 'A payment sheet is already presented.',\n };\n }\n setSheetPresented(true);\n try {\n const raw = await NativeHyperswitchModule.presentPaymentSheet({\n hyperswitchConfig: payload.hyperswitchConfig,\n paymentSessionConfig: payload.paymentSessionConfig,\n configuration: payload.configuration,\n });\n return mapNativeResponseToPaymentResult(raw);\n } finally {\n setSheetPresented(false);\n }\n}\n\nexport async function updateIntent(\n _intentResolver: () => Promise<PaymentSessionConfiguration>\n): Promise<void> {\n}\n\nexport function createPaymentSession(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration\n): PaymentSession {\n return {\n async presentPaymentSheet(\n configuration?: Record<string, unknown>\n ): Promise<PaymentResult> {\n const payload = buildPresentPaymentSheetPayload(\n hyperswitchConfig,\n paymentSessionConfig,\n configuration\n );\n return presentPaymentSheetWithPayload(payload);\n },\n\n async getCustomerSavedPaymentMethods(\n configuration?: Record<string, unknown>\n ): Promise<CustomerSavedPaymentMethodsSession> {\n return getCustomerSavedPaymentMethods(\n hyperswitchConfig,\n paymentSessionConfig,\n configuration\n );\n },\n updateIntent,\n };\n}\n","import type {\n HyperswitchConfiguration,\n PaymentElementHandle,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport { buildPresentPaymentSheetPayload } from '../utils/LaunchOptions';\nimport {\n presentPaymentSheetWithPayload,\n updateIntent,\n} from '../context/PaymentSession';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { CustomerSavedPaymentMethodsSession } from '../types/savedPaymentMethods';\n\nimport { getCustomerSavedPaymentMethods } from './SavedPaymentMethods';\nimport { Elements } from '../types/elements';\n\ntype ElementsNativeActions = Pick<\n Elements,\n | 'confirmPayment'\n | 'presentPaymentSheet'\n | 'getCustomerSavedPaymentMethods'\n | 'updateIntent'\n>;\n\nexport function createElementsNativeActions(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration\n): ElementsNativeActions {\n return {\n async presentPaymentSheet(\n configuration?: Record<string, unknown>\n ): Promise<PaymentResult> {\n const payload = buildPresentPaymentSheetPayload(\n hyperswitchConfig,\n paymentSessionConfig,\n configuration\n );\n return presentPaymentSheetWithPayload(payload);\n },\n\n async confirmPayment(\n paymentElementRef: { current: PaymentElementHandle | null } | string,\n _confirmOptions?: { confirmParams?: Record<string, any> }\n ): Promise<any> {\n // if (typeof paymentElementRef === 'string') {\n // const result = await widgetConfirm(paymentElementRef);\n // return {\n // type: mapStatus(result.status),\n // message: result.message,\n // };\n // }\n // const ref = paymentElementRef.current;\n // if (!ref) {\n // throw new Error('PaymentElement reference is not mounted');\n // }\n // return ref.confirmPayment(_confirmOptions);\n },\n\n async getCustomerSavedPaymentMethods(\n configuration?: Record<string, unknown>\n ): Promise<CustomerSavedPaymentMethodsSession> {\n return getCustomerSavedPaymentMethods(\n hyperswitchConfig,\n paymentSessionConfig,\n configuration\n );\n },\n\n updateIntent: updateIntent,\n };\n}\n\nexport function createElements(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration\n): Elements {\n return {\n ...createElementsNativeActions(hyperswitchConfig, paymentSessionConfig),\n };\n}\n","import type {\n HyperswitchConfiguration,\n PaymentSession,\n PaymentSessionConfiguration,\n HyperswitchSession\n} from './types/definitions';\n\nexport type * from './types/definitions';\nexport type * from './types/elements';\nexport type * from './types/NativeModuleTypes';\nexport type * from './types/PaymentSheetConfiguration'\n\nimport NativeHyperswitchModule from './specs/NativeHyperswitchModule';\nimport { createPaymentSession } from './context/PaymentSession';\nimport { Elements } from './types/elements';\nimport { createElements } from './context/Elements';\nimport { setInitializing } from './utils/InitializationState';\n\nexport function loadHyper(\n config: HyperswitchConfiguration\n): Promise<HyperswitchSession> {\n setInitializing(true);\n return NativeHyperswitchModule.initialise(\n config.publishableKey,\n config.platformPublishableKey ?? '',\n config.profileId ?? '',\n config.environment ?? 'PROD',\n config.customEndpoints ?? {}\n ).then(() => {\n setInitializing(false);\n return {\n publishableKey: config.publishableKey,\n async initPaymentSession(\n options: PaymentSessionConfiguration\n ): Promise<PaymentSession> {\n return createPaymentSession(config, options);\n },\n async elements(options: PaymentSessionConfiguration): Promise<Elements> {\n return createElements(config, options);\n },\n }\n }).catch((error) => {\n setInitializing(false);\n console.error('Error initializing Hyperswitch SDK:', error);\n throw error;\n });\n\n}\n\n\nexport const Hyperswitch = {\n init: loadHyper,\n};"],"names":["NativeHyperswitchModule","TurboModuleRegistry","get","NativeModules","buildPresentPaymentSheetPayload","hyperswitchConfig","paymentSessionConfig","configuration","platformPublishableKey","_platformPublishableKey","restConfig","parsePaymentMethod","raw","parsed","JSON","parse","billing","async","getCustomerSavedPaymentMethods","payload","getCustomerLastUsedPaymentMethodData","getCustomerDefaultSavedPaymentMethodData","getCustomerSavedPaymentMethodData","confirmWithCustomerLastUsedPaymentMethod","args","confirmWithCustomerDefaultPaymentMethod","console","log","_isInitializing","setInitializing","value","_isSheetPresented","setSheetPresented","mapStatus","status","mapNativeResponseToPaymentResult","message","String","parseNativeResponse","type","presentPaymentSheetWithPayload","presentPaymentSheet","updateIntent","_intentResolver","createElementsNativeActions","confirmPayment","paymentElementRef","_confirmOptions","loadHyper","config","initialise","publishableKey","profileId","environment","customEndpoints","then","initPaymentSession","options","catch","error","Hyperswitch","init"],"mappings":"sEA6CA,MAAMA,EACJC,EAAoBC,IAAU,4BAC9BC,EAAcH,wBCxChB,SAASI,EACPC,EACAC,EACAC,EAAyC,CAAA,GAIzC,MAAQC,uBAAwBC,KAA4BC,GAC1DL,EAEF,MAAO,CACLA,kBAAmBK,EACnBJ,qBAAsBA,EACtBC,gBAEJ,CCXA,SAASI,EAAmBC,GAC1B,MAAMC,EAASC,KAAKC,MAAMH,GAG1B,GAAIC,EAAOG,SAAqC,iBAAnBH,EAAOG,QAClC,IACEH,EAAOG,QAAUF,KAAKC,MAAMF,EAAOG,QACrC,CAAE,MACAH,EAAOG,QAAU,IACnB,CAEF,OAAOH,CACT,CA4COI,eAAeC,EACpBb,EACAC,EACAC,GAEA,MAAMY,EAAUf,EACdC,EACAC,EACAC,GAGF,aADMP,EAAwBkB,+BAA+BC,GAnDtD,CACLF,qCAA0C,SAGjCN,QADCX,EAAwBoB,wCAIlCH,yCAA8C,SAGrCN,QADCX,EAAwBqB,4CAIlCJ,kCAAuC,SAG9BN,QADCX,EAAwBsB,qCAIlC,8CAAMC,CAAyCC,SAG3BxB,EACfuB,0CAIL,EAEA,6CAAME,CAAwCD,SAG1BxB,EACfyB,yCAIL,EAgBJ,CF/BAC,QAAQC,IAAI,0BAA2B3B,GGvCvC,IAAI4B,GAAkB,EAEhB,SAAUC,EAAgBC,GAC9BF,EAAkBE,CACpB,CAMA,IAAIC,GAAoB,EAElB,SAAUC,EAAkBF,GAChCC,EAAoBD,CACtB,CCSM,SAAUG,EAAUC,GACxB,OAAQA,GACN,IAAK,YACL,IAAK,YACL,IAAK,UACH,MAAO,YACT,IAAK,YACL,IAAK,WACH,MAAO,WAGT,QACE,MAAO,SAEb,CAEM,SAAUC,EACdvB,GAEA,MAAMC,EAhCF,SACJD,GAEA,GAAmB,iBAARA,GAA4B,OAARA,EAC7B,OAAOA,EAET,IACE,OAAOE,KAAKC,MAAMH,EACpB,CAAE,MACA,MAAO,CAAEsB,OAAQ,SAAUE,QAASC,OAAOzB,GAC7C,CACF,CAqBiB0B,CAAoB1B,GACnC,MAAO,CACL2B,KAAMN,EAAUpB,EAAOqB,QACvBE,QAASvB,EAAOuB,QAEpB,CAEOnB,eAAeuB,EACpBrB,GAEA,GD7COS,EC8CL,MAAO,CACLW,KAAM,SACNH,QAAS,qGAGb,GDzCOL,EC4CL,MAAO,CACLQ,KAAM,WACNH,QAAS,yCAGbJ,GAAkB,GAClB,IAME,OAAOG,QALWnC,EAAwByC,oBAAoB,CAC5DpC,kBAAmBc,EAAQd,kBAC3BC,qBAAsBa,EAAQb,qBAC9BC,cAAeY,EAAQZ,gBAG3B,SACEyB,GAAkB,EACpB,CACF,CAEOf,eAAeyB,EACpBC,GAEF,CCnEM,SAAUC,EACdvC,EACAC,GAEA,MAAO,CACLW,oBAAyB,MACvBV,GAOOiC,EALSpC,EACdC,EACAC,EACAC,IAKJ,oBAAMsC,CACJC,EACAC,GAcF,EAEA9B,+BAAoC,MAClCV,GAEOW,EACLb,EACAC,EACAC,GAIJmC,aAAcA,EAElB,CCpDM,SAAUM,EACdC,GAGA,OADApB,GAAgB,GACT7B,EAAwBkD,WAC7BD,EAAOE,eACPF,EAAOzC,wBAA0B,GACjCyC,EAAOG,WAAa,GACpBH,EAAOI,aAAe,OACtBJ,EAAOK,iBAAmB,CAAA,GAC1BC,KAAK,KACL1B,GAAgB,GACT,CACLsB,eAAgBF,EAAOE,eACvB,wBAAMK,CACJC,GAEA,OF2DNpD,EE3DkC4C,EF4DlC3C,EE5D0CmD,EF8DnC,CACLxC,oBAAyB,MACvBV,GAOOiC,EALSpC,EACdC,EACAC,EACAC,IAKJU,+BAAoC,MAClCV,GAEOW,EACLb,EACAC,EACAC,GAGJmC,gBAzBE,IACJrC,EACAC,CE3DI,EACAW,SAAc,MAACwC,IDuCZ,IACFb,ECvCuBK,EAAQQ,QAGjCC,MAAOC,IAGR,MAFA9B,GAAgB,GAChBH,QAAQiC,MAAM,sCAAuCA,GAC/CA,GAGV,CAGO,MAAMC,EAAc,CACzBC,KAAMb"}
@@ -0,0 +1,10 @@
1
+ export let overrides: ({
2
+ exclude: RegExp;
3
+ presets: string[];
4
+ include?: undefined;
5
+ } | {
6
+ include: RegExp;
7
+ presets: string[];
8
+ exclude?: undefined;
9
+ })[];
10
+ //# sourceMappingURL=babel.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"babel.config.d.ts","sourceRoot":"","sources":["../../babel.config.js"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("@eslint/config-helpers").Config[];
2
+ export default _default;
3
+ //# sourceMappingURL=eslint.config.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eslint.config.d.mts","sourceRoot":"","sources":["../../eslint.config.mjs"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ declare const _default: ({
2
+ input: string;
3
+ output: {
4
+ file: string;
5
+ format: string;
6
+ sourcemap: boolean;
7
+ exports: string;
8
+ };
9
+ external: string[];
10
+ plugins: import("rollup").Plugin<any>[];
11
+ } | {
12
+ input: string;
13
+ output: {
14
+ file: string;
15
+ format: string;
16
+ sourcemap: boolean;
17
+ exports?: undefined;
18
+ };
19
+ external: string[];
20
+ plugins: import("rollup").Plugin<any>[];
21
+ })[];
22
+ export default _default;
23
+ //# sourceMappingURL=rollup.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollup.config.d.ts","sourceRoot":"","sources":["../../rollup.config.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=bootstrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../scripts/bootstrap.js"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import type { HyperswitchConfiguration, PaymentSessionConfiguration } from '../types/definitions';
2
+ import { Elements } from '../types/elements';
3
+ type ElementsNativeActions = Pick<Elements, 'confirmPayment' | 'presentPaymentSheet' | 'getCustomerSavedPaymentMethods' | 'updateIntent'>;
4
+ export declare function createElementsNativeActions(hyperswitchConfig: HyperswitchConfiguration, paymentSessionConfig: PaymentSessionConfiguration): ElementsNativeActions;
5
+ export declare function createElements(hyperswitchConfig: HyperswitchConfiguration, paymentSessionConfig: PaymentSessionConfiguration): Elements;
6
+ export {};
7
+ //# sourceMappingURL=Elements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Elements.d.ts","sourceRoot":"","sources":["../../../../src/context/Elements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EAExB,2BAA2B,EAC5B,MAAM,sBAAsB,CAAC;AAU9B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,KAAK,qBAAqB,GAAG,IAAI,CAC/B,QAAQ,EACN,gBAAgB,GAChB,qBAAqB,GACrB,gCAAgC,GAChC,cAAc,CACjB,CAAC;AAEF,wBAAgB,2BAA2B,CACzC,iBAAiB,EAAE,wBAAwB,EAC3C,oBAAoB,EAAE,2BAA2B,GAChD,qBAAqB,CA2CvB;AAED,wBAAgB,cAAc,CAC5B,iBAAiB,EAAE,wBAAwB,EAC3C,oBAAoB,EAAE,2BAA2B,GAChD,QAAQ,CAIV"}
@@ -0,0 +1,23 @@
1
+ import { type ReactNode } from 'react';
2
+ import { PaymentSession } from '../types/definitions';
3
+ import { Elements, HyperswitchSession } from '../types/elements';
4
+ interface HyperElementsContext {
5
+ paymentSession: PaymentSession | null;
6
+ elements: Elements | null;
7
+ publishableKey: string | null;
8
+ sdkAuthorization: string | null;
9
+ loading: boolean;
10
+ error: Error | null;
11
+ }
12
+ declare const HyperElementsContext: import("react").Context<HyperElementsContext | undefined>;
13
+ export interface HyperElementsProps {
14
+ hyper: HyperswitchSession | Promise<HyperswitchSession> | null;
15
+ options: {
16
+ sdkAuthorization: string;
17
+ };
18
+ children: ReactNode;
19
+ }
20
+ export declare function HyperElements({ hyper, options, children }: HyperElementsProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function useHyperElementsContext(): HyperElementsContext;
22
+ export {};
23
+ //# sourceMappingURL=HyperElements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HyperElements.d.ts","sourceRoot":"","sources":["../../../../src/context/HyperElements.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,UAAU,oBAAoB;IAC5B,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,oBAAoB,2DAA6D,CAAC;AAIxF,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC;IAC/D,OAAO,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,kBAAkB,2CAiD7E;AAED,wBAAgB,uBAAuB,IAAI,oBAAoB,CAM9D"}
@@ -0,0 +1,15 @@
1
+ import type { HyperswitchConfiguration, NativePaymentSheetPayload, PaymentSession, PaymentSessionConfiguration } from '../types/definitions';
2
+ import type { PaymentResult } from '../types/paymentresult';
3
+ interface NativeResponse {
4
+ status: string;
5
+ message: string;
6
+ data?: any;
7
+ }
8
+ export declare function parseNativeResponse(raw: string | NativeResponse): NativeResponse;
9
+ export declare function mapStatus(status: string): PaymentResult['type'];
10
+ export declare function mapNativeResponseToPaymentResult(raw: string | NativeResponse): PaymentResult;
11
+ export declare function presentPaymentSheetWithPayload(payload: NativePaymentSheetPayload): Promise<PaymentResult>;
12
+ export declare function updateIntent(_intentResolver: () => Promise<PaymentSessionConfiguration>): Promise<void>;
13
+ export declare function createPaymentSession(hyperswitchConfig: HyperswitchConfiguration, paymentSessionConfig: PaymentSessionConfiguration): PaymentSession;
14
+ export {};
15
+ //# sourceMappingURL=PaymentSession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaymentSession.d.ts","sourceRoot":"","sources":["../../../../src/context/PaymentSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EACzB,cAAc,EACd,2BAA2B,EAC5B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5D,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,GAAG,cAAc,GAC3B,cAAc,CAShB;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAc/D;AAED,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,MAAM,GAAG,cAAc,GAC3B,aAAa,CAMf;AAED,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,aAAa,CAAC,CA0BxB;AAED,wBAAsB,YAAY,CAChC,eAAe,EAAE,MAAM,OAAO,CAAC,2BAA2B,CAAC,GAC1D,OAAO,CAAC,IAAI,CAAC,CACf;AAED,wBAAgB,oBAAoB,CAClC,iBAAiB,EAAE,wBAAwB,EAC3C,oBAAoB,EAAE,2BAA2B,GAChD,cAAc,CAwBhB"}
@@ -0,0 +1,5 @@
1
+ import { HyperswitchConfiguration, PaymentSessionConfiguration } from '../types/definitions';
2
+ import { CustomerSavedPaymentMethodsSession } from '../types/savedPaymentMethods';
3
+ export declare function createCustomerSavedPaymentMethodsSession(): CustomerSavedPaymentMethodsSession;
4
+ export declare function getCustomerSavedPaymentMethods(hyperswitchConfig: HyperswitchConfiguration, paymentSessionConfig: PaymentSessionConfiguration, configuration?: Record<string, unknown>): Promise<CustomerSavedPaymentMethodsSession>;
5
+ //# sourceMappingURL=SavedPaymentMethods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SavedPaymentMethods.d.ts","sourceRoot":"","sources":["../../../../src/context/SavedPaymentMethods.ts"],"names":[],"mappings":"AACA,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kCAAkC,EAEnC,MAAM,8BAA8B,CAAC;AAiBtC,wBAAgB,wCAAwC,IAAI,kCAAkC,CAwC7F;AAED,wBAAsB,8BAA8B,CAClD,iBAAiB,EAAE,wBAAwB,EAC3C,oBAAoB,EAAE,2BAA2B,EACjD,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACtC,OAAO,CAAC,kCAAkC,CAAC,CAQ7C"}
@@ -0,0 +1,8 @@
1
+ import type { paymentResult } from '../modules/NativeHyperswitchSdk';
2
+ export declare function registerWidget(widgetId: string, nativeViewId: number): void;
3
+ export declare function getWidget(widgetId: string): number | undefined;
4
+ export declare function unregisterWidget(widgetId: string): void;
5
+ export declare function confirmPayment(widgetId: string): Promise<paymentResult>;
6
+ export declare function updateIntentInitForAllWidgets(): Promise<paymentResult[]>;
7
+ export declare function updateIntentCompleteForAllWidgets(sdkAuthorization: string): Promise<paymentResult[]>;
8
+ //# sourceMappingURL=WidgetRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WidgetRegistry.d.ts","sourceRoot":"","sources":["../../../../src/context/WidgetRegistry.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAIrE,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAE3E;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE9D;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAkBvE;AAED,wBAAgB,6BAA6B,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAYxE;AAED,wBAAgB,iCAAiC,CAC/C,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,aAAa,EAAE,CAAC,CAgB1B"}