@swichpay/react-native 0.0.0-stage → 1.0.0

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 (277) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/LICENSE +21 -0
  3. package/README.md +82 -2
  4. package/docs/checkouts.md +98 -0
  5. package/docs/getting-started.md +140 -0
  6. package/docs/going-live.md +45 -0
  7. package/docs/own-screen.md +81 -0
  8. package/docs/results-and-errors.md +75 -0
  9. package/docs/server.md +163 -0
  10. package/docs/troubleshooting.md +57 -0
  11. package/lib/commonjs/HostedCheckout.js +115 -0
  12. package/lib/commonjs/checkout-webview.js +85 -0
  13. package/lib/commonjs/checkouts/PaymentSheet.js +1317 -0
  14. package/lib/commonjs/checkouts/direct.js +671 -0
  15. package/lib/commonjs/context.js +64 -0
  16. package/lib/commonjs/core/api/direct-payment-api.js +425 -0
  17. package/lib/commonjs/core/api/discount-api.js +19 -0
  18. package/lib/commonjs/core/api/gateway-api.js +366 -0
  19. package/lib/commonjs/core/api/payments-api.js +79 -0
  20. package/lib/commonjs/core/api/repositories.js +5 -0
  21. package/lib/commonjs/core/assets/images.js +12 -0
  22. package/lib/commonjs/core/assets/method-logos.js +19 -0
  23. package/lib/commonjs/core/assets/pwa-images.js +13 -0
  24. package/lib/commonjs/core/browser/clipboard.js +30 -0
  25. package/lib/commonjs/core/browser/dom.js +71 -0
  26. package/lib/commonjs/core/browser/hosted-checkout.js +107 -0
  27. package/lib/commonjs/core/browser/index.js +119 -0
  28. package/lib/commonjs/core/browser/qr.js +109 -0
  29. package/lib/commonjs/core/browser/three-ds.js +151 -0
  30. package/lib/commonjs/core/client.js +344 -0
  31. package/lib/commonjs/core/config.js +132 -0
  32. package/lib/commonjs/core/environment.js +34 -0
  33. package/lib/commonjs/core/errors.js +138 -0
  34. package/lib/commonjs/core/events.js +57 -0
  35. package/lib/commonjs/core/flows/controller.js +106 -0
  36. package/lib/commonjs/core/flows/countdown.js +41 -0
  37. package/lib/commonjs/core/flows/direct-bank-transfer.js +236 -0
  38. package/lib/commonjs/core/flows/direct-card.js +354 -0
  39. package/lib/commonjs/core/flows/direct-ewallet.js +124 -0
  40. package/lib/commonjs/core/flows/direct-one-bill.js +172 -0
  41. package/lib/commonjs/core/flows/direct-qr.js +109 -0
  42. package/lib/commonjs/core/flows/direct-rtp.js +302 -0
  43. package/lib/commonjs/core/flows/discount-lookup.js +80 -0
  44. package/lib/commonjs/core/flows/headless.js +94 -0
  45. package/lib/commonjs/core/flows/payment-sheet.js +1321 -0
  46. package/lib/commonjs/core/flows/services.js +31 -0
  47. package/lib/commonjs/core/flows/shared.js +90 -0
  48. package/lib/commonjs/core/http/api-client.js +208 -0
  49. package/lib/commonjs/core/http/endpoints.js +61 -0
  50. package/lib/commonjs/core/http/token-manager.js +46 -0
  51. package/lib/commonjs/core/http/transport.js +134 -0
  52. package/lib/commonjs/core/index.js +688 -0
  53. package/lib/commonjs/core/models/category.js +113 -0
  54. package/lib/commonjs/core/models/discount.js +51 -0
  55. package/lib/commonjs/core/models/payment.js +95 -0
  56. package/lib/commonjs/core/models/session.js +131 -0
  57. package/lib/commonjs/core/server/index.js +64 -0
  58. package/lib/commonjs/core/server/node.js +60 -0
  59. package/lib/commonjs/core/server/proxy.js +194 -0
  60. package/lib/commonjs/core/server/verify.js +122 -0
  61. package/lib/commonjs/core/swichpay.js +72 -0
  62. package/lib/commonjs/core/utils/crypto.js +78 -0
  63. package/lib/commonjs/core/utils/formatters.js +68 -0
  64. package/lib/commonjs/core/utils/json.js +110 -0
  65. package/lib/commonjs/core/utils/log.js +75 -0
  66. package/lib/commonjs/core/utils/runtime.js +34 -0
  67. package/lib/commonjs/core/utils/validators.js +59 -0
  68. package/lib/commonjs/hooks.js +77 -0
  69. package/lib/commonjs/index.js +203 -0
  70. package/lib/commonjs/package.json +1 -0
  71. package/lib/commonjs/polyfills.js +3 -0
  72. package/lib/commonjs/presenter.js +61 -0
  73. package/lib/commonjs/provider.js +192 -0
  74. package/lib/commonjs/swichpay.js +192 -0
  75. package/lib/commonjs/theme.js +54 -0
  76. package/lib/commonjs/ui.js +1142 -0
  77. package/lib/commonjs/webviews.js +279 -0
  78. package/lib/module/HostedCheckout.js +111 -0
  79. package/lib/module/checkout-webview.js +83 -0
  80. package/lib/module/checkouts/PaymentSheet.js +1313 -0
  81. package/lib/module/checkouts/direct.js +661 -0
  82. package/lib/module/context.js +58 -0
  83. package/lib/module/core/api/direct-payment-api.js +413 -0
  84. package/lib/module/core/api/discount-api.js +14 -0
  85. package/lib/module/core/api/gateway-api.js +358 -0
  86. package/lib/module/core/api/payments-api.js +73 -0
  87. package/lib/module/core/api/repositories.js +3 -0
  88. package/lib/module/core/assets/images.js +8 -0
  89. package/lib/module/core/assets/method-logos.js +15 -0
  90. package/lib/module/core/assets/pwa-images.js +9 -0
  91. package/lib/module/core/browser/clipboard.js +27 -0
  92. package/lib/module/core/browser/dom.js +63 -0
  93. package/lib/module/core/browser/hosted-checkout.js +102 -0
  94. package/lib/module/core/browser/index.js +12 -0
  95. package/lib/module/core/browser/qr.js +100 -0
  96. package/lib/module/core/browser/three-ds.js +145 -0
  97. package/lib/module/core/client.js +338 -0
  98. package/lib/module/core/config.js +128 -0
  99. package/lib/module/core/environment.js +29 -0
  100. package/lib/module/core/errors.js +125 -0
  101. package/lib/module/core/events.js +51 -0
  102. package/lib/module/core/flows/controller.js +101 -0
  103. package/lib/module/core/flows/countdown.js +36 -0
  104. package/lib/module/core/flows/direct-bank-transfer.js +231 -0
  105. package/lib/module/core/flows/direct-card.js +349 -0
  106. package/lib/module/core/flows/direct-ewallet.js +119 -0
  107. package/lib/module/core/flows/direct-one-bill.js +167 -0
  108. package/lib/module/core/flows/direct-qr.js +104 -0
  109. package/lib/module/core/flows/direct-rtp.js +297 -0
  110. package/lib/module/core/flows/discount-lookup.js +75 -0
  111. package/lib/module/core/flows/headless.js +90 -0
  112. package/lib/module/core/flows/payment-sheet.js +1315 -0
  113. package/lib/module/core/flows/services.js +27 -0
  114. package/lib/module/core/flows/shared.js +78 -0
  115. package/lib/module/core/http/api-client.js +203 -0
  116. package/lib/module/core/http/endpoints.js +57 -0
  117. package/lib/module/core/http/token-manager.js +41 -0
  118. package/lib/module/core/http/transport.js +126 -0
  119. package/lib/module/core/index.js +52 -0
  120. package/lib/module/core/models/category.js +104 -0
  121. package/lib/module/core/models/discount.js +46 -0
  122. package/lib/module/core/models/payment.js +89 -0
  123. package/lib/module/core/models/session.js +120 -0
  124. package/lib/module/core/server/index.js +11 -0
  125. package/lib/module/core/server/node.js +56 -0
  126. package/lib/module/core/server/proxy.js +191 -0
  127. package/lib/module/core/server/verify.js +115 -0
  128. package/lib/module/core/swichpay.js +68 -0
  129. package/lib/module/core/utils/crypto.js +72 -0
  130. package/lib/module/core/utils/formatters.js +56 -0
  131. package/lib/module/core/utils/json.js +94 -0
  132. package/lib/module/core/utils/log.js +67 -0
  133. package/lib/module/core/utils/runtime.js +28 -0
  134. package/lib/module/core/utils/validators.js +54 -0
  135. package/lib/module/hooks.js +72 -0
  136. package/lib/module/index.js +36 -0
  137. package/lib/module/polyfills.js +4 -0
  138. package/lib/module/presenter.js +58 -0
  139. package/lib/module/provider.js +188 -0
  140. package/lib/module/swichpay.js +187 -0
  141. package/lib/module/theme.js +50 -0
  142. package/lib/module/ui.js +1116 -0
  143. package/lib/module/webviews.js +272 -0
  144. package/lib/typescript/commonjs/HostedCheckout.d.ts +17 -0
  145. package/lib/typescript/commonjs/checkout-webview.d.ts +14 -0
  146. package/lib/typescript/commonjs/checkouts/PaymentSheet.d.ts +14 -0
  147. package/lib/typescript/commonjs/checkouts/direct.d.ts +18 -0
  148. package/lib/typescript/commonjs/context.d.ts +20 -0
  149. package/lib/typescript/commonjs/core/api/direct-payment-api.d.ts +103 -0
  150. package/lib/typescript/commonjs/core/api/discount-api.d.ts +10 -0
  151. package/lib/typescript/commonjs/core/api/gateway-api.d.ts +150 -0
  152. package/lib/typescript/commonjs/core/api/payments-api.d.ts +22 -0
  153. package/lib/typescript/commonjs/core/api/repositories.d.ts +86 -0
  154. package/lib/typescript/commonjs/core/assets/images.d.ts +5 -0
  155. package/lib/typescript/commonjs/core/assets/method-logos.d.ts +12 -0
  156. package/lib/typescript/commonjs/core/assets/pwa-images.d.ts +7 -0
  157. package/lib/typescript/commonjs/core/browser/clipboard.d.ts +3 -0
  158. package/lib/typescript/commonjs/core/browser/dom.d.ts +11 -0
  159. package/lib/typescript/commonjs/core/browser/hosted-checkout.d.ts +27 -0
  160. package/lib/typescript/commonjs/core/browser/index.d.ts +11 -0
  161. package/lib/typescript/commonjs/core/browser/qr.d.ts +18 -0
  162. package/lib/typescript/commonjs/core/browser/three-ds.d.ts +45 -0
  163. package/lib/typescript/commonjs/core/client.d.ts +181 -0
  164. package/lib/typescript/commonjs/core/config.d.ts +86 -0
  165. package/lib/typescript/commonjs/core/environment.d.ts +22 -0
  166. package/lib/typescript/commonjs/core/errors.d.ts +78 -0
  167. package/lib/typescript/commonjs/core/events.d.ts +19 -0
  168. package/lib/typescript/commonjs/core/flows/controller.d.ts +41 -0
  169. package/lib/typescript/commonjs/core/flows/countdown.d.ts +15 -0
  170. package/lib/typescript/commonjs/core/flows/direct-bank-transfer.d.ts +49 -0
  171. package/lib/typescript/commonjs/core/flows/direct-card.d.ts +94 -0
  172. package/lib/typescript/commonjs/core/flows/direct-ewallet.d.ts +39 -0
  173. package/lib/typescript/commonjs/core/flows/direct-one-bill.d.ts +38 -0
  174. package/lib/typescript/commonjs/core/flows/direct-qr.d.ts +25 -0
  175. package/lib/typescript/commonjs/core/flows/direct-rtp.d.ts +72 -0
  176. package/lib/typescript/commonjs/core/flows/discount-lookup.d.ts +37 -0
  177. package/lib/typescript/commonjs/core/flows/headless.d.ts +38 -0
  178. package/lib/typescript/commonjs/core/flows/payment-sheet.d.ts +263 -0
  179. package/lib/typescript/commonjs/core/flows/services.d.ts +22 -0
  180. package/lib/typescript/commonjs/core/flows/shared.d.ts +40 -0
  181. package/lib/typescript/commonjs/core/http/api-client.d.ts +37 -0
  182. package/lib/typescript/commonjs/core/http/endpoints.d.ts +39 -0
  183. package/lib/typescript/commonjs/core/http/token-manager.d.ts +19 -0
  184. package/lib/typescript/commonjs/core/http/transport.d.ts +37 -0
  185. package/lib/typescript/commonjs/core/index.d.ts +42 -0
  186. package/lib/typescript/commonjs/core/models/category.d.ts +35 -0
  187. package/lib/typescript/commonjs/core/models/discount.d.ts +41 -0
  188. package/lib/typescript/commonjs/core/models/payment.d.ts +104 -0
  189. package/lib/typescript/commonjs/core/models/session.d.ts +87 -0
  190. package/lib/typescript/commonjs/core/server/index.d.ts +10 -0
  191. package/lib/typescript/commonjs/core/server/node.d.ts +19 -0
  192. package/lib/typescript/commonjs/core/server/proxy.d.ts +30 -0
  193. package/lib/typescript/commonjs/core/server/verify.d.ts +61 -0
  194. package/lib/typescript/commonjs/core/swichpay.d.ts +40 -0
  195. package/lib/typescript/commonjs/core/utils/crypto.d.ts +19 -0
  196. package/lib/typescript/commonjs/core/utils/formatters.d.ts +19 -0
  197. package/lib/typescript/commonjs/core/utils/json.d.ts +27 -0
  198. package/lib/typescript/commonjs/core/utils/log.d.ts +15 -0
  199. package/lib/typescript/commonjs/core/utils/runtime.d.ts +12 -0
  200. package/lib/typescript/commonjs/core/utils/validators.d.ts +23 -0
  201. package/lib/typescript/commonjs/hooks.d.ts +21 -0
  202. package/lib/typescript/commonjs/index.d.ts +26 -0
  203. package/lib/typescript/commonjs/package.json +1 -0
  204. package/lib/typescript/commonjs/polyfills.d.ts +2 -0
  205. package/lib/typescript/commonjs/presenter.d.ts +25 -0
  206. package/lib/typescript/commonjs/provider.d.ts +22 -0
  207. package/lib/typescript/commonjs/swichpay.d.ts +125 -0
  208. package/lib/typescript/commonjs/theme.d.ts +52 -0
  209. package/lib/typescript/commonjs/ui.d.ts +583 -0
  210. package/lib/typescript/commonjs/webviews.d.ts +40 -0
  211. package/lib/typescript/module/HostedCheckout.d.ts +17 -0
  212. package/lib/typescript/module/checkout-webview.d.ts +14 -0
  213. package/lib/typescript/module/checkouts/PaymentSheet.d.ts +14 -0
  214. package/lib/typescript/module/checkouts/direct.d.ts +18 -0
  215. package/lib/typescript/module/context.d.ts +20 -0
  216. package/lib/typescript/module/core/api/direct-payment-api.d.ts +103 -0
  217. package/lib/typescript/module/core/api/discount-api.d.ts +10 -0
  218. package/lib/typescript/module/core/api/gateway-api.d.ts +150 -0
  219. package/lib/typescript/module/core/api/payments-api.d.ts +22 -0
  220. package/lib/typescript/module/core/api/repositories.d.ts +86 -0
  221. package/lib/typescript/module/core/assets/images.d.ts +5 -0
  222. package/lib/typescript/module/core/assets/method-logos.d.ts +12 -0
  223. package/lib/typescript/module/core/assets/pwa-images.d.ts +7 -0
  224. package/lib/typescript/module/core/browser/clipboard.d.ts +3 -0
  225. package/lib/typescript/module/core/browser/dom.d.ts +11 -0
  226. package/lib/typescript/module/core/browser/hosted-checkout.d.ts +27 -0
  227. package/lib/typescript/module/core/browser/index.d.ts +11 -0
  228. package/lib/typescript/module/core/browser/qr.d.ts +18 -0
  229. package/lib/typescript/module/core/browser/three-ds.d.ts +45 -0
  230. package/lib/typescript/module/core/client.d.ts +181 -0
  231. package/lib/typescript/module/core/config.d.ts +86 -0
  232. package/lib/typescript/module/core/environment.d.ts +22 -0
  233. package/lib/typescript/module/core/errors.d.ts +78 -0
  234. package/lib/typescript/module/core/events.d.ts +19 -0
  235. package/lib/typescript/module/core/flows/controller.d.ts +41 -0
  236. package/lib/typescript/module/core/flows/countdown.d.ts +15 -0
  237. package/lib/typescript/module/core/flows/direct-bank-transfer.d.ts +49 -0
  238. package/lib/typescript/module/core/flows/direct-card.d.ts +94 -0
  239. package/lib/typescript/module/core/flows/direct-ewallet.d.ts +39 -0
  240. package/lib/typescript/module/core/flows/direct-one-bill.d.ts +38 -0
  241. package/lib/typescript/module/core/flows/direct-qr.d.ts +25 -0
  242. package/lib/typescript/module/core/flows/direct-rtp.d.ts +72 -0
  243. package/lib/typescript/module/core/flows/discount-lookup.d.ts +37 -0
  244. package/lib/typescript/module/core/flows/headless.d.ts +38 -0
  245. package/lib/typescript/module/core/flows/payment-sheet.d.ts +263 -0
  246. package/lib/typescript/module/core/flows/services.d.ts +22 -0
  247. package/lib/typescript/module/core/flows/shared.d.ts +40 -0
  248. package/lib/typescript/module/core/http/api-client.d.ts +37 -0
  249. package/lib/typescript/module/core/http/endpoints.d.ts +39 -0
  250. package/lib/typescript/module/core/http/token-manager.d.ts +19 -0
  251. package/lib/typescript/module/core/http/transport.d.ts +37 -0
  252. package/lib/typescript/module/core/index.d.ts +42 -0
  253. package/lib/typescript/module/core/models/category.d.ts +35 -0
  254. package/lib/typescript/module/core/models/discount.d.ts +41 -0
  255. package/lib/typescript/module/core/models/payment.d.ts +104 -0
  256. package/lib/typescript/module/core/models/session.d.ts +87 -0
  257. package/lib/typescript/module/core/server/index.d.ts +10 -0
  258. package/lib/typescript/module/core/server/node.d.ts +19 -0
  259. package/lib/typescript/module/core/server/proxy.d.ts +30 -0
  260. package/lib/typescript/module/core/server/verify.d.ts +61 -0
  261. package/lib/typescript/module/core/swichpay.d.ts +40 -0
  262. package/lib/typescript/module/core/utils/crypto.d.ts +19 -0
  263. package/lib/typescript/module/core/utils/formatters.d.ts +19 -0
  264. package/lib/typescript/module/core/utils/json.d.ts +27 -0
  265. package/lib/typescript/module/core/utils/log.d.ts +15 -0
  266. package/lib/typescript/module/core/utils/runtime.d.ts +12 -0
  267. package/lib/typescript/module/core/utils/validators.d.ts +23 -0
  268. package/lib/typescript/module/hooks.d.ts +21 -0
  269. package/lib/typescript/module/index.d.ts +26 -0
  270. package/lib/typescript/module/polyfills.d.ts +2 -0
  271. package/lib/typescript/module/presenter.d.ts +25 -0
  272. package/lib/typescript/module/provider.d.ts +22 -0
  273. package/lib/typescript/module/swichpay.d.ts +125 -0
  274. package/lib/typescript/module/theme.d.ts +52 -0
  275. package/lib/typescript/module/ui.d.ts +583 -0
  276. package/lib/typescript/module/webviews.d.ts +40 -0
  277. package/package.json +129 -4
@@ -0,0 +1,1317 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PaymentSheet = PaymentSheet;
7
+ var _reactNative = require("react-native");
8
+ var _index = require("../core/index.js");
9
+ var _methodLogos = require("../core/assets/method-logos.js");
10
+ var _context = require("../context.js");
11
+ var _hooks = require("../hooks.js");
12
+ var _theme = require("../theme.js");
13
+ var _ui = require("../ui.js");
14
+ var _webviews = require("../webviews.js");
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
+ /** Soft page background behind the white cards (Swich payment page style). */
17
+ const PAGE_BG = '#f4f6fb';
18
+ /** The built-in payment sheet. */
19
+ function PaymentSheet(props) {
20
+ const client = (0, _context.useSwichPayClient)();
21
+ const services = (0, _context.useFlowServices)(props.services);
22
+ const onFinish = (0, _hooks.useLatest)(props.onFinish);
23
+ const [c, s] = (0, _hooks.useController)(() => new _index.PaymentSheetController(client, {
24
+ details: props.details,
25
+ categories: props.categories ?? null,
26
+ onFinish: r => onFinish.current(r),
27
+ services,
28
+ timing: props.timing
29
+ }), ctrl => void ctrl.start());
30
+ (0, _context.useDismissHandler)(() => c.dismiss());
31
+ if (s.phase === 'loading') {
32
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
33
+ style: styles.center,
34
+ accessibilityRole: "progressbar",
35
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Spinner, {
36
+ dark: true,
37
+ large: true,
38
+ label: "Starting checkout"
39
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
40
+ style: styles.muted,
41
+ children: "Starting secure checkout..."
42
+ })]
43
+ });
44
+ }
45
+ if (s.phase === 'startupError') {
46
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
47
+ style: styles.fill,
48
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.ConfirmDialog, {
49
+ icon: "!",
50
+ title: "Unable to start checkout",
51
+ text: s.startupError ?? '',
52
+ confirmLabel: "OK",
53
+ onConfirm: () => c.dismissStartupError()
54
+ })
55
+ });
56
+ }
57
+ if (s.phase === 'success') return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.SuccessView, {});
58
+ if (s.phase === 'expired') {
59
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.StatusScreen, {
60
+ icon: "\u23F1",
61
+ title: "Session Expired",
62
+ text: "Your payment session has expired. Please initiate a new payment request.",
63
+ buttonLabel: "Return to Merchant",
64
+ onButton: () => c.returnToMerchant()
65
+ });
66
+ }
67
+ if (s.phase === 'declined') {
68
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.StatusScreen, {
69
+ title: "Payment declined",
70
+ text: "Your payment was declined.",
71
+ note: "Please contact support.",
72
+ buttonLabel: "Close",
73
+ onButton: () => c.closeDeclined()
74
+ });
75
+ }
76
+ const detailRows = s.orderInfo.filter(r => r.label !== 'Amount:');
77
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
78
+ style: styles.fill,
79
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_ui.Screen, {
80
+ style: styles.page,
81
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
82
+ style: styles.headerRow,
83
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
84
+ source: {
85
+ uri: _methodLogos.LOGO_SWICH
86
+ },
87
+ style: styles.logo,
88
+ resizeMode: "contain",
89
+ accessibilityLabel: "Swich"
90
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
91
+ accessibilityRole: "button",
92
+ accessibilityLabel: "Close checkout",
93
+ hitSlop: 12,
94
+ onPress: () => c.requestClose(),
95
+ style: styles.closeBtn,
96
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
97
+ style: styles.closeText,
98
+ children: "\xD7"
99
+ })
100
+ })]
101
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
102
+ style: styles.card,
103
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
104
+ style: styles.secureRow,
105
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
106
+ style: styles.secure,
107
+ children: "\uD83D\uDD12 Secure checkout"
108
+ })
109
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
110
+ style: styles.amountLabel,
111
+ children: "Amount to pay"
112
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
113
+ style: styles.amount,
114
+ accessibilityRole: "text",
115
+ children: s.amountLabel
116
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
117
+ style: styles.merchant,
118
+ numberOfLines: 1,
119
+ children: [s.details.merchantName, " \xB7 ", s.details.item]
120
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
121
+ style: styles.chips,
122
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
123
+ style: [styles.chip, s.timeIsLow && styles.chipUrgent],
124
+ accessibilityRole: "timer",
125
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
126
+ style: [styles.chipText, s.timeIsLow && {
127
+ color: _theme.colors.danger
128
+ }],
129
+ children: ["\u23F1 Time left: ", s.timeLeftLabel]
130
+ })
131
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
132
+ style: styles.chip,
133
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
134
+ style: styles.chipText,
135
+ children: [s.remainingAttempts, " attempt", s.remainingAttempts === 1 ? '' : 's', " left"]
136
+ })
137
+ })]
138
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
139
+ accessibilityRole: "button",
140
+ accessibilityLabel: s.orderInfoExpanded ? 'Hide order details' : 'Show order details',
141
+ accessibilityState: {
142
+ expanded: s.orderInfoExpanded
143
+ },
144
+ onPress: () => c.toggleOrderInfo(),
145
+ style: styles.orderHead,
146
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
147
+ style: styles.orderTitle,
148
+ children: "Order Details"
149
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
150
+ style: styles.orderToggle,
151
+ children: s.orderInfoExpanded ? 'Hide ▴' : 'Show ▾'
152
+ })]
153
+ }), s.orderInfoExpanded ? detailRows.map(row => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
154
+ style: styles.row,
155
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
156
+ style: styles.rowLabel,
157
+ children: row.label.replace(/:$/, '')
158
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
159
+ style: styles.rowValue,
160
+ numberOfLines: 1,
161
+ children: row.value
162
+ })]
163
+ }, row.label)) : null]
164
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
165
+ style: styles.sectionTitle,
166
+ accessibilityRole: "header",
167
+ children: "Choose Payment Method"
168
+ }), s.tiles.map(tile => {
169
+ const expanded = s.expandedCategory === tile.category;
170
+ const look = methodLook(tile);
171
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
172
+ style: [styles.tile, expanded && styles.tileOn],
173
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
174
+ accessibilityRole: "button",
175
+ accessibilityLabel: tile.label,
176
+ accessibilityState: {
177
+ expanded,
178
+ disabled: s.locked
179
+ },
180
+ onPress: () => c.toggleCategory(tile.category),
181
+ style: ({
182
+ pressed
183
+ }) => [styles.tileHead, pressed && {
184
+ backgroundColor: _theme.colors.surfaceAlt
185
+ }],
186
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
187
+ style: styles.tileIcon,
188
+ children: look.icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
189
+ source: {
190
+ uri: look.icon
191
+ },
192
+ style: styles.tileIconImg,
193
+ resizeMode: "contain"
194
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
195
+ style: {
196
+ fontSize: 18
197
+ },
198
+ children: "\uD83D\uDCB3"
199
+ })
200
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
201
+ style: styles.tileText,
202
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
203
+ style: styles.tileLabel,
204
+ children: tile.label
205
+ }), look.subtitle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
206
+ style: styles.tileSub,
207
+ children: look.subtitle
208
+ }) : null]
209
+ }), expanded ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
210
+ style: styles.tileChevron,
211
+ children: "\u2715"
212
+ }) : look.logos.length > 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
213
+ style: styles.logos,
214
+ children: look.logos.map(uri => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
215
+ source: {
216
+ uri
217
+ },
218
+ style: styles.tileLogo,
219
+ resizeMode: "contain"
220
+ }, uri.slice(-24)))
221
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
222
+ style: styles.tileChevron,
223
+ children: "\u203A"
224
+ })]
225
+ }), expanded ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
226
+ style: styles.tileBody,
227
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.ErrorBanner, {
228
+ message: s.formError
229
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(CategoryForm, {
230
+ c: c,
231
+ s: s,
232
+ category: tile.category
233
+ })]
234
+ }) : null]
235
+ }, tile.category);
236
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
237
+ style: styles.footer,
238
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
239
+ source: {
240
+ uri: _methodLogos.LOGO_PCI_DSS
241
+ },
242
+ style: styles.pci,
243
+ resizeMode: "contain",
244
+ accessibilityLabel: "PCI DSS compliant"
245
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
246
+ style: styles.footerText,
247
+ children: "Payments are encrypted and secured by Swich."
248
+ })]
249
+ })]
250
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Toast, {
251
+ message: s.toast
252
+ }), s.exitConfirmOpen ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.ConfirmDialog, {
253
+ title: "Exit checkout?",
254
+ text: "Are you sure you want to exit? Your payment session will be cancelled.",
255
+ cancelLabel: "No, Continue",
256
+ confirmLabel: "Yes, Exit",
257
+ onCancel: () => c.confirmExit(false),
258
+ onConfirm: () => c.confirmExit(true)
259
+ }) : null]
260
+ });
261
+ }
262
+
263
+ /**
264
+ * Icon, brand logos and a one-line description per method. Logos are bundled (from Swich's own
265
+ * payment page) because the `mobileappinit` logo URLs can be unavailable; unknown categories
266
+ * fall back to those URLs.
267
+ */
268
+ function methodLook(tile) {
269
+ switch (tile.category) {
270
+ case _index.PaymentCategory.ewallet:
271
+ return {
272
+ icon: _methodLogos.LOGO_JAZZCASH,
273
+ logos: [_methodLogos.LOGO_EASYPAISA, _methodLogos.LOGO_JAZZCASH],
274
+ subtitle: 'EasyPaisa or JazzCash account'
275
+ };
276
+ case _index.PaymentCategory.rtpEwalletPayment:
277
+ return {
278
+ icon: _methodLogos.LOGO_EASYPAISA,
279
+ logos: [_methodLogos.LOGO_EASYPAISA, _methodLogos.LOGO_JAZZCASH],
280
+ subtitle: 'Payment request to your wallet'
281
+ };
282
+ case _index.PaymentCategory.visaMasterCardPayment:
283
+ return {
284
+ icon: _methodLogos.LOGO_VISA,
285
+ logos: [_methodLogos.LOGO_VISA, _methodLogos.LOGO_MASTERCARD, _methodLogos.LOGO_PAYPAK],
286
+ subtitle: 'Visa, Mastercard or PayPak'
287
+ };
288
+ case _index.PaymentCategory.biller:
289
+ return {
290
+ icon: _methodLogos.LOGO_ONE_BILL,
291
+ logos: [],
292
+ subtitle: 'Pay with a consumer number at any bank or app'
293
+ };
294
+ case _index.PaymentCategory.bankAccount:
295
+ return {
296
+ icon: _methodLogos.LOGO_BANK_TRANSFER,
297
+ logos: [],
298
+ subtitle: 'Pay from your bank account with OTP'
299
+ };
300
+ case _index.PaymentCategory.dqrcPayment:
301
+ return {
302
+ icon: _methodLogos.LOGO_QR,
303
+ logos: [],
304
+ subtitle: 'Scan a one-time RAAST QR with your bank app'
305
+ };
306
+ case _index.PaymentCategory.sqrcPayment:
307
+ return {
308
+ icon: _methodLogos.LOGO_QR,
309
+ logos: [],
310
+ subtitle: 'Scan the merchant RAAST QR'
311
+ };
312
+ case _index.PaymentCategory.rtpNowPayment:
313
+ return {
314
+ icon: _methodLogos.LOGO_RTP,
315
+ logos: [],
316
+ subtitle: 'Instant payment request to your bank'
317
+ };
318
+ default:
319
+ return {
320
+ icon: tile.logoUrls[0] ?? null,
321
+ logos: tile.logoUrls,
322
+ subtitle: ''
323
+ };
324
+ }
325
+ }
326
+ function CategoryForm(props) {
327
+ const {
328
+ c,
329
+ s,
330
+ category
331
+ } = props;
332
+ switch (category) {
333
+ case _index.PaymentCategory.visaMasterCardPayment:
334
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(CardForm, {
335
+ c: c,
336
+ s: s
337
+ });
338
+ case _index.PaymentCategory.ewallet:
339
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(EwalletForm, {
340
+ c: c,
341
+ s: s
342
+ });
343
+ case _index.PaymentCategory.rtpEwalletPayment:
344
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(RtpEwalletForm, {
345
+ c: c,
346
+ s: s
347
+ });
348
+ case _index.PaymentCategory.biller:
349
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(OneBillForm, {
350
+ c: c,
351
+ s: s
352
+ });
353
+ case _index.PaymentCategory.bankAccount:
354
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(BankForm, {
355
+ c: c,
356
+ s: s
357
+ });
358
+ case _index.PaymentCategory.dqrcPayment:
359
+ case _index.PaymentCategory.sqrcPayment:
360
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(QrForm, {
361
+ c: c,
362
+ s: s,
363
+ category: category
364
+ });
365
+ case _index.PaymentCategory.rtpNowPayment:
366
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(RtpNowForm, {
367
+ c: c,
368
+ s: s
369
+ });
370
+ default:
371
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
372
+ style: styles.form,
373
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_ui.Note, {
374
+ children: [(0, _index.paymentCategoryLabel)(category), " isn't available in this demo yet."]
375
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Button, {
376
+ onPress: () => c.submitUnsupported(category),
377
+ children: s.payLabel
378
+ })]
379
+ });
380
+ }
381
+ }
382
+ function SavedRow(props) {
383
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
384
+ accessibilityRole: "button",
385
+ accessibilityState: {
386
+ selected: props.selected,
387
+ disabled: !!props.disabled
388
+ },
389
+ disabled: props.disabled,
390
+ onPress: props.onPress,
391
+ style: [styles.saved, props.selected && {
392
+ borderColor: _theme.colors.blue
393
+ }],
394
+ children: [props.logo ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
395
+ source: {
396
+ uri: props.logo
397
+ },
398
+ style: styles.tileLogo,
399
+ resizeMode: "contain"
400
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
401
+ children: "\uD83D\uDCB3"
402
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
403
+ style: {
404
+ flex: 1
405
+ },
406
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
407
+ style: styles.savedLabel,
408
+ children: props.label
409
+ }), props.sub ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
410
+ style: styles.savedSub,
411
+ children: props.sub
412
+ }) : null]
413
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
414
+ children: props.marker
415
+ })]
416
+ });
417
+ }
418
+ function Or(props) {
419
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
420
+ style: styles.or,
421
+ children: props.label
422
+ });
423
+ }
424
+ function CardForm({
425
+ c,
426
+ s
427
+ }) {
428
+ const card = s.card;
429
+ if (card.verifyingCard) {
430
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
431
+ style: styles.center,
432
+ accessibilityRole: "progressbar",
433
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Spinner, {
434
+ dark: true,
435
+ large: true,
436
+ label: "Verifying your card"
437
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
438
+ style: styles.muted,
439
+ children: "Verifying your card..."
440
+ })]
441
+ });
442
+ }
443
+ if (card.stepUp) {
444
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_webviews.StepUpView, {
445
+ challenge: card.stepUp,
446
+ isCompletionUrl: c.isThreeDsReturnUrl,
447
+ onComplete: data => void c.completeThreeDs(data)
448
+ });
449
+ }
450
+ const saved = s.session?.savedCards ?? [];
451
+ const savedSelected = card.selectedSavedCardId != null;
452
+ const fieldsDisabled = savedSelected || card.checkingStatus;
453
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
454
+ style: styles.form,
455
+ children: [saved.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
456
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
457
+ style: styles.subTitle,
458
+ children: "Saved Cards"
459
+ }), saved.map(sc => {
460
+ const brand = _index.CardValidators.detectBrand(sc.cardNumber);
461
+ const logo = brand === 'visa' ? s.logos.Visa : brand === 'mastercard' ? s.logos.Mastercard : undefined;
462
+ const selected = card.selectedSavedCardId === sc.id;
463
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(SavedRow, {
464
+ label: (0, _index.maskedSavedCard)(sc),
465
+ sub: sc.expiryDate ? `Exp ${sc.expiryDate}` : null,
466
+ logo: logo,
467
+ selected: selected,
468
+ disabled: s.submitting,
469
+ marker: selected ? '×' : '○',
470
+ onPress: () => c.selectSavedCard(sc.id)
471
+ }, sc.id);
472
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Or, {
473
+ label: "OR USE NEW CARD"
474
+ }), savedSelected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Button, {
475
+ variant: "ghost",
476
+ onPress: () => c.clearSavedCard(),
477
+ children: "Use a new card"
478
+ }) : null]
479
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.TextField, {
480
+ label: "Card no.",
481
+ keyboardType: "number-pad",
482
+ autoComplete: "cc-number",
483
+ placeholder: "Enter card no.",
484
+ maxLength: 19,
485
+ value: card.number,
486
+ editable: !fieldsDisabled,
487
+ error: card.errors.number,
488
+ suffix: card.number ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.BrandBadge, {
489
+ brand: card.brand,
490
+ logos: s.logos
491
+ }) : undefined,
492
+ onValueChange: v => c.setCardNumber(v)
493
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
494
+ style: styles.grid2,
495
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
496
+ style: {
497
+ flex: 1
498
+ },
499
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.TextField, {
500
+ label: "Expiry date",
501
+ keyboardType: "number-pad",
502
+ autoComplete: "cc-exp",
503
+ placeholder: "MM/YY",
504
+ maxLength: 5,
505
+ value: card.expiry,
506
+ editable: !fieldsDisabled,
507
+ error: card.errors.expiry,
508
+ onValueChange: v => c.setCardExpiry(v)
509
+ })
510
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
511
+ style: {
512
+ flex: 1
513
+ },
514
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.TextField, {
515
+ label: "CVC No.",
516
+ keyboardType: "number-pad",
517
+ autoComplete: "cc-csc",
518
+ secureTextEntry: true,
519
+ placeholder: "Enter CVC no.",
520
+ maxLength: 4,
521
+ value: card.cvv,
522
+ editable: !fieldsDisabled,
523
+ error: card.errors.cvv,
524
+ onValueChange: v => c.setCardCvv(v)
525
+ })
526
+ })]
527
+ }), !savedSelected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Checkbox, {
528
+ label: "Save this card for future payments",
529
+ checked: card.saveCard,
530
+ onChange: v => c.setSaveCard(v)
531
+ }) : null, !savedSelected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(DiscountBlock, {
532
+ s: s,
533
+ which: "card"
534
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Button, {
535
+ loading: s.submitting || card.checkingStatus,
536
+ onPress: () => void c.submitCard(),
537
+ children: card.payLabel
538
+ }), card.checkingStatus ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Note, {
539
+ children: card.statusMessage ?? 'Checking payment status...'
540
+ }) : null]
541
+ });
542
+ }
543
+ function DiscountBlock({
544
+ s,
545
+ which
546
+ }) {
547
+ const discount = which === 'card' ? s.card.discount : s.ewallet.discount;
548
+ const d = s.details;
549
+ if (discount.loading) {
550
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
551
+ style: styles.discountLoading,
552
+ accessibilityRole: "progressbar",
553
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Spinner, {
554
+ dark: true,
555
+ label: "Checking for a discount"
556
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
557
+ style: styles.muted,
558
+ children: "Checking for a discount..."
559
+ })]
560
+ });
561
+ }
562
+ if (!discount.result) return null;
563
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
564
+ style: styles.discount,
565
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
566
+ style: styles.row,
567
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
568
+ style: styles.rowLabel,
569
+ children: "Amount"
570
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
571
+ style: styles.rowValue,
572
+ children: [d.currency, " ", d.amount]
573
+ })]
574
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
575
+ style: styles.row,
576
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
577
+ style: styles.rowLabel,
578
+ children: "Discount"
579
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
580
+ style: styles.rowValue,
581
+ children: ["-", d.currency, " ", discount.result.discountAmount]
582
+ })]
583
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
584
+ style: styles.divider
585
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
586
+ style: styles.row,
587
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
588
+ style: styles.rowLabel,
589
+ children: "Total Payable"
590
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
591
+ style: styles.rowValue,
592
+ children: [d.currency, " ", discount.result.finalAmount]
593
+ })]
594
+ })]
595
+ });
596
+ }
597
+ function EwalletForm({
598
+ c,
599
+ s
600
+ }) {
601
+ const session = s.session;
602
+ const w = s.ewallet;
603
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
604
+ style: styles.form,
605
+ children: [session.savedWallets.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
606
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
607
+ style: styles.subTitle,
608
+ children: "Saved Ewallets"
609
+ }), session.savedWallets.map(wallet => {
610
+ const channel = c.channelForSavedWallet(wallet);
611
+ const selected = w.selectedSavedWalletId === wallet.id;
612
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(SavedRow, {
613
+ label: (0, _index.maskedSavedWallet)(wallet),
614
+ logo: channel ? s.logos[channel.channelName] : undefined,
615
+ selected: selected,
616
+ disabled: s.submitting,
617
+ marker: selected ? '●' : '○',
618
+ onPress: () => c.selectSavedWallet(wallet.id)
619
+ }, wallet.id);
620
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Or, {
621
+ label: "OR USE NEW ACCOUNT"
622
+ })]
623
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
624
+ style: styles.radios,
625
+ accessibilityRole: "radiogroup",
626
+ accessibilityLabel: "Wallet provider",
627
+ children: session.channels.map((channel, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Radio, {
628
+ label: channel.channelName,
629
+ logoUrl: s.logos[channel.channelName],
630
+ checked: w.selectedSavedWalletId == null && w.selectedChannelIndex === index,
631
+ disabled: s.submitting,
632
+ onSelect: () => c.selectChannel(index)
633
+ }, `${channel.channelId}-${index}`))
634
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.TextField, {
635
+ label: "Account Number",
636
+ keyboardType: "phone-pad",
637
+ autoComplete: "tel",
638
+ placeholder: "Enter account number",
639
+ maxLength: 11,
640
+ value: w.account,
641
+ editable: w.selectedSavedWalletId == null,
642
+ error: w.errors.account,
643
+ onValueChange: v => c.setEwalletAccount(v)
644
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(DiscountBlock, {
645
+ s: s,
646
+ which: "ewallet"
647
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Button, {
648
+ loading: s.submitting,
649
+ onPress: () => void c.submitEwallet(),
650
+ children: w.payLabel
651
+ }), s.submitting ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Note, {
652
+ children: "Please approve the payment request from your wallet app"
653
+ }) : null]
654
+ });
655
+ }
656
+ function RtpEwalletForm({
657
+ c,
658
+ s
659
+ }) {
660
+ const r = s.rtpEwallet;
661
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
662
+ style: styles.form,
663
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.SelectField, {
664
+ label: "Bank",
665
+ placeholder: "Select Bank",
666
+ value: r.selectedBankName,
667
+ disabled: s.submitting,
668
+ options: s.banks.rtpEwallet.map(b => ({
669
+ value: b.bankName,
670
+ label: b.bankName
671
+ })),
672
+ onValueChange: v => c.selectRtpEwalletBank(v)
673
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
674
+ style: styles.radios,
675
+ accessibilityRole: "radiogroup",
676
+ accessibilityLabel: "Pay with",
677
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Radio, {
678
+ label: "Phone",
679
+ checked: r.phoneMode,
680
+ disabled: s.submitting,
681
+ onSelect: () => c.setRtpEwalletPhoneMode(true)
682
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Radio, {
683
+ label: "IBAN",
684
+ checked: !r.phoneMode,
685
+ disabled: s.submitting,
686
+ onSelect: () => c.setRtpEwalletPhoneMode(false)
687
+ })]
688
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.TextField, {
689
+ label: r.phoneMode ? 'Mobile Number' : 'IBAN',
690
+ keyboardType: r.phoneMode ? 'phone-pad' : 'default',
691
+ autoCapitalize: r.phoneMode ? 'none' : 'characters',
692
+ placeholder: r.phoneMode ? 'Enter mobile number' : 'Enter IBAN (e.g. PK00XXXX...)',
693
+ value: r.input,
694
+ error: r.errors.input,
695
+ onValueChange: v => c.setRtpEwalletInput(v)
696
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Button, {
697
+ loading: s.submitting,
698
+ onPress: () => void c.submitRtpEwallet(),
699
+ children: s.payLabel
700
+ }), s.submitting ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Note, {
701
+ children: r.phoneMode ? 'Please approve this payment in your banking app. This can take a few minutes.' : 'Please approve this payment with your bank. This can take a few minutes.'
702
+ }) : null]
703
+ });
704
+ }
705
+ function OneBillForm({
706
+ c,
707
+ s
708
+ }) {
709
+ const o = s.oneBill;
710
+ if (o.consumerNumber) {
711
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
712
+ style: styles.form,
713
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
714
+ style: styles.codeBox,
715
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
716
+ style: styles.codeLabel,
717
+ children: "Consumer Number"
718
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
719
+ style: styles.codeRow,
720
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
721
+ style: styles.codeValue,
722
+ selectable: true,
723
+ children: o.consumerNumber
724
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
725
+ accessibilityRole: "button",
726
+ accessibilityLabel: "Copy",
727
+ hitSlop: 10,
728
+ onPress: () => void c.copyConsumerNumber(),
729
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
730
+ style: styles.copy,
731
+ children: "\u29C9"
732
+ })
733
+ })]
734
+ })]
735
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Button, {
736
+ loading: s.submitting,
737
+ onPress: () => void c.verifyOneBill(),
738
+ children: "\u2713 Verify Payment"
739
+ })]
740
+ });
741
+ }
742
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
743
+ style: styles.form,
744
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.TextField, {
745
+ label: "Mobile Number",
746
+ keyboardType: "phone-pad",
747
+ autoComplete: "tel",
748
+ placeholder: "Enter mobile number",
749
+ value: o.mobile,
750
+ error: o.errors.mobile,
751
+ onValueChange: v => c.setOneBillMobile(v)
752
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Button, {
753
+ loading: s.submitting,
754
+ onPress: () => void c.submitOneBill(),
755
+ children: "GENERATE CONSUMER NUMBER"
756
+ })]
757
+ });
758
+ }
759
+ function BankForm({
760
+ c,
761
+ s
762
+ }) {
763
+ const b = s.bank;
764
+ if (b.otpRequired) {
765
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
766
+ style: styles.form,
767
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_ui.Note, {
768
+ children: ["Enter the OTP sent to ", b.mobile]
769
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.TextField, {
770
+ label: "OTP",
771
+ keyboardType: "number-pad",
772
+ autoComplete: "one-time-code",
773
+ placeholder: "Enter OTP",
774
+ value: b.otp,
775
+ error: b.errors.otp,
776
+ onValueChange: v => c.setBankField('otp', v)
777
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Button, {
778
+ loading: s.submitting,
779
+ onPress: () => void c.verifyBankOtp(),
780
+ children: s.payLabel
781
+ })]
782
+ });
783
+ }
784
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
785
+ style: styles.form,
786
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.SelectField, {
787
+ label: "Select Bank",
788
+ placeholder: "Choose your bank",
789
+ value: b.selectedBankName,
790
+ error: b.errors.bank,
791
+ options: s.banks.bankAccount.map(bank => ({
792
+ value: bank.bankName,
793
+ label: bank.bankName
794
+ })),
795
+ onValueChange: v => c.selectBank(v)
796
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.TextField, {
797
+ label: "CNIC",
798
+ keyboardType: "number-pad",
799
+ placeholder: "Enter CNIC (13 digits)",
800
+ maxLength: 13,
801
+ value: b.cnic,
802
+ error: b.errors.cnic,
803
+ onValueChange: v => c.setBankField('cnic', v)
804
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.TextField, {
805
+ label: "Mobile Number",
806
+ keyboardType: "phone-pad",
807
+ autoComplete: "tel",
808
+ placeholder: "Enter mobile number",
809
+ value: b.mobile,
810
+ error: b.errors.mobile,
811
+ onValueChange: v => c.setBankField('mobile', v)
812
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.TextField, {
813
+ label: "Account Number",
814
+ keyboardType: "number-pad",
815
+ placeholder: "Enter account number",
816
+ value: b.account,
817
+ error: b.errors.account,
818
+ onValueChange: v => c.setBankField('account', v)
819
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Button, {
820
+ loading: s.submitting,
821
+ onPress: () => void c.submitBankAccount(),
822
+ children: s.payLabel
823
+ })]
824
+ });
825
+ }
826
+ function QrForm({
827
+ c,
828
+ s,
829
+ category
830
+ }) {
831
+ const q = s.qr;
832
+ const d = s.details;
833
+ if (!q.qrString) {
834
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
835
+ style: [styles.form, {
836
+ alignItems: 'stretch'
837
+ }],
838
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
839
+ style: styles.qrTitle,
840
+ children: "Payment through RAAST QR"
841
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
842
+ style: [styles.muted, {
843
+ textAlign: 'center'
844
+ }, q.error ? {
845
+ color: _theme.colors.danger
846
+ } : null],
847
+ children: q.error ?? 'Click below to generate your QR code.'
848
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Button, {
849
+ loading: q.loading,
850
+ onPress: () => void c.loadQr(category),
851
+ children: q.error ? 'Try Again' : 'Generate QR Code'
852
+ })]
853
+ });
854
+ }
855
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
856
+ style: styles.form,
857
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
858
+ style: styles.qrTitle,
859
+ children: "Payment through RAAST QR"
860
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.QrCode, {
861
+ value: q.qrString
862
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
863
+ style: styles.grid2,
864
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Button, {
865
+ variant: "ghost",
866
+ style: {
867
+ flex: 1
868
+ },
869
+ onPress: () => void c.downloadQr(),
870
+ children: "\u2913 Download"
871
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Button, {
872
+ variant: "ghost",
873
+ style: {
874
+ flex: 1
875
+ },
876
+ onPress: () => void c.shareQr(),
877
+ children: "\u2934 Share"
878
+ })]
879
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
880
+ style: [styles.muted, {
881
+ textAlign: 'center'
882
+ }],
883
+ children: "QR expires with your session. Refresh if it stops working."
884
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
885
+ style: styles.qrTitle,
886
+ children: ["Amount: ", d.currency, " ", d.amount]
887
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Button, {
888
+ loading: s.submitting,
889
+ disabled: q.loading,
890
+ onPress: () => void c.verifyQr(category),
891
+ children: "\u2713 I've Paid \u2014 Verify"
892
+ })]
893
+ });
894
+ }
895
+ function RtpNowForm({
896
+ c,
897
+ s
898
+ }) {
899
+ const r = s.rtpNow;
900
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
901
+ style: styles.form,
902
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
903
+ style: styles.qrTitle,
904
+ children: "RTP (Request to Pay)"
905
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
906
+ style: [styles.muted, {
907
+ textAlign: 'center'
908
+ }],
909
+ children: "Select how you want to receive the Request to Pay."
910
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
911
+ style: [styles.option, r.method === 'raast' && styles.optionOn],
912
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Radio, {
913
+ label: "RAAST",
914
+ checked: r.method === 'raast',
915
+ onSelect: () => c.setRtpNowMethod('raast')
916
+ }), r.method === 'raast' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
917
+ style: styles.optionBody,
918
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.TextField, {
919
+ accessibilityLabel: "Mobile Number",
920
+ placeholder: "Mobile Number",
921
+ required: false,
922
+ keyboardType: "phone-pad",
923
+ value: r.mobile,
924
+ onValueChange: v => c.setRtpNowField('mobile', v)
925
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
926
+ style: [styles.muted, {
927
+ textAlign: 'center',
928
+ fontWeight: '600'
929
+ }],
930
+ children: "OR"
931
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.TextField, {
932
+ accessibilityLabel: "IBAN",
933
+ placeholder: "IBAN",
934
+ required: false,
935
+ autoCapitalize: "characters",
936
+ value: r.iban,
937
+ onValueChange: v => c.setRtpNowField('iban', v)
938
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
939
+ style: styles.muted,
940
+ children: "Enter either a Mobile Number or an IBAN."
941
+ })]
942
+ }) : null]
943
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
944
+ style: [styles.option, r.method === 'bankAccount' && styles.optionOn],
945
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Radio, {
946
+ label: "Bank Account",
947
+ checked: r.method === 'bankAccount',
948
+ onSelect: () => c.setRtpNowMethod('bankAccount')
949
+ }), r.method === 'bankAccount' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
950
+ style: styles.optionBody,
951
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.SelectField, {
952
+ label: "Bank",
953
+ placeholder: "Select Bank",
954
+ value: r.selectedBankName,
955
+ options: s.banks.rtpNow.map(b => ({
956
+ value: b.bankName,
957
+ label: b.bankName
958
+ })),
959
+ onValueChange: v => c.selectRtpNowBank(v)
960
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.TextField, {
961
+ accessibilityLabel: "Account Number",
962
+ placeholder: "Account Number",
963
+ required: false,
964
+ keyboardType: "number-pad",
965
+ value: r.account,
966
+ onValueChange: v => c.setRtpNowField('account', v)
967
+ })]
968
+ }) : null]
969
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Button, {
970
+ loading: s.submitting,
971
+ disabled: !r.continueEnabled,
972
+ onPress: () => void c.submitRtpNow(),
973
+ children: "Continue"
974
+ }), s.submitting ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.Note, {
975
+ children: "Please approve the payment request from your bank/wallet app"
976
+ }) : null]
977
+ });
978
+ }
979
+ const styles = _reactNative.StyleSheet.create({
980
+ fill: {
981
+ flexGrow: 1,
982
+ flexShrink: 1,
983
+ backgroundColor: PAGE_BG
984
+ },
985
+ page: {
986
+ backgroundColor: PAGE_BG,
987
+ gap: _theme.space.md
988
+ },
989
+ center: {
990
+ flexGrow: 1,
991
+ flexShrink: 1,
992
+ minHeight: 240,
993
+ alignItems: 'center',
994
+ justifyContent: 'center',
995
+ gap: _theme.space.md,
996
+ padding: _theme.space.xl,
997
+ backgroundColor: PAGE_BG
998
+ },
999
+ muted: {
1000
+ color: _theme.colors.muted,
1001
+ fontSize: _theme.font.sm + 1
1002
+ },
1003
+ headerRow: {
1004
+ flexDirection: 'row',
1005
+ alignItems: 'center',
1006
+ justifyContent: 'space-between',
1007
+ paddingTop: _theme.space.xs
1008
+ },
1009
+ logo: {
1010
+ width: 112,
1011
+ height: 36
1012
+ },
1013
+ closeBtn: {
1014
+ width: 36,
1015
+ height: 36,
1016
+ borderRadius: 18,
1017
+ alignItems: 'center',
1018
+ justifyContent: 'center',
1019
+ backgroundColor: _theme.colors.surface,
1020
+ borderWidth: 1,
1021
+ borderColor: _theme.colors.border
1022
+ },
1023
+ closeText: {
1024
+ fontSize: 22,
1025
+ lineHeight: 24,
1026
+ color: _theme.colors.muted
1027
+ },
1028
+ card: {
1029
+ backgroundColor: _theme.colors.surface,
1030
+ borderRadius: _theme.radius.lg,
1031
+ padding: _theme.space.lg,
1032
+ gap: 6,
1033
+ shadowColor: '#0f172a',
1034
+ shadowOpacity: 0.06,
1035
+ shadowRadius: 10,
1036
+ shadowOffset: {
1037
+ width: 0,
1038
+ height: 2
1039
+ },
1040
+ elevation: 2
1041
+ },
1042
+ secureRow: {
1043
+ flexDirection: 'row'
1044
+ },
1045
+ secure: {
1046
+ fontSize: _theme.font.sm,
1047
+ fontWeight: '600',
1048
+ color: _theme.colors.success,
1049
+ backgroundColor: _theme.colors.successBg,
1050
+ paddingHorizontal: _theme.space.md,
1051
+ paddingVertical: 4,
1052
+ borderRadius: _theme.radius.pill,
1053
+ overflow: 'hidden'
1054
+ },
1055
+ amountLabel: {
1056
+ marginTop: _theme.space.sm,
1057
+ fontSize: _theme.font.sm + 1,
1058
+ color: _theme.colors.muted
1059
+ },
1060
+ amount: {
1061
+ fontSize: 32,
1062
+ fontWeight: '800',
1063
+ color: _theme.colors.text,
1064
+ letterSpacing: -0.5
1065
+ },
1066
+ merchant: {
1067
+ fontSize: _theme.font.md,
1068
+ color: _theme.colors.muted
1069
+ },
1070
+ chips: {
1071
+ flexDirection: 'row',
1072
+ flexWrap: 'wrap',
1073
+ gap: _theme.space.sm,
1074
+ marginTop: _theme.space.sm
1075
+ },
1076
+ chip: {
1077
+ paddingHorizontal: _theme.space.md,
1078
+ paddingVertical: 5,
1079
+ borderRadius: _theme.radius.pill,
1080
+ backgroundColor: _theme.colors.surfaceAlt
1081
+ },
1082
+ chipUrgent: {
1083
+ backgroundColor: _theme.colors.dangerBg
1084
+ },
1085
+ chipText: {
1086
+ fontSize: _theme.font.sm,
1087
+ fontWeight: '600',
1088
+ color: _theme.colors.muted
1089
+ },
1090
+ orderHead: {
1091
+ flexDirection: 'row',
1092
+ alignItems: 'center',
1093
+ justifyContent: 'space-between',
1094
+ marginTop: _theme.space.md,
1095
+ paddingTop: _theme.space.md,
1096
+ borderTopWidth: _reactNative.StyleSheet.hairlineWidth,
1097
+ borderTopColor: _theme.colors.border
1098
+ },
1099
+ orderTitle: {
1100
+ fontSize: _theme.font.md,
1101
+ fontWeight: '700',
1102
+ color: _theme.colors.text
1103
+ },
1104
+ orderToggle: {
1105
+ fontSize: _theme.font.sm + 1,
1106
+ fontWeight: '600',
1107
+ color: _theme.colors.blue
1108
+ },
1109
+ row: {
1110
+ flexDirection: 'row',
1111
+ justifyContent: 'space-between',
1112
+ gap: _theme.space.md,
1113
+ paddingVertical: 2
1114
+ },
1115
+ rowLabel: {
1116
+ color: _theme.colors.muted,
1117
+ fontSize: _theme.font.sm + 1
1118
+ },
1119
+ rowValue: {
1120
+ color: _theme.colors.text,
1121
+ fontSize: _theme.font.sm + 1,
1122
+ fontWeight: '600',
1123
+ flexShrink: 1,
1124
+ textAlign: 'right'
1125
+ },
1126
+ sectionTitle: {
1127
+ fontSize: _theme.font.lg,
1128
+ fontWeight: '700',
1129
+ color: _theme.colors.text,
1130
+ marginTop: _theme.space.sm
1131
+ },
1132
+ tile: {
1133
+ borderWidth: 1,
1134
+ borderColor: '#e5e9f2',
1135
+ borderRadius: _theme.radius.lg,
1136
+ overflow: 'hidden',
1137
+ backgroundColor: _theme.colors.surface
1138
+ },
1139
+ tileOn: {
1140
+ borderColor: _theme.colors.blue,
1141
+ borderWidth: 1.5
1142
+ },
1143
+ tileHead: {
1144
+ flexDirection: 'row',
1145
+ alignItems: 'center',
1146
+ gap: _theme.space.md,
1147
+ paddingHorizontal: _theme.space.lg,
1148
+ paddingVertical: 14,
1149
+ minHeight: 68
1150
+ },
1151
+ tileIcon: {
1152
+ width: 44,
1153
+ height: 44,
1154
+ borderRadius: 12,
1155
+ backgroundColor: '#f3f6fc',
1156
+ alignItems: 'center',
1157
+ justifyContent: 'center',
1158
+ overflow: 'hidden'
1159
+ },
1160
+ tileIconImg: {
1161
+ width: 34,
1162
+ height: 34
1163
+ },
1164
+ tileText: {
1165
+ flex: 1,
1166
+ gap: 2
1167
+ },
1168
+ tileLabel: {
1169
+ fontSize: _theme.font.md + 1,
1170
+ fontWeight: '700',
1171
+ color: _theme.colors.text
1172
+ },
1173
+ tileSub: {
1174
+ fontSize: _theme.font.sm,
1175
+ color: _theme.colors.faint
1176
+ },
1177
+ tileChevron: {
1178
+ fontSize: 22,
1179
+ color: _theme.colors.faint,
1180
+ paddingHorizontal: 4
1181
+ },
1182
+ tileBody: {
1183
+ paddingHorizontal: _theme.space.lg,
1184
+ paddingBottom: _theme.space.lg,
1185
+ paddingTop: _theme.space.xs,
1186
+ gap: _theme.space.md,
1187
+ borderTopWidth: _reactNative.StyleSheet.hairlineWidth,
1188
+ borderTopColor: '#e5e9f2'
1189
+ },
1190
+ logos: {
1191
+ flexDirection: 'row',
1192
+ gap: 4,
1193
+ alignItems: 'center'
1194
+ },
1195
+ tileLogo: {
1196
+ width: 30,
1197
+ height: 20
1198
+ },
1199
+ footer: {
1200
+ alignItems: 'center',
1201
+ gap: 6,
1202
+ marginTop: _theme.space.lg,
1203
+ marginBottom: _theme.space.lg
1204
+ },
1205
+ pci: {
1206
+ width: 64,
1207
+ height: 36
1208
+ },
1209
+ footerText: {
1210
+ fontSize: _theme.font.sm,
1211
+ color: _theme.colors.faint,
1212
+ textAlign: 'center'
1213
+ },
1214
+ form: {
1215
+ gap: _theme.space.md
1216
+ },
1217
+ subTitle: {
1218
+ fontWeight: '700',
1219
+ color: _theme.colors.text,
1220
+ fontSize: _theme.font.md
1221
+ },
1222
+ saved: {
1223
+ flexDirection: 'row',
1224
+ alignItems: 'center',
1225
+ gap: _theme.space.md,
1226
+ padding: _theme.space.md,
1227
+ borderWidth: 1,
1228
+ borderColor: _theme.colors.border,
1229
+ borderRadius: _theme.radius.md
1230
+ },
1231
+ savedLabel: {
1232
+ fontSize: _theme.font.md,
1233
+ color: _theme.colors.text,
1234
+ fontWeight: '600'
1235
+ },
1236
+ savedSub: {
1237
+ fontSize: _theme.font.sm,
1238
+ color: _theme.colors.faint
1239
+ },
1240
+ or: {
1241
+ textAlign: 'center',
1242
+ color: _theme.colors.faint,
1243
+ fontSize: _theme.font.sm,
1244
+ fontWeight: '600',
1245
+ letterSpacing: 0.5
1246
+ },
1247
+ grid2: {
1248
+ flexDirection: 'row',
1249
+ gap: _theme.space.md
1250
+ },
1251
+ radios: {
1252
+ gap: _theme.space.sm
1253
+ },
1254
+ discountLoading: {
1255
+ flexDirection: 'row',
1256
+ alignItems: 'center',
1257
+ gap: _theme.space.sm
1258
+ },
1259
+ discount: {
1260
+ gap: _theme.space.sm,
1261
+ padding: _theme.space.md,
1262
+ borderRadius: _theme.radius.md,
1263
+ backgroundColor: _theme.colors.successBg,
1264
+ borderWidth: 1,
1265
+ borderColor: _theme.colors.successBorder
1266
+ },
1267
+ divider: {
1268
+ height: _reactNative.StyleSheet.hairlineWidth,
1269
+ backgroundColor: _theme.colors.successBorder
1270
+ },
1271
+ codeBox: {
1272
+ padding: _theme.space.md,
1273
+ borderRadius: _theme.radius.md,
1274
+ backgroundColor: _theme.colors.surfaceAlt,
1275
+ gap: 4
1276
+ },
1277
+ codeLabel: {
1278
+ fontSize: _theme.font.sm,
1279
+ color: _theme.colors.muted
1280
+ },
1281
+ codeRow: {
1282
+ flexDirection: 'row',
1283
+ alignItems: 'center',
1284
+ justifyContent: 'space-between'
1285
+ },
1286
+ codeValue: {
1287
+ fontSize: _theme.font.xl,
1288
+ fontWeight: '700',
1289
+ color: _theme.colors.text,
1290
+ letterSpacing: 1
1291
+ },
1292
+ copy: {
1293
+ fontSize: _theme.font.xl,
1294
+ color: _theme.colors.blue
1295
+ },
1296
+ qrTitle: {
1297
+ fontWeight: '700',
1298
+ fontSize: _theme.font.lg,
1299
+ color: _theme.colors.text,
1300
+ textAlign: 'center'
1301
+ },
1302
+ option: {
1303
+ borderWidth: 1,
1304
+ borderColor: _theme.colors.border,
1305
+ borderRadius: _theme.radius.md,
1306
+ padding: _theme.space.sm,
1307
+ gap: _theme.space.sm
1308
+ },
1309
+ optionOn: {
1310
+ borderColor: _theme.colors.blue
1311
+ },
1312
+ optionBody: {
1313
+ gap: _theme.space.sm,
1314
+ paddingHorizontal: _theme.space.sm,
1315
+ paddingBottom: _theme.space.sm
1316
+ }
1317
+ });