@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,20 @@
1
+ import { type FlowServices } from './core/flows/services.js';
2
+ import type { SwichPayClient } from './core/index.js';
3
+ /**
4
+ * `FlowServices` for React Native: 3-D Secure device-data collection in a hidden WebView;
5
+ * "copy" / QR save and share open the system share sheet (React Native has no built-in
6
+ * clipboard or file APIs, and the SDK adds no native dependencies for them).
7
+ */
8
+ export declare const nativeFlowServices: FlowServices;
9
+ export interface SwichPayContextValue {
10
+ client: SwichPayClient;
11
+ services: FlowServices;
12
+ }
13
+ export declare const SwichPayContext: import("react").Context<SwichPayContextValue | null>;
14
+ /** The provider's client, or the one from `SwichPay.initialize()` when used outside a provider. */
15
+ export declare function useSwichPayClient(): SwichPayClient;
16
+ export declare function useFlowServices(overrides?: Partial<FlowServices>): FlowServices;
17
+ /** A presented checkout registers what Android's back button / swipe-down should do. */
18
+ export declare const DismissContext: import("react").Context<((handler: (() => void) | null) => void) | null>;
19
+ export declare function useDismissHandler(handler: () => void): void;
20
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1,103 @@
1
+ import type { ApiClient } from '../http/api-client.js';
2
+ import { type CardDetails, type PaymentResult, type ResolvedPaymentDetails } from '../models/payment.js';
3
+ import { type DirectBank } from '../models/session.js';
4
+ import { type JsonMap } from '../utils/json.js';
5
+ import type { DirectPaymentRepository } from './repositories.js';
6
+ /** Strips vendor messages to whatever's between `[` and `]` when present. */
7
+ export declare function extractVendorMessage(message: string | null): string | null;
8
+ /** `code` in {0000, 0, 00} (string or number) or `status == success`. */
9
+ export declare function isSuccessCode(json: JsonMap): boolean;
10
+ /** Shared shape for e-wallet / bank transfer; OTP required = success code && !isTransactionCompleted. */
11
+ export declare function parseDirectPaymentResponse(json: JsonMap): PaymentResult;
12
+ /** Shared shape for RTP Now / RTP E-wallet; prefers `success`, falls back to code/status. */
13
+ export declare function parseRtpResponse(json: JsonMap): PaymentResult;
14
+ /**
15
+ * `PaymentV3`: `nextAction.type == "iframe_collect"` is a DDC step; any other non-`complete`
16
+ * `nextAction` with a `url` is a step-up; `complete` (or no `nextAction` with code 0000) is final.
17
+ */
18
+ export declare function parseDirectCardResult(json: JsonMap, fallbackVendorTransactionId: string): PaymentResult;
19
+ /**
20
+ * `CompleteTokenPayment`: the step-up is under `next_action` (snake_case), whose `nextAction` is a
21
+ * string step type and whose `token` is the JWT to POST.
22
+ */
23
+ export declare function parseTokenizedPaymentResult(json: JsonMap, fallbackVendorTransactionId: string): PaymentResult;
24
+ /** `InquireV3`: `transactionStatus` is authoritative; `Initiated` means still pending. */
25
+ export declare function parseDirectCardStatus(json: JsonMap, tracker: string): PaymentResult;
26
+ export interface DirectCardPaymentInput {
27
+ details: ResolvedPaymentDetails;
28
+ card: CardDetails;
29
+ clientId: string;
30
+ /** `recievedCheckSum`; empty in proxy mode, where the proxy signs the request. */
31
+ checksum: string;
32
+ merchantId: number;
33
+ doCardOnFile?: boolean;
34
+ }
35
+ export interface DirectRtpNowPaymentInput {
36
+ details: ResolvedPaymentDetails;
37
+ msisdn: string;
38
+ rtpId: string;
39
+ bankCode?: string | null;
40
+ accountTitle?: string | null;
41
+ accountNumber?: string | null;
42
+ accountNumberAlias?: string | null;
43
+ transactionType?: string;
44
+ }
45
+ export interface ConfirmDirectBankTransferInput {
46
+ customerTransactionId: string;
47
+ billReferenceNo?: string | null;
48
+ transactionId: string;
49
+ orderId: string;
50
+ transactionReferenceNo: string;
51
+ retreivalReferenceNo: string;
52
+ otp: string;
53
+ }
54
+ /** Direct (session-less) payments on the gateway's `payin` endpoints and the payment-api host. */
55
+ export declare class DirectPaymentApi implements DirectPaymentRepository {
56
+ private readonly client;
57
+ private readonly now;
58
+ constructor(client: ApiClient, now?: () => number);
59
+ directEwalletPayment(input: {
60
+ details: ResolvedPaymentDetails;
61
+ channelId: number;
62
+ msisdn: string;
63
+ categoryId?: number;
64
+ }): Promise<PaymentResult>;
65
+ directBankTransfer(input: {
66
+ details: ResolvedPaymentDetails;
67
+ bankCode: string;
68
+ accountNo: string;
69
+ }): Promise<PaymentResult>;
70
+ confirmDirectBankTransfer(input: ConfirmDirectBankTransferInput): Promise<PaymentResult>;
71
+ fetchDirectBankList(): Promise<DirectBank[]>;
72
+ generateDirectOneBill(input: {
73
+ details: ResolvedPaymentDetails;
74
+ ucid?: string;
75
+ bankMnemonic?: string;
76
+ prefix?: string;
77
+ reserved?: string;
78
+ categoryId?: number;
79
+ channelId?: number;
80
+ }): Promise<PaymentResult>;
81
+ checkDirectOneBillStatus(customerTransactionId: string): Promise<PaymentResult>;
82
+ generateDirectQrPayment(details: ResolvedPaymentDetails): Promise<PaymentResult>;
83
+ checkDirectQrStatus(customerTransactionId: string): Promise<PaymentResult>;
84
+ fetchDirectRtpNowBanks(): Promise<DirectBank[]>;
85
+ directRtpNowPayment(input: DirectRtpNowPaymentInput): Promise<PaymentResult>;
86
+ fetchDirectRtpEwalletBanks(): Promise<DirectBank[]>;
87
+ directRtpEwalletPayment(input: {
88
+ details: ResolvedPaymentDetails;
89
+ bankCode: string;
90
+ msisdn?: string;
91
+ iban?: string;
92
+ }): Promise<PaymentResult>;
93
+ directCardPayment(input: DirectCardPaymentInput): Promise<PaymentResult>;
94
+ executeDirectCardTokenizedPayment(input: {
95
+ customerTransactionId: string;
96
+ billReferenceNo: string;
97
+ vendorTransactionId: string;
98
+ sessionId: string;
99
+ }): Promise<PaymentResult>;
100
+ checkDirectCardPaymentStatus(tracker: string): Promise<PaymentResult>;
101
+ private fetchBanks;
102
+ }
103
+ //# sourceMappingURL=direct-payment-api.d.ts.map
@@ -0,0 +1,10 @@
1
+ import type { ApiClient } from '../http/api-client.js';
2
+ import { type DiscountRequest, type DiscountResult } from '../models/discount.js';
3
+ import type { DiscountRepository } from './repositories.js';
4
+ /** Calls to the standalone Discount API host. */
5
+ export declare class DiscountApi implements DiscountRepository {
6
+ private readonly client;
7
+ constructor(client: ApiClient);
8
+ getDiscount(request: DiscountRequest): Promise<DiscountResult>;
9
+ }
10
+ //# sourceMappingURL=discount-api.d.ts.map
@@ -0,0 +1,150 @@
1
+ import type { ApiClient } from '../http/api-client.js';
2
+ import { PaymentCategory } from '../models/category.js';
3
+ import { type CardDetails, type PaymentResult, type ResolvedPaymentDetails } from '../models/payment.js';
4
+ import { type MobileAppInitResult, type PaymentSessionDetails, type PaymentSessionInquiryResult } from '../models/session.js';
5
+ import { type JsonMap } from '../utils/json.js';
6
+ import type { GatewayRepository } from './repositories.js';
7
+ export interface ProcessCardPaymentInput {
8
+ paymentSessionGuid: string;
9
+ card: CardDetails;
10
+ /** The user's "save this card" choice (wire field `saveCard`). */
11
+ doCardOnFile?: boolean;
12
+ categoryId?: number | null;
13
+ savedCardId?: number | null;
14
+ isSavedCardSelected?: boolean | null;
15
+ clientId?: string | null;
16
+ /** Best-effort; not part of ProcessPayment's documented contract. */
17
+ discountAmount?: number | null;
18
+ /** Sent as `amount` when a discount applies. */
19
+ finalAmount?: number | null;
20
+ }
21
+ export interface ProcessEwalletPaymentInput {
22
+ paymentSessionGuid: string;
23
+ ewalletType?: string | null;
24
+ channelId: number;
25
+ msisdn?: string | null;
26
+ /** Default `"ewallet"`; `"rtpewalletpayment"` for RTP E-wallet. */
27
+ categoryCode?: string;
28
+ bankCode?: string | null;
29
+ accountNumber?: string | null;
30
+ accountNumberAlias?: string | null;
31
+ iban?: string | null;
32
+ mobileNumber?: string | null;
33
+ categoryId?: number | null;
34
+ clientId?: string | null;
35
+ discountAmount?: number | null;
36
+ finalAmount?: number | null;
37
+ }
38
+ export interface ProcessBankAccountPaymentInput {
39
+ paymentSessionGuid: string;
40
+ bankCode: string;
41
+ /** Always sent as 0 - the real bank channelId makes the request hang. */
42
+ channelId: number;
43
+ cnic: string;
44
+ accountNumber: string;
45
+ msisdn: string;
46
+ otp?: string | null;
47
+ categoryId?: number | null;
48
+ clientId?: string | null;
49
+ }
50
+ export interface ProcessBillerPaymentInput {
51
+ paymentSessionGuid: string;
52
+ msisdn: string;
53
+ consumerNumber?: string | null;
54
+ categoryId?: number | null;
55
+ clientId?: string | null;
56
+ }
57
+ export interface ProcessQrPaymentInput {
58
+ paymentSessionGuid: string;
59
+ /** `"dqrcpayment"` (default) or `"sqrcpayment"`. */
60
+ categoryCode?: string;
61
+ isVerify?: boolean;
62
+ categoryId?: number | null;
63
+ clientId?: string | null;
64
+ }
65
+ export interface ProcessRtpNowPaymentInput {
66
+ paymentSessionGuid: string;
67
+ mobileNumber?: string | null;
68
+ iban?: string | null;
69
+ bankCode?: string | null;
70
+ channelId?: number | null;
71
+ accountNumber?: string | null;
72
+ accountNumberAlias?: string | null;
73
+ categoryId?: number | null;
74
+ clientId?: string | null;
75
+ }
76
+ export interface SubmitPaymentEnrollmentInput {
77
+ customerTransactionId: string;
78
+ billReferenceNo: string;
79
+ /** Sent as `eventData`. */
80
+ sessionId: string;
81
+ paymentSetup: Record<string, unknown>;
82
+ doCapture?: boolean;
83
+ doCardOnFile?: boolean;
84
+ dynamicRedirectUrls?: Record<string, unknown>;
85
+ vendorTransactionId?: string | null;
86
+ }
87
+ interface ProcessPaymentFields {
88
+ paymentSessionGuid: string;
89
+ categoryCode: string;
90
+ categoryId?: number;
91
+ clientId?: string | null;
92
+ cardNumber?: string;
93
+ expiryDate?: string;
94
+ cvc?: string;
95
+ saveCard?: boolean;
96
+ isSavedCardSelected?: boolean;
97
+ savedCardId?: number;
98
+ ewalletType?: string;
99
+ channelId?: number;
100
+ msisdn?: string;
101
+ bankCode?: string;
102
+ cnic?: string | null;
103
+ accountNumber?: string;
104
+ otp?: string;
105
+ mobileNumber?: string;
106
+ checksum?: string;
107
+ isVerify?: boolean;
108
+ accountNumberAlias?: string;
109
+ iban?: string;
110
+ finalAmount?: number | null;
111
+ }
112
+ /**
113
+ * Builds a `ProcessPayment` body with every field always present (unset ones as `""`/`0`/`false`),
114
+ * matching native's `ProcessPaymentRequestDto`. `clientId`/`cnic`/`amount` are omitted when null.
115
+ */
116
+ export declare function processPaymentBody(f: ProcessPaymentFields): JsonMap;
117
+ /**
118
+ * Parses a `ProcessPayment` / `PaymentEnrollment` response. Fields are read from the root, then
119
+ * from `data`, and coerced instead of cast.
120
+ */
121
+ export declare function parseGatewayResult(json: JsonMap): PaymentResult;
122
+ /**
123
+ * `CheckCardPaymentStatus` - different shape: `transactionStatus`/`redirectUrl`. Only
124
+ * success/successful/approved count as success; `message` comes from `redirectUrl`'s query.
125
+ */
126
+ export declare function parseCardStatusResult(json: JsonMap, tracker: string): PaymentResult;
127
+ /** Calls to the SwichPay gateway host. */
128
+ export declare class GatewayApi implements GatewayRepository {
129
+ private readonly client;
130
+ constructor(client: ApiClient);
131
+ mobileAppInit(appId: string): Promise<MobileAppInitResult>;
132
+ /** Validates `attempts` (1-10) and `expiryMinutes` (1-30) before any network call. */
133
+ createPaymentSession(details: ResolvedPaymentDetails, categories: readonly PaymentCategory[]): Promise<{
134
+ url: string;
135
+ guid: string;
136
+ }>;
137
+ getPaymentSessionDetails(paymentSessionGuid: string): Promise<PaymentSessionDetails>;
138
+ processCardPayment(input: ProcessCardPaymentInput): Promise<PaymentResult>;
139
+ processEwalletPayment(input: ProcessEwalletPaymentInput): Promise<PaymentResult>;
140
+ processBankAccountPayment(input: ProcessBankAccountPaymentInput): Promise<PaymentResult>;
141
+ processBillerPayment(input: ProcessBillerPaymentInput): Promise<PaymentResult>;
142
+ processQrPayment(input: ProcessQrPaymentInput): Promise<PaymentResult>;
143
+ processRtpNowPayment(input: ProcessRtpNowPaymentInput): Promise<PaymentResult>;
144
+ submitPaymentEnrollment(input: SubmitPaymentEnrollmentInput): Promise<PaymentResult>;
145
+ checkCardPaymentStatus(tracker: string, forceTimeout?: boolean): Promise<PaymentResult>;
146
+ cancelSession(paymentSessionGuid: string): Promise<void>;
147
+ inquirePaymentSession(paymentSessionGuid: string): Promise<PaymentSessionInquiryResult>;
148
+ }
149
+ export {};
150
+ //# sourceMappingURL=gateway-api.d.ts.map
@@ -0,0 +1,22 @@
1
+ import type { ApiClient } from '../http/api-client.js';
2
+ import { type CardDetails, type PaymentResult, type ResolvedPaymentDetails } from '../models/payment.js';
3
+ import { type JsonMap } from '../utils/json.js';
4
+ import type { PaymentsRepository } from './repositories.js';
5
+ /** `/iframe/Payment` response. */
6
+ export declare function parseCheckoutPaymentResult(json: JsonMap): PaymentResult;
7
+ /** Calls to the SwichPay checkout host. */
8
+ export declare class PaymentsApi implements PaymentsRepository {
9
+ private readonly client;
10
+ private readonly today;
11
+ constructor(client: ApiClient, today?: () => string);
12
+ /** Rejects with `SwichPayApiException` if the client id / referrer pair isn't recognized. */
13
+ init(sessionToken: string): Promise<void>;
14
+ pay(input: {
15
+ details: ResolvedPaymentDetails;
16
+ card: CardDetails;
17
+ clientId: string;
18
+ merchantId: number;
19
+ sessionToken: string;
20
+ }): Promise<PaymentResult>;
21
+ }
22
+ //# sourceMappingURL=payments-api.d.ts.map
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Repository contracts. `SwichPayClient` accepts implementations
3
+ * of these, so tests can replace a whole layer instead of the transport.
4
+ */
5
+ import type { PaymentCategory } from '../models/category.js';
6
+ import type { DiscountRequest, DiscountResult } from '../models/discount.js';
7
+ import type { CardDetails, PaymentResult, ResolvedPaymentDetails } from '../models/payment.js';
8
+ import type { DirectBank, MobileAppInitResult, PaymentSessionDetails, PaymentSessionInquiryResult } from '../models/session.js';
9
+ import type { ConfirmDirectBankTransferInput, DirectCardPaymentInput, DirectRtpNowPaymentInput } from './direct-payment-api.js';
10
+ import type { ProcessBankAccountPaymentInput, ProcessBillerPaymentInput, ProcessCardPaymentInput, ProcessEwalletPaymentInput, ProcessQrPaymentInput, ProcessRtpNowPaymentInput, SubmitPaymentEnrollmentInput } from './gateway-api.js';
11
+ export interface PaymentsRepository {
12
+ init(sessionToken: string): Promise<void>;
13
+ pay(input: {
14
+ details: ResolvedPaymentDetails;
15
+ card: CardDetails;
16
+ clientId: string;
17
+ merchantId: number;
18
+ sessionToken: string;
19
+ }): Promise<PaymentResult>;
20
+ }
21
+ export interface GatewayRepository {
22
+ mobileAppInit(appId: string): Promise<MobileAppInitResult>;
23
+ createPaymentSession(details: ResolvedPaymentDetails, categories: readonly PaymentCategory[]): Promise<{
24
+ url: string;
25
+ guid: string;
26
+ }>;
27
+ getPaymentSessionDetails(paymentSessionGuid: string): Promise<PaymentSessionDetails>;
28
+ processCardPayment(input: ProcessCardPaymentInput): Promise<PaymentResult>;
29
+ processEwalletPayment(input: ProcessEwalletPaymentInput): Promise<PaymentResult>;
30
+ processBankAccountPayment(input: ProcessBankAccountPaymentInput): Promise<PaymentResult>;
31
+ processBillerPayment(input: ProcessBillerPaymentInput): Promise<PaymentResult>;
32
+ processQrPayment(input: ProcessQrPaymentInput): Promise<PaymentResult>;
33
+ processRtpNowPayment(input: ProcessRtpNowPaymentInput): Promise<PaymentResult>;
34
+ submitPaymentEnrollment(input: SubmitPaymentEnrollmentInput): Promise<PaymentResult>;
35
+ checkCardPaymentStatus(tracker: string, forceTimeout?: boolean): Promise<PaymentResult>;
36
+ cancelSession(paymentSessionGuid: string): Promise<void>;
37
+ inquirePaymentSession(paymentSessionGuid: string): Promise<PaymentSessionInquiryResult>;
38
+ }
39
+ export interface DirectPaymentRepository {
40
+ directEwalletPayment(input: {
41
+ details: ResolvedPaymentDetails;
42
+ channelId: number;
43
+ msisdn: string;
44
+ categoryId?: number;
45
+ }): Promise<PaymentResult>;
46
+ directBankTransfer(input: {
47
+ details: ResolvedPaymentDetails;
48
+ bankCode: string;
49
+ accountNo: string;
50
+ }): Promise<PaymentResult>;
51
+ confirmDirectBankTransfer(input: ConfirmDirectBankTransferInput): Promise<PaymentResult>;
52
+ fetchDirectBankList(): Promise<DirectBank[]>;
53
+ generateDirectOneBill(input: {
54
+ details: ResolvedPaymentDetails;
55
+ ucid?: string;
56
+ bankMnemonic?: string;
57
+ prefix?: string;
58
+ reserved?: string;
59
+ categoryId?: number;
60
+ channelId?: number;
61
+ }): Promise<PaymentResult>;
62
+ checkDirectOneBillStatus(customerTransactionId: string): Promise<PaymentResult>;
63
+ generateDirectQrPayment(details: ResolvedPaymentDetails): Promise<PaymentResult>;
64
+ checkDirectQrStatus(customerTransactionId: string): Promise<PaymentResult>;
65
+ fetchDirectRtpNowBanks(): Promise<DirectBank[]>;
66
+ directRtpNowPayment(input: DirectRtpNowPaymentInput): Promise<PaymentResult>;
67
+ fetchDirectRtpEwalletBanks(): Promise<DirectBank[]>;
68
+ directRtpEwalletPayment(input: {
69
+ details: ResolvedPaymentDetails;
70
+ bankCode: string;
71
+ msisdn?: string;
72
+ iban?: string;
73
+ }): Promise<PaymentResult>;
74
+ directCardPayment(input: DirectCardPaymentInput): Promise<PaymentResult>;
75
+ executeDirectCardTokenizedPayment(input: {
76
+ customerTransactionId: string;
77
+ billReferenceNo: string;
78
+ vendorTransactionId: string;
79
+ sessionId: string;
80
+ }): Promise<PaymentResult>;
81
+ checkDirectCardPaymentStatus(tracker: string): Promise<PaymentResult>;
82
+ }
83
+ export interface DiscountRepository {
84
+ getDiscount(request: DiscountRequest): Promise<DiscountResult>;
85
+ }
86
+ //# sourceMappingURL=repositories.d.ts.map
@@ -0,0 +1,5 @@
1
+ /** SwichPay wordmark. */
2
+ export declare const SWICH_LOGO_DATA_URI: string;
3
+ /** RTP tile logo. */
4
+ export declare const RTP_LOGO_DATA_URI: string;
5
+ //# sourceMappingURL=images.d.ts.map
@@ -0,0 +1,12 @@
1
+ export declare const LOGO_ONE_BILL: string;
2
+ export declare const LOGO_EASYPAISA: string;
3
+ export declare const LOGO_JAZZCASH: string;
4
+ export declare const LOGO_MASTERCARD: string;
5
+ export declare const LOGO_PAYPAK: string;
6
+ export declare const LOGO_PCI_DSS: string;
7
+ export declare const LOGO_BANK_TRANSFER: string;
8
+ export declare const LOGO_QR: string;
9
+ export declare const LOGO_RTP: string;
10
+ export declare const LOGO_SWICH: string;
11
+ export declare const LOGO_VISA: string;
12
+ //# sourceMappingURL=method-logos.d.ts.map
@@ -0,0 +1,7 @@
1
+ export declare const PWA_SWICH_LOGO: string;
2
+ export declare const PWA_CARD_DEFAULT: string;
3
+ export declare const PWA_CARD_VISA: string;
4
+ export declare const PWA_CARD_MASTERCARD: string;
5
+ export declare const PWA_CARD_PAYPAK: string;
6
+ export declare const PWA_PCI_DSS_LOGO: string;
7
+ //# sourceMappingURL=pwa-images.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Copies `text` to the clipboard, falling back to `execCommand` where the async API is blocked. */
2
+ export declare function copyText(text: string): Promise<void>;
3
+ //# sourceMappingURL=clipboard.d.ts.map
@@ -0,0 +1,11 @@
1
+ /** A unique, DOM-safe id. */
2
+ export declare function uniqueName(prefix: string): string;
3
+ /** A hidden `<form method="post">` targeting `target`, with one hidden input per field. */
4
+ export declare function createPostForm(action: string, fields: Record<string, string>, target: string): HTMLFormElement;
5
+ /** `event.data` as a JSON object when it is one (or a JSON string of one). */
6
+ export declare function messageDataAsObject(data: unknown): Record<string, unknown> | null;
7
+ /** `event.data` serialized as a string (`JSON.stringify(event.data)`). */
8
+ export declare function serializeMessageData(data: unknown): string;
9
+ /** The iframe's current URL when it's same-origin; `null` when the browser hides it. */
10
+ export declare function readFrameUrl(iframe: HTMLIFrameElement): URL | null;
11
+ //# sourceMappingURL=dom.d.ts.map
@@ -0,0 +1,27 @@
1
+ import { type PaymentDetails, type PaymentResult } from '../models/payment.js';
2
+ import { type MountedFrame } from './three-ds.js';
3
+ /**
4
+ * The hosted checkout's outcome for a URL it navigated to, or `null`
5
+ * when it isn't one of the redirect URLs.
6
+ */
7
+ export declare function hostedCheckoutResultForUrl(url: string, details: Pick<PaymentDetails, 'successRedirectUrl' | 'failedRedirectUrl'>): PaymentResult | null;
8
+ export interface HostedCheckoutFrameOptions {
9
+ url: string;
10
+ details: Pick<PaymentDetails, 'successRedirectUrl' | 'failedRedirectUrl'>;
11
+ onResult: (result: PaymentResult) => void;
12
+ /** The checkout's own Close button (`closewindow`) - resolves `null`. */
13
+ onClose?: () => void;
14
+ onLoadingChange?: (loading: boolean) => void;
15
+ }
16
+ /**
17
+ * Loads SwichPay's hosted checkout in an iframe (SwichPay sends `frame-ancestors *`). The checkout
18
+ * host's result page tells its parent what happened (Swich.CardPayment `_ResponseModal`):
19
+ * `{ command: "redirecttocustomer", url }` after its countdown and `{ command: "closewindow" }`
20
+ * on Close. A `redirecttocustomer` URL matching `successRedirectUrl`/`failedRedirectUrl` resolves
21
+ *; any other URL resolves with the last `TRANSACTION_COMPLETE` status and
22
+ * the URL in `redirectUrl`. Same-origin navigations to the redirect URLs are detected too.
23
+ */
24
+ export declare function mountHostedCheckout(container: HTMLElement, options: HostedCheckoutFrameOptions): MountedFrame;
25
+ /** Sends the whole page to the hosted checkout; your redirect URLs receive the customer back. */
26
+ export declare function redirectToHostedCheckout(url: string): void;
27
+ //# sourceMappingURL=hosted-checkout.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * `@swichpay/core/browser` - DOM helpers used by the React and Nuxt components. Nothing here
3
+ * touches `window`/`document` at import time; each function checks for a browser when called.
4
+ */
5
+ export { copyText } from './clipboard.js';
6
+ export { createPostForm, messageDataAsObject, readFrameUrl, serializeMessageData } from './dom.js';
7
+ export { hostedCheckoutResultForUrl, mountHostedCheckout, redirectToHostedCheckout, type HostedCheckoutFrameOptions, } from './hosted-checkout.js';
8
+ export { downloadQrCode, encodeQr, qrPngBlob, qrSvg, shareQrCode, type QrMatrix } from './qr.js';
9
+ export { mountStepUpChallenge, runDeviceDataCollection, stepUpRequest, TRANSACTION_COMPLETE, type MountedFrame, type StepUpChallengeOptions, } from './three-ds.js';
10
+ export { isBrowser } from '../utils/runtime.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
1
+ export interface QrMatrix {
2
+ size: number;
3
+ isDark(row: number, col: number): boolean;
4
+ }
5
+ /** Encodes `text` as a QR matrix (error correction M, automatic version). Pure - SSR-safe. */
6
+ export declare function encodeQr(text: string): QrMatrix;
7
+ /** An SVG string for `text`, scalable to any size. Pure - safe to render on the server. */
8
+ export declare function qrSvg(text: string, options?: {
9
+ margin?: number;
10
+ title?: string;
11
+ }): string;
12
+ /** Rasterizes the QR to a PNG blob (for download/share). Browser only. */
13
+ export declare function qrPngBlob(text: string, pixels?: number): Promise<Blob>;
14
+ /** Saves the QR as a PNG file. */
15
+ export declare function downloadQrCode(text: string, fileName?: string): Promise<void>;
16
+ /** Shares the QR PNG with the Web Share API when it can share files; downloads it otherwise. */
17
+ export declare function shareQrCode(text: string): Promise<'shared' | 'downloaded'>;
18
+ //# sourceMappingURL=qr.d.ts.map
@@ -0,0 +1,45 @@
1
+ /**
2
+ * The checkout host's 3-D Secure return page (`CallBack.cshtml` in Swich.CardPayment) posts
3
+ * `{ type: "TRANSACTION_COMPLETE", status }` to `window.parent` once the issuer step is over.
4
+ */
5
+ export declare const TRANSACTION_COMPLETE = "TRANSACTION_COMPLETE";
6
+ /**
7
+ * Runs Cardinal Cruise device-data-collection invisibly: POSTs `formFields` (the `JWT`) to `url`
8
+ * in a hidden iframe and resolves `true` on its `profile.complete` message, `false` after
9
+ * `timeoutMs`.
10
+ */
11
+ export declare function runDeviceDataCollection(input: {
12
+ url: string;
13
+ formFields: Record<string, string>;
14
+ timeoutMs: number;
15
+ }): Promise<boolean>;
16
+ export interface StepUpChallengeOptions {
17
+ /** The issuer's step-up URL. */
18
+ url: string;
19
+ /** Cardinal's JWT, POSTed as `JWT`. `null` (e.g. Meezan 3DS2): the URL's own query becomes the body. */
20
+ jwt: string | null;
21
+ /** Called once with the challenge's message (JSON), or `{"type":"redirect","url":...}`. */
22
+ onComplete: (eventData: string) => void;
23
+ /** Matches the URL the challenge returns to (only observable when same-origin). */
24
+ isCompletionUrl?: (url: URL) => boolean;
25
+ onLoadingChange?: (loading: boolean) => void;
26
+ }
27
+ export interface MountedFrame {
28
+ readonly iframe: HTMLIFrameElement;
29
+ destroy(): void;
30
+ }
31
+ /** The form a step-up challenge is POSTed with. */
32
+ export declare function stepUpRequest(url: string, jwt: string | null): {
33
+ action: string;
34
+ fields: Record<string, string>;
35
+ };
36
+ /**
37
+ * Shows the issuer's 3-D Secure challenge in an iframe inside `container`. Completes on:
38
+ * - the first `postMessage` from the challenge frame -
39
+ * in practice SwichPay's return page's `{ type: "TRANSACTION_COMPLETE", status }`;
40
+ * - a `TRANSACTION_COMPLETE` message from a SwichPay/JazzCash origin posted by a nested frame;
41
+ * - a navigation to a completion URL we can read (same-origin only - browsers hide others).
42
+ * UIs also offer a manual "I've completed verification" action as a last resort.
43
+ */
44
+ export declare function mountStepUpChallenge(container: HTMLElement, options: StepUpChallengeOptions): MountedFrame;
45
+ //# sourceMappingURL=three-ds.d.ts.map