@juspay-tech/react-native-hyperswitch 0.2.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 (261) hide show
  1. package/HyperswitchSdkReactNative.podspec +31 -0
  2. package/android/build.gradle +119 -0
  3. package/android/gradle.properties +5 -0
  4. package/android/hyperswitch_autolinking.gradle +378 -0
  5. package/android/proguard-rules.pro +72 -0
  6. package/android/src/main/AndroidManifest.xml +25 -0
  7. package/android/src/main/assets/hyperswitch.bundle +1677 -0
  8. package/android/src/main/java/com/hyperswitchsdkreactnative/HyperswitchSdkReactNativePackage.kt +36 -0
  9. package/android/src/main/java/com/hyperswitchsdkreactnative/activity/RedirectActivity.kt +39 -0
  10. package/android/src/main/java/com/hyperswitchsdkreactnative/internal/DefaultReactHost.kt +314 -0
  11. package/android/src/main/java/com/hyperswitchsdkreactnative/internal/DefaultReactNativeHost.kt +131 -0
  12. package/android/src/main/java/com/hyperswitchsdkreactnative/internal/ReactDelegate.kt +423 -0
  13. package/android/src/main/java/com/hyperswitchsdkreactnative/internal/ReactFragment.kt +335 -0
  14. package/android/src/main/java/com/hyperswitchsdkreactnative/modules/HyperswitchSdkNativeModule.kt +143 -0
  15. package/android/src/main/java/com/hyperswitchsdkreactnative/modules/HyperswitchSdkReactNativeModule.kt +92 -0
  16. package/android/src/main/java/com/hyperswitchsdkreactnative/provider/HyperProvider.kt +269 -0
  17. package/android/src/main/java/com/hyperswitchsdkreactnative/views/GooglePayButtonView.kt +60 -0
  18. package/android/src/main/java/com/hyperswitchsdkreactnative/views/GooglePayButtonViewManager.kt +76 -0
  19. package/android/src/main/java/io/hyperswitch/hyperota/HyperOtaLogger.kt +122 -0
  20. package/android/src/main/java/io/hyperswitch/logs/CrashHandler.kt +29 -0
  21. package/android/src/main/java/io/hyperswitch/logs/Debouncer.kt +20 -0
  22. package/android/src/main/java/io/hyperswitch/logs/HyperLogManager.kt +113 -0
  23. package/android/src/main/java/io/hyperswitch/logs/LogData.kt +159 -0
  24. package/android/src/main/java/io/hyperswitch/logs/LogFileManager.kt +60 -0
  25. package/android/src/main/java/io/hyperswitch/networking/HyperNetworking.kt +73 -0
  26. package/android/src/main/java/io/hyperswitch/react/Utils.kt +23 -0
  27. package/android/src/main/res/values/attrs.xml +6 -0
  28. package/android/src/main/res/values/strings.xml +5 -0
  29. package/android/src/main/res/values/theme.xml +16 -0
  30. package/ios/Modules/HyperswitchModule.swift +61 -0
  31. package/ios/Modules/HyperswitchNativeModule.swift +113 -0
  32. package/ios/Modules/HyperswitchSdkNative.h +5 -0
  33. package/ios/Modules/HyperswitchSdkNative.mm +98 -0
  34. package/ios/Modules/HyperswitchSdkReactNative.h +5 -0
  35. package/ios/Modules/HyperswitchSdkReactNative.mm +53 -0
  36. package/ios/Views/ApplePayView.h +14 -0
  37. package/ios/Views/ApplePayView.mm +89 -0
  38. package/ios/hyperswitchSDK/Core/ApplePay/ApplePayHandler.swift +249 -0
  39. package/ios/hyperswitchSDK/Core/ApplePay/ApplePayViewManager.m +18 -0
  40. package/ios/hyperswitchSDK/Core/ApplePay/ApplePayViewManager.swift +123 -0
  41. package/ios/hyperswitchSDK/Core/HyperPaymentSheet/PaymentSheetView+SwiftUI.swift +49 -0
  42. package/ios/hyperswitchSDK/Core/HyperPaymentSheet/PaymentSheetView+UIKit.swift +49 -0
  43. package/ios/hyperswitchSDK/Core/HyperPaymentSheet/PaymentSheetView.swift +80 -0
  44. package/ios/hyperswitchSDK/Core/HyperSession/PaymentSession+UIKit.swift +176 -0
  45. package/ios/hyperswitchSDK/Core/HyperSession/PaymentSessionTypes.swift +121 -0
  46. package/ios/hyperswitchSDK/Core/Models/LogPayload.swift +53 -0
  47. package/ios/hyperswitchSDK/Core/NativeLogger/Debouncer.swift +37 -0
  48. package/ios/hyperswitchSDK/Core/NativeLogger/LogBuilder.swift +91 -0
  49. package/ios/hyperswitchSDK/Core/NativeLogger/LogFileManager.swift +75 -0
  50. package/ios/hyperswitchSDK/Core/NativeLogger/LogManager.swift +113 -0
  51. package/ios/hyperswitchSDK/Core/NativeModule/HyperHeadless.m +16 -0
  52. package/ios/hyperswitchSDK/Core/NativeModule/HyperHeadless.swift +74 -0
  53. package/ios/hyperswitchSDK/Core/NativeModule/HyperModule.m +28 -0
  54. package/ios/hyperswitchSDK/Core/NativeModule/HyperModule.swift +168 -0
  55. package/ios/hyperswitchSDK/Core/NativeModule/OTAServices.swift +113 -0
  56. package/ios/hyperswitchSDK/Core/NativeModule/RNHeadlessManager.swift +45 -0
  57. package/ios/hyperswitchSDK/Core/NativeModule/RNResponseHandler.swift +12 -0
  58. package/ios/hyperswitchSDK/Core/NativeModule/RNViewManager.swift +90 -0
  59. package/ios/hyperswitchSDK/Core/NativeModule/hyper-Bridging-Header.h +9 -0
  60. package/ios/hyperswitchSDK/Core/Resources/HyperOTA.plist +20 -0
  61. package/ios/hyperswitchSDK/Core/Resources/hyperswitch.bundle +1673 -0
  62. package/ios/hyperswitchSDK/Shared/APIClient.swift +21 -0
  63. package/ios/hyperswitchSDK/Shared/DictionaryConverter.swift +104 -0
  64. package/ios/hyperswitchSDK/Shared/Environment.swift +24 -0
  65. package/ios/hyperswitchSDK/Shared/Extensions.swift +31 -0
  66. package/ios/hyperswitchSDK/Shared/Helper.swift +16 -0
  67. package/ios/hyperswitchSDK/Shared/HyperNetworking.swift +137 -0
  68. package/ios/hyperswitchSDK/Shared/HyperParams.swift +44 -0
  69. package/ios/hyperswitchSDK/Shared/HyperUIViewController.swift +25 -0
  70. package/ios/hyperswitchSDK/Shared/PaymentSession.swift +43 -0
  71. package/ios/hyperswitchSDK/Shared/PaymentSheet.swift +30 -0
  72. package/ios/hyperswitchSDK/Shared/PaymentSheetAppearance.swift +264 -0
  73. package/ios/hyperswitchSDK/Shared/PaymentSheetConfiguration.swift +494 -0
  74. package/ios/hyperswitchSDK/Shared/SwiftUIManager.swift +28 -0
  75. package/ios/hyperswitchSDK/Shared/Version.swift +12 -0
  76. package/lib/bs/JuspayTechReactNativeHyperswitch.cmi +0 -0
  77. package/lib/bs/JuspayTechReactNativeHyperswitch.cmj +0 -0
  78. package/lib/bs/JuspayTechReactNativeHyperswitch.cmt +0 -0
  79. package/lib/bs/JuspayTechReactNativeHyperswitch.mlmap +5 -0
  80. package/lib/bs/build.ninja +29 -0
  81. package/lib/bs/install.ninja +25 -0
  82. package/lib/bs/src/context/HyperProvider-JuspayTechReactNativeHyperswitch.cmi +0 -0
  83. package/lib/bs/src/context/HyperProvider-JuspayTechReactNativeHyperswitch.cmj +0 -0
  84. package/lib/bs/src/context/HyperProvider-JuspayTechReactNativeHyperswitch.cmt +0 -0
  85. package/lib/bs/src/context/HyperProvider.ast +0 -0
  86. package/lib/bs/src/context/HyperProvider.d +1 -0
  87. package/lib/bs/src/hooks/useHyper-JuspayTechReactNativeHyperswitch.cmi +0 -0
  88. package/lib/bs/src/hooks/useHyper-JuspayTechReactNativeHyperswitch.cmj +0 -0
  89. package/lib/bs/src/hooks/useHyper-JuspayTechReactNativeHyperswitch.cmt +0 -0
  90. package/lib/bs/src/hooks/useHyper.ast +0 -0
  91. package/lib/bs/src/hooks/useHyper.d +1 -0
  92. package/lib/bs/src/modules/NativeHyperswitchSdk-JuspayTechReactNativeHyperswitch.cmi +0 -0
  93. package/lib/bs/src/modules/NativeHyperswitchSdk-JuspayTechReactNativeHyperswitch.cmj +0 -0
  94. package/lib/bs/src/modules/NativeHyperswitchSdk-JuspayTechReactNativeHyperswitch.cmt +0 -0
  95. package/lib/bs/src/modules/NativeHyperswitchSdk.ast +0 -0
  96. package/lib/bs/src/modules/NativeHyperswitchSdk.d +1 -0
  97. package/lib/bs/src/types/PaymentSheetConfiguration-JuspayTechReactNativeHyperswitch.cmi +0 -0
  98. package/lib/bs/src/types/PaymentSheetConfiguration-JuspayTechReactNativeHyperswitch.cmj +0 -0
  99. package/lib/bs/src/types/PaymentSheetConfiguration-JuspayTechReactNativeHyperswitch.cmt +0 -0
  100. package/lib/bs/src/types/PaymentSheetConfiguration.ast +0 -0
  101. package/lib/bs/src/types/PaymentSheetConfiguration.d +1 -0
  102. package/lib/commonjs/context/HyperProvider.gen.js +16 -0
  103. package/lib/commonjs/context/HyperProvider.gen.js.map +1 -0
  104. package/lib/commonjs/context/HyperProvider.res +78 -0
  105. package/lib/commonjs/context/HyperProvider.res.js +98 -0
  106. package/lib/commonjs/context/HyperProvider.res.js.map +1 -0
  107. package/lib/commonjs/hooks/useHyper.gen.js +15 -0
  108. package/lib/commonjs/hooks/useHyper.gen.js.map +1 -0
  109. package/lib/commonjs/hooks/useHyper.res +142 -0
  110. package/lib/commonjs/hooks/useHyper.res.js +152 -0
  111. package/lib/commonjs/hooks/useHyper.res.js.map +1 -0
  112. package/lib/commonjs/index.js +26 -0
  113. package/lib/commonjs/index.js.map +1 -0
  114. package/lib/commonjs/modules/NativeHyperswitchSdk.gen.js +6 -0
  115. package/lib/commonjs/modules/NativeHyperswitchSdk.gen.js.map +1 -0
  116. package/lib/commonjs/modules/NativeHyperswitchSdk.res +55 -0
  117. package/lib/commonjs/modules/NativeHyperswitchSdk.res.js +14 -0
  118. package/lib/commonjs/modules/NativeHyperswitchSdk.res.js.map +1 -0
  119. package/lib/commonjs/package.json +1 -0
  120. package/lib/commonjs/shims/Js.shim.js +2 -0
  121. package/lib/commonjs/shims/Js.shim.js.map +1 -0
  122. package/lib/commonjs/specs/ApplePayButtonNativeComponent.ts +11 -0
  123. package/lib/commonjs/specs/GooglePayButtonNativeComponent.android.js +10 -0
  124. package/lib/commonjs/specs/GooglePayButtonNativeComponent.android.js.map +1 -0
  125. package/lib/commonjs/specs/HyperswitchSdkReactNativeViewNativeComponent.ts +10 -0
  126. package/lib/commonjs/specs/NativeHyperswitchSdkNative.js +9 -0
  127. package/lib/commonjs/specs/NativeHyperswitchSdkNative.js.map +1 -0
  128. package/lib/commonjs/specs/NativeHyperswitchSdkReactNative.js +9 -0
  129. package/lib/commonjs/specs/NativeHyperswitchSdkReactNative.js.map +1 -0
  130. package/lib/commonjs/types/PaymentSheetConfiguration.gen.js +2 -0
  131. package/lib/commonjs/types/PaymentSheetConfiguration.gen.js.map +1 -0
  132. package/lib/commonjs/types/PaymentSheetConfiguration.res +215 -0
  133. package/lib/commonjs/types/PaymentSheetConfiguration.res.js +4 -0
  134. package/lib/commonjs/types/PaymentSheetConfiguration.res.js.map +1 -0
  135. package/lib/module/context/HyperProvider.gen.js +11 -0
  136. package/lib/module/context/HyperProvider.gen.js.map +1 -0
  137. package/lib/module/context/HyperProvider.res +78 -0
  138. package/lib/module/context/HyperProvider.res.js +91 -0
  139. package/lib/module/context/HyperProvider.res.js.map +1 -0
  140. package/lib/module/hooks/useHyper.gen.js +10 -0
  141. package/lib/module/hooks/useHyper.gen.js.map +1 -0
  142. package/lib/module/hooks/useHyper.res +142 -0
  143. package/lib/module/hooks/useHyper.res.js +142 -0
  144. package/lib/module/hooks/useHyper.res.js.map +1 -0
  145. package/lib/module/index.js +5 -0
  146. package/lib/module/index.js.map +1 -0
  147. package/lib/module/modules/NativeHyperswitchSdk.gen.js +4 -0
  148. package/lib/module/modules/NativeHyperswitchSdk.gen.js.map +1 -0
  149. package/lib/module/modules/NativeHyperswitchSdk.res +55 -0
  150. package/lib/module/modules/NativeHyperswitchSdk.res.js +9 -0
  151. package/lib/module/modules/NativeHyperswitchSdk.res.js.map +1 -0
  152. package/lib/module/package.json +1 -0
  153. package/lib/module/shims/Js.shim.js +2 -0
  154. package/lib/module/shims/Js.shim.js.map +1 -0
  155. package/lib/module/specs/ApplePayButtonNativeComponent.ts +11 -0
  156. package/lib/module/specs/GooglePayButtonNativeComponent.android.js +5 -0
  157. package/lib/module/specs/GooglePayButtonNativeComponent.android.js.map +1 -0
  158. package/lib/module/specs/HyperswitchSdkReactNativeViewNativeComponent.ts +10 -0
  159. package/lib/module/specs/NativeHyperswitchSdkNative.js +5 -0
  160. package/lib/module/specs/NativeHyperswitchSdkNative.js.map +1 -0
  161. package/lib/module/specs/NativeHyperswitchSdkReactNative.js +5 -0
  162. package/lib/module/specs/NativeHyperswitchSdkReactNative.js.map +1 -0
  163. package/lib/module/types/PaymentSheetConfiguration.gen.js +2 -0
  164. package/lib/module/types/PaymentSheetConfiguration.gen.js.map +1 -0
  165. package/lib/module/types/PaymentSheetConfiguration.res +215 -0
  166. package/lib/module/types/PaymentSheetConfiguration.res.js +4 -0
  167. package/lib/module/types/PaymentSheetConfiguration.res.js.map +1 -0
  168. package/lib/typescript/commonjs/babel.config.d.ts +10 -0
  169. package/lib/typescript/commonjs/babel.config.d.ts.map +1 -0
  170. package/lib/typescript/commonjs/eslint.config.d.mts +3 -0
  171. package/lib/typescript/commonjs/eslint.config.d.mts.map +1 -0
  172. package/lib/typescript/commonjs/package.json +1 -0
  173. package/lib/typescript/commonjs/scripts/bootstrap.d.ts +2 -0
  174. package/lib/typescript/commonjs/scripts/bootstrap.d.ts.map +1 -0
  175. package/lib/typescript/commonjs/src/context/HyperProvider.gen.d.ts +17 -0
  176. package/lib/typescript/commonjs/src/context/HyperProvider.gen.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/src/context/HyperProvider.res.d.ts +20 -0
  178. package/lib/typescript/commonjs/src/context/HyperProvider.res.d.ts.map +1 -0
  179. package/lib/typescript/commonjs/src/hooks/useHyper.gen.d.ts +10 -0
  180. package/lib/typescript/commonjs/src/hooks/useHyper.gen.d.ts.map +1 -0
  181. package/lib/typescript/commonjs/src/hooks/useHyper.res.d.ts +95 -0
  182. package/lib/typescript/commonjs/src/hooks/useHyper.res.d.ts.map +1 -0
  183. package/lib/typescript/commonjs/src/index.d.ts +4 -0
  184. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  185. package/lib/typescript/commonjs/src/modules/NativeHyperswitchSdk.gen.d.ts +24 -0
  186. package/lib/typescript/commonjs/src/modules/NativeHyperswitchSdk.gen.d.ts.map +1 -0
  187. package/lib/typescript/commonjs/src/modules/NativeHyperswitchSdk.res.d.ts +2 -0
  188. package/lib/typescript/commonjs/src/modules/NativeHyperswitchSdk.res.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/src/shims/Js.shim.d.ts +4 -0
  190. package/lib/typescript/commonjs/src/shims/Js.shim.d.ts.map +1 -0
  191. package/lib/typescript/commonjs/src/specs/ApplePayButtonNativeComponent.d.ts +10 -0
  192. package/lib/typescript/commonjs/src/specs/ApplePayButtonNativeComponent.d.ts.map +1 -0
  193. package/lib/typescript/commonjs/src/specs/GooglePayButtonNativeComponent.android.d.ts +11 -0
  194. package/lib/typescript/commonjs/src/specs/GooglePayButtonNativeComponent.android.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts +1 -0
  196. package/lib/typescript/commonjs/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts.map +1 -0
  197. package/lib/typescript/commonjs/src/specs/NativeHyperswitchSdkNative.d.ts +17 -0
  198. package/lib/typescript/commonjs/src/specs/NativeHyperswitchSdkNative.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/src/specs/NativeHyperswitchSdkReactNative.d.ts +9 -0
  200. package/lib/typescript/commonjs/src/specs/NativeHyperswitchSdkReactNative.d.ts.map +1 -0
  201. package/lib/typescript/commonjs/src/types/PaymentSheetConfiguration.gen.d.ts +149 -0
  202. package/lib/typescript/commonjs/src/types/PaymentSheetConfiguration.gen.d.ts.map +1 -0
  203. package/lib/typescript/commonjs/src/types/PaymentSheetConfiguration.res.d.ts +1 -0
  204. package/lib/typescript/commonjs/src/types/PaymentSheetConfiguration.res.d.ts.map +1 -0
  205. package/lib/typescript/module/babel.config.d.ts +10 -0
  206. package/lib/typescript/module/babel.config.d.ts.map +1 -0
  207. package/lib/typescript/module/eslint.config.d.mts +3 -0
  208. package/lib/typescript/module/eslint.config.d.mts.map +1 -0
  209. package/lib/typescript/module/package.json +1 -0
  210. package/lib/typescript/module/scripts/bootstrap.d.ts +2 -0
  211. package/lib/typescript/module/scripts/bootstrap.d.ts.map +1 -0
  212. package/lib/typescript/module/src/context/HyperProvider.gen.d.ts +17 -0
  213. package/lib/typescript/module/src/context/HyperProvider.gen.d.ts.map +1 -0
  214. package/lib/typescript/module/src/context/HyperProvider.res.d.ts +20 -0
  215. package/lib/typescript/module/src/context/HyperProvider.res.d.ts.map +1 -0
  216. package/lib/typescript/module/src/hooks/useHyper.gen.d.ts +10 -0
  217. package/lib/typescript/module/src/hooks/useHyper.gen.d.ts.map +1 -0
  218. package/lib/typescript/module/src/hooks/useHyper.res.d.ts +95 -0
  219. package/lib/typescript/module/src/hooks/useHyper.res.d.ts.map +1 -0
  220. package/lib/typescript/module/src/index.d.ts +4 -0
  221. package/lib/typescript/module/src/index.d.ts.map +1 -0
  222. package/lib/typescript/module/src/modules/NativeHyperswitchSdk.gen.d.ts +24 -0
  223. package/lib/typescript/module/src/modules/NativeHyperswitchSdk.gen.d.ts.map +1 -0
  224. package/lib/typescript/module/src/modules/NativeHyperswitchSdk.res.d.ts +2 -0
  225. package/lib/typescript/module/src/modules/NativeHyperswitchSdk.res.d.ts.map +1 -0
  226. package/lib/typescript/module/src/shims/Js.shim.d.ts +4 -0
  227. package/lib/typescript/module/src/shims/Js.shim.d.ts.map +1 -0
  228. package/lib/typescript/module/src/specs/ApplePayButtonNativeComponent.d.ts +10 -0
  229. package/lib/typescript/module/src/specs/ApplePayButtonNativeComponent.d.ts.map +1 -0
  230. package/lib/typescript/module/src/specs/GooglePayButtonNativeComponent.android.d.ts +11 -0
  231. package/lib/typescript/module/src/specs/GooglePayButtonNativeComponent.android.d.ts.map +1 -0
  232. package/lib/typescript/module/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts +1 -0
  233. package/lib/typescript/module/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts.map +1 -0
  234. package/lib/typescript/module/src/specs/NativeHyperswitchSdkNative.d.ts +17 -0
  235. package/lib/typescript/module/src/specs/NativeHyperswitchSdkNative.d.ts.map +1 -0
  236. package/lib/typescript/module/src/specs/NativeHyperswitchSdkReactNative.d.ts +9 -0
  237. package/lib/typescript/module/src/specs/NativeHyperswitchSdkReactNative.d.ts.map +1 -0
  238. package/lib/typescript/module/src/types/PaymentSheetConfiguration.gen.d.ts +149 -0
  239. package/lib/typescript/module/src/types/PaymentSheetConfiguration.gen.d.ts.map +1 -0
  240. package/lib/typescript/module/src/types/PaymentSheetConfiguration.res.d.ts +1 -0
  241. package/lib/typescript/module/src/types/PaymentSheetConfiguration.res.d.ts.map +1 -0
  242. package/package.json +196 -0
  243. package/src/context/HyperProvider.gen.tsx +26 -0
  244. package/src/context/HyperProvider.res +78 -0
  245. package/src/context/HyperProvider.res.js +112 -0
  246. package/src/hooks/useHyper.gen.tsx +18 -0
  247. package/src/hooks/useHyper.res +142 -0
  248. package/src/hooks/useHyper.res.js +157 -0
  249. package/src/index.tsx +13 -0
  250. package/src/modules/NativeHyperswitchSdk.gen.tsx +25 -0
  251. package/src/modules/NativeHyperswitchSdk.res +55 -0
  252. package/src/modules/NativeHyperswitchSdk.res.js +10 -0
  253. package/src/shims/Js.shim.ts +5 -0
  254. package/src/specs/ApplePayButtonNativeComponent.ts +11 -0
  255. package/src/specs/GooglePayButtonNativeComponent.android.ts +12 -0
  256. package/src/specs/HyperswitchSdkReactNativeViewNativeComponent.ts +10 -0
  257. package/src/specs/NativeHyperswitchSdkNative.ts +33 -0
  258. package/src/specs/NativeHyperswitchSdkReactNative.ts +17 -0
  259. package/src/types/PaymentSheetConfiguration.gen.tsx +202 -0
  260. package/src/types/PaymentSheetConfiguration.res +215 -0
  261. package/src/types/PaymentSheetConfiguration.res.js +2 -0
@@ -0,0 +1,264 @@
1
+ //
2
+ // PaymentSheetApperance.swift
3
+ // Hyperswitch
4
+ //
5
+ // Created by Harshit Srivastava on 09/11/23.
6
+ //
7
+
8
+ import UIKit
9
+
10
+ public extension PaymentSheet {
11
+
12
+ /// Describes the appearance of PaymentSheet
13
+ struct Appearance: Equatable, DictionaryConverter {
14
+ /// The default appearance for PaymentSheet
15
+ public static let `default` = Appearance()
16
+
17
+ /// Creates a `PaymentSheet.Appearance` with default values
18
+ public init() {}
19
+
20
+ /// Describes the appearance of fonts in PaymentSheet
21
+ public var font: Font = Font()
22
+
23
+ /// Describes the colors in PaymentSheet
24
+ public var colors: Colors = Colors()
25
+
26
+ /// Describes the appearance of the primary button (e.g., the "Pay" button)
27
+ public var primaryButton: PrimaryButton = PrimaryButton()
28
+
29
+ /// The corner radius used for buttons, inputs, tabs in PaymentSheet
30
+ /// - Note: The behavior of this property is consistent with the behavior of corner radius on `CALayer`
31
+ public var cornerRadius: CGFloat?
32
+
33
+ /// The border used for inputs and tabs in PaymentSheet
34
+ /// - Note: The behavior of this property is consistent with the behavior of border width on `CALayer`
35
+ public var borderWidth: CGFloat?
36
+
37
+ /// The shadow used for inputs and tabs in PaymentSheet
38
+ /// - Note: Set this to `.disabled` to disable shadows
39
+ public var shadow: Shadow?
40
+
41
+ public var theme: Theme?
42
+
43
+ public enum Theme {
44
+ case `default`
45
+ case light
46
+ case dark
47
+ case minimal
48
+ case flatMinimal
49
+
50
+ var themeLabel: String {
51
+ switch self {
52
+ case .`default`:
53
+ return "Default"
54
+ case .light:
55
+ return "Light"
56
+ case .dark:
57
+ return "Dark"
58
+ case .minimal:
59
+ return "Minimal"
60
+ case .flatMinimal:
61
+ return "FlatMinimal"
62
+ }
63
+ }
64
+ }
65
+
66
+ // MARK: Fonts
67
+
68
+ /// Describes the appearance of fonts in PaymentSheet
69
+ public struct Font: Equatable, DictionaryConverter {
70
+
71
+ /// Creates a `PaymentSheet.Appearance.Font` with default values
72
+ public init() {}
73
+
74
+ /// The scale factor for all font sizes in PaymentSheet.
75
+ /// Font sizes are multiplied by this value before being displayed. For example, setting this to 1.2 increases the size of all text by 20%.
76
+ /// - Note: This value must be greater than 0. The default value is 1.0.
77
+ /// - Note: This is used in conjunction with the Dynamic Type accessibility text size.
78
+ public var sizeScaleFactor: CGFloat?
79
+
80
+ /// The font family of this font is used throughout PaymentSheet. PaymentSheet uses this font at multiple weights (e.g., regular, medium, semibold) if they exist.
81
+ /// - Note: The size and weight of the font is ignored. To adjust font sizes, see `sizeScaleFactor`.
82
+ public var base: UIFont?
83
+
84
+ /// The size adjustment for all heading texts in PaymentSheet
85
+ /// Font sizes of all headings will be increased by this value from their respective default size
86
+ public var headingTextSizeAdjust: CGFloat?
87
+
88
+ /// The size for all sub heading texts in PaymentSheet
89
+ /// Font sizes of all sub headings will be increased by this value from their respective default size
90
+ public var subHeadingTextSizeAdjust: CGFloat?
91
+
92
+ /// The size for all placeholder texts in PaymentSheet
93
+ /// Font sizes of all placeholder texts will be increased by this value from their respective default size
94
+ public var placeholderTextSizeAdjust: CGFloat?
95
+
96
+ /// The size for all button texts in PaymentSheet
97
+ /// Font sizes of all button texts will be increased by this value from their respective default size
98
+ public var buttonTextSizeAdjust: CGFloat?
99
+
100
+ /// The size for all error texts in PaymentSheet
101
+ /// Font sizes of all error texts will be increased by this value from their respective default size
102
+ public var errorTextSizeAdjust: CGFloat?
103
+
104
+ /// The size for all link texts in PaymentSheet
105
+ /// Font sizes of all link texts will be increased by this value from their respective default size
106
+ public var linkTextSizeAdjust: CGFloat?
107
+
108
+ /// The size for all modal texts in PaymentSheet
109
+ /// Font sizes of all modal texts will be increased by this value from their respective default size
110
+ public var modalTextSizeAdjust: CGFloat?
111
+
112
+ /// The size for all card texts in PaymentSheet
113
+ /// Font sizes of all card texts will be increased by this value from their respective default size
114
+ public var cardTextSizeAdjust: CGFloat?
115
+
116
+ /// the font Attributes for PaymentSheetLite
117
+ public var family: String?
118
+ }
119
+
120
+ // MARK: Colors
121
+
122
+ /// Describes the colors in PaymentSheet
123
+ public struct Colors: Equatable, DictionaryConverter {
124
+
125
+ /// Creates a `PaymentSheet.Appearance.Colors` with default values
126
+ public init() {}
127
+
128
+ /// The primary color used throughout PaymentSheet
129
+ public var primary: UIColor?
130
+
131
+ /// The color used for the background of PaymentSheet
132
+ public var background: UIColor?
133
+
134
+ /// The color used for the background of inputs, tabs, and other components
135
+ public var componentBackground: UIColor?
136
+
137
+ /// The border color used for inputs, tabs, and other components
138
+ public var componentBorder: UIColor?
139
+
140
+ /// The color of the divider lines used inside inputs, tabs, and other components
141
+ public var componentDivider: UIColor?
142
+
143
+ /// The default text color used in PaymentSheet, appearing over the background color
144
+ public var text: UIColor?
145
+
146
+ /// The color used for text of secondary importance. For example, this color is used for the label above input fields
147
+ public var textSecondary: UIColor?
148
+
149
+ /// The color of text appearing over `componentBackground`
150
+ public var componentText: UIColor?
151
+
152
+ /// The color used for input placeholder text
153
+ public var componentPlaceholderText: UIColor?
154
+
155
+ /// The color used for icons in PaymentSheet, such as the close or back icons
156
+ public var icon: UIColor?
157
+
158
+ /// The color used to indicate errors or destructive actions in PaymentSheet
159
+ public var danger: UIColor?
160
+
161
+ /// The color used to indicate Loader Background Color
162
+ public var loaderBackground: UIColor?
163
+
164
+ /// The color used to indicate Loader Foreground Color
165
+ public var loaderForeground: UIColor?
166
+ }
167
+
168
+ // MARK: Shadow
169
+
170
+ /// Represents a shadow in PaymentSheet
171
+ public struct Shadow: Equatable, DictionaryConverter {
172
+
173
+ /// A pre-configured `Shadow` in the disabled or off state
174
+ public static var disabled: Shadow?
175
+
176
+ /// Color of the shadow
177
+ /// - Note: The behavior of this property is consistent with `CALayer.shadowColor`
178
+ public var color: UIColor?
179
+
180
+ /// Opacity or alpha of the shadow
181
+ /// - Note: The behavior of this property is consistent with `CALayer.shadowOpacity`
182
+ public var opacity: CGFloat?
183
+
184
+ /// Offset of the shadow
185
+ /// - Note: The behavior of this property is consistent with `CALayer.shadowOffset`
186
+ public var offset: CGSize?
187
+
188
+ /// Radius of the shadow
189
+ /// - Note: The behavior of this property is consistent with `CALayer.shadowRadius`
190
+ public var radius: CGFloat?
191
+
192
+ /// intensity of the shadow
193
+ /// - Note: The behavior of this property is consistent with `CALayer.shadowIntensity`
194
+ public var intensity: CGFloat?
195
+
196
+ /// Creates a `PaymentSheet.Appearance.Shadow` with default values
197
+ public init() {}
198
+
199
+ /// Creates a `Shadow` with the specified parameters
200
+ /// - Parameters:
201
+ /// - color: Color of the shadow
202
+ /// - opacity: Opacity or opacity of the shadow
203
+ /// - offset: Offset of the shadow
204
+ /// - radius: Radius of the shadow
205
+ /// - intensity: Intensity of the shadow
206
+ public init(color: UIColor?, opacity: CGFloat?, offset: CGSize?, radius: CGFloat?, intensity: CGFloat?) {
207
+ self.color = color
208
+ self.opacity = opacity
209
+ self.offset = offset
210
+ self.radius = radius
211
+ self.intensity = intensity
212
+ }
213
+ }
214
+
215
+ // MARK: Primary Button
216
+
217
+ /// Describes the appearance of the primary button (e.g., the "Pay" button)
218
+ public struct PrimaryButton: Equatable, DictionaryConverter {
219
+
220
+ /// Creates a `PaymentSheet.Appearance.PrimaryButton` with default values
221
+ public init() {}
222
+
223
+ /// The background color of the primary button
224
+ /// - Note: If `nil`, `appearance.colors.primary` will be used as the primary button background color
225
+ public var backgroundColor: UIColor?
226
+
227
+ /// The text color of the primary button
228
+ /// - Note: If `nil`, defaults to either white or black depending on the color of the button
229
+ public var textColor: UIColor?
230
+
231
+ /// The background color of the primary button when in a success state.
232
+ /// - Note: Only applies to PaymentSheet. The primary button transitions to the success state when payment succeeds.
233
+ public var successBackgroundColor: UIColor?
234
+
235
+ /// The text color of the primary button when in a success state.
236
+ /// - Note: Only applies to PaymentSheet. The primary button transitions to the success state when payment succeeds.
237
+ /// - Note: If `nil`, defaults to `textColor`
238
+ public var successTextColor: UIColor?
239
+
240
+ /// The corner radius of the primary button
241
+ /// - Note: If `nil`, `appearance.cornerRadius` will be used as the primary button corner radius
242
+ /// - Note: The behavior of this property is consistent with the behavior of corner radius on `CALayer`
243
+ public var cornerRadius: CGFloat?
244
+
245
+ /// The border color of the primary button
246
+ /// - Note: The behavior of this property is consistent with the behavior of border color on `CALayer`
247
+ public var borderColor: UIColor?
248
+
249
+ /// The border width of the primary button
250
+ /// - Note: The behavior of this property is consistent with the behavior of border width on `CALayer`
251
+ public var borderWidth: CGFloat?
252
+
253
+ /// The font used for the text of the primary button
254
+ /// - Note: If `nil`, `appearance.font.base` will be used as the primary button font
255
+ /// - Note: `appearance.font.sizeScaleFactor` does not impact the size of this font
256
+ public var font: UIFont?
257
+
258
+ /// The shadow of the primary button
259
+ /// - Note: If `nil`, `appearance.shadow` will be used as the primary button shadow
260
+ public var shadow: Shadow?
261
+ }
262
+ }
263
+
264
+ }