bkash-client 0.0.0-stage → 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +102 -2
  3. package/dist/angular.cjs +149 -0
  4. package/dist/angular.cjs.map +1 -0
  5. package/dist/angular.d.cts +21 -0
  6. package/dist/angular.d.ts +21 -0
  7. package/dist/angular.js +29 -0
  8. package/dist/angular.js.map +1 -0
  9. package/dist/bkash-client.browser.global.js +149 -0
  10. package/dist/bkash-client.browser.global.js.map +1 -0
  11. package/dist/chunk-DGUM43GV.js +10 -0
  12. package/dist/chunk-DGUM43GV.js.map +1 -0
  13. package/dist/chunk-L3C2S2EZ.js +124 -0
  14. package/dist/chunk-L3C2S2EZ.js.map +1 -0
  15. package/dist/index.cjs +126 -0
  16. package/dist/index.cjs.map +1 -0
  17. package/dist/index.d.cts +66 -0
  18. package/dist/index.d.ts +66 -0
  19. package/dist/index.js +4 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/react-native.cjs +68 -0
  22. package/dist/react-native.cjs.map +1 -0
  23. package/dist/react-native.d.cts +35 -0
  24. package/dist/react-native.d.ts +35 -0
  25. package/dist/react-native.js +61 -0
  26. package/dist/react-native.js.map +1 -0
  27. package/dist/react.cjs +190 -0
  28. package/dist/react.cjs.map +1 -0
  29. package/dist/react.d.cts +27 -0
  30. package/dist/react.d.ts +27 -0
  31. package/dist/react.js +65 -0
  32. package/dist/react.js.map +1 -0
  33. package/dist/svelte.cjs +141 -0
  34. package/dist/svelte.cjs.map +1 -0
  35. package/dist/svelte.d.cts +16 -0
  36. package/dist/svelte.d.ts +16 -0
  37. package/dist/svelte.js +21 -0
  38. package/dist/svelte.js.map +1 -0
  39. package/dist/vue.cjs +169 -0
  40. package/dist/vue.cjs.map +1 -0
  41. package/dist/vue.d.cts +21 -0
  42. package/dist/vue.d.ts +21 -0
  43. package/dist/vue.js +45 -0
  44. package/dist/vue.js.map +1 -0
  45. package/package.json +147 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Antigravity Open Source & Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,103 @@
1
- # Temporary Holding Version
1
+ # bkash-client
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![CI](https://github.com/iamtashanto/Bkash/actions/workflows/ci.yml/badge.svg)](https://github.com/iamtashanto/Bkash/actions/workflows/ci.yml)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+ [![npm version](https://img.shields.io/npm/v/bkash-client.svg?color=indigo)](https://www.npmjs.com/package/bkash-client)
6
+
7
+ Universal, headless, tree-shakeable frontend client SDK for bKash payment integrations. Works with React, React Native, Vue, Svelte, Angular, and vanilla HTML `<script>` tags.
8
+
9
+ > **Disclaimer:** This is an open-source, community-maintained SDK and is **NOT** officially affiliated with, endorsed by, or sponsored by bKash Limited. "bKash" is a registered trademark of bKash Limited.
10
+
11
+ ---
12
+
13
+ ## Features
14
+
15
+ - **Headless-First Architecture (0.1.x):** Unstyled, headless state machines and hooks (`useBkash`, `<BkashButton />`, `<BkashCheckout />`). Zero opinionated CSS or bundled stylesheets, giving you 100% control over layout and styling. Pre-packaged themes are planned for post-0.1.
16
+ - **Client States:** Fully typed state machine (`idle`, `creating`, `awaiting_user`, `verifying`, `success`, `pending`, `cancelled`, `timeout`, `offline`, `error`). Unknown or timed-out transactions present "payment pending, do not pay again" rather than false errors.
17
+ - **Zero Frontend Secrets:** Never touches merchant credentials or API keys; communicates strictly with your backend routes.
18
+ - **Framework Bindings:** First-class bindings for React (`useBkash`, `<BkashButton />`), React Native (`<BkashCheckout />`), Vue 3 (`useBkash` with deep Refs), Svelte store (`createBkashStore`), and Angular service (`BkashService`).
19
+ - **Drop-in Script Tag:** Standalone IIFE bundle for plain HTML/JS websites.
20
+
21
+ > **Alpha Limitation (AUD-04):** On Android devices, `<BkashCheckout />` does not automatically attach a native `BackHandler`. Developers must manage Android hardware back actions in their navigation container until built-in BackHandler integration lands in beta.
22
+
23
+ ---
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ # npm
29
+ npm install bkash-client
30
+
31
+ # pnpm
32
+ pnpm add bkash-client
33
+
34
+ # bun
35
+ bun add bkash-client
36
+ ```
37
+
38
+ ---
39
+
40
+ ## Quickstart (React)
41
+
42
+ ```tsx
43
+ import React from 'react';
44
+ import { useBkash, BkashButton } from 'bkash-client/react';
45
+
46
+ export function CheckoutPage() {
47
+ const { state, error, checkout } = useBkash({
48
+ createUrl: '/api/bkash/create',
49
+ });
50
+
51
+ return (
52
+ <div>
53
+ <h2>Order Summary</h2>
54
+ <BkashButton
55
+ amount={1550}
56
+ invoiceNumber="INV_1001"
57
+ orderId="ORD_555"
58
+ className="btn-bkash"
59
+ >
60
+ Pay 1,550 BDT with bKash
61
+ </BkashButton>
62
+ {error && <p className="error">{error.message}</p>}
63
+ </div>
64
+ );
65
+ }
66
+ ```
67
+
68
+ ---
69
+
70
+ ## React Native / Expo
71
+
72
+ ```tsx
73
+ import React from 'react';
74
+ import { WebView } from 'react-native-webview';
75
+ import { BkashCheckout } from 'bkash-client/react-native';
76
+
77
+ export function PaymentScreen({ route, navigation }: any) {
78
+ const { redirectUrl } = route.params;
79
+
80
+ return (
81
+ <BkashCheckout
82
+ redirectUrl={redirectUrl}
83
+ callbackUrl="https://merchant.example.com/api/bkash/callback"
84
+ WebViewComponent={WebView}
85
+ onSuccess={(paymentId) => {
86
+ navigation.navigate('Success', { paymentId });
87
+ }}
88
+ onCancel={() => {
89
+ navigation.goBack();
90
+ }}
91
+ onError={(err) => {
92
+ alert(err.message);
93
+ }}
94
+ />
95
+ );
96
+ }
97
+ ```
98
+
99
+ ---
100
+
101
+ ## License
102
+
103
+ MIT © [Antigravity Open Source & Contributors](https://github.com/iamtashanto/Bkash)
@@ -0,0 +1,149 @@
1
+ 'use strict';
2
+
3
+ // src/index.ts
4
+ var BkashClient = class {
5
+ state = "idle";
6
+ options;
7
+ currentPaymentId = null;
8
+ listeners = /* @__PURE__ */ new Set();
9
+ constructor(options) {
10
+ this.options = {
11
+ createUrl: "/api/bkash/create",
12
+ ...options
13
+ };
14
+ }
15
+ getState() {
16
+ return this.state;
17
+ }
18
+ getPaymentId() {
19
+ return this.currentPaymentId;
20
+ }
21
+ /**
22
+ * Returns human-readable UI guidance for the current client state.
23
+ * Specifically guarantees that unknown or timed-out outcomes are presented as
24
+ * "payment pending, do not pay again" rather than a false failure.
25
+ */
26
+ getStateMessage() {
27
+ switch (this.state) {
28
+ case "idle":
29
+ return "Ready to initiate checkout.";
30
+ case "creating":
31
+ return "Initializing payment session with bKash...";
32
+ case "awaiting_user":
33
+ return "Redirecting to bKash secure payment page...";
34
+ case "verifying":
35
+ return "Verifying payment with bKash...";
36
+ case "success":
37
+ return "Payment completed successfully!";
38
+ case "pending":
39
+ case "timeout":
40
+ return "Payment pending, do not pay again. Please wait while your transaction is reconciled with bKash.";
41
+ case "cancelled":
42
+ return "Payment was cancelled.";
43
+ case "offline":
44
+ return "Device is offline. Please check your internet connection before retrying.";
45
+ case "error":
46
+ return "An error occurred during checkout.";
47
+ default:
48
+ return "";
49
+ }
50
+ }
51
+ subscribe(listener) {
52
+ this.listeners.add(listener);
53
+ return () => this.listeners.delete(listener);
54
+ }
55
+ cancel() {
56
+ this.setState("cancelled");
57
+ this.options.onCancel?.();
58
+ }
59
+ setPending(paymentId) {
60
+ if (paymentId) this.currentPaymentId = paymentId;
61
+ this.setState("pending");
62
+ }
63
+ setState(newState) {
64
+ this.state = newState;
65
+ this.options.onStateChange?.(newState);
66
+ this.listeners.forEach((fn) => fn(newState));
67
+ }
68
+ /**
69
+ * Initiates payment flow by calling the merchant backend,
70
+ * obtaining the gateway URL, and redirecting the customer.
71
+ */
72
+ async checkout(params) {
73
+ if (typeof navigator !== "undefined" && navigator.onLine === false) {
74
+ this.setState("offline");
75
+ const offlineErr = new Error("Device is offline. Please check your internet connection.");
76
+ this.options.onError?.(offlineErr);
77
+ throw offlineErr;
78
+ }
79
+ try {
80
+ this.setState("creating");
81
+ const defaultCallback = typeof window !== "undefined" ? window.location?.href : "";
82
+ const res = await fetch(this.options.createUrl, {
83
+ method: "POST",
84
+ headers: { "Content-Type": "application/json" },
85
+ body: JSON.stringify({
86
+ amount: params.amount,
87
+ invoiceNumber: params.invoiceNumber,
88
+ orderId: params.orderId,
89
+ callbackUrl: this.options.callbackUrl || defaultCallback,
90
+ payerReference: params.payerReference,
91
+ metadata: params.metadata
92
+ })
93
+ });
94
+ if (!res.ok) {
95
+ throw new Error(`Failed to create payment session: HTTP ${res.status}`);
96
+ }
97
+ const data = await res.json();
98
+ if (!data.redirectUrl || !data.paymentId) {
99
+ throw new Error(data.error || "Invalid session response from payment server.");
100
+ }
101
+ this.currentPaymentId = data.paymentId;
102
+ this.setState("awaiting_user");
103
+ if (typeof window !== "undefined" && window.location) {
104
+ window.location.href = data.redirectUrl;
105
+ }
106
+ } catch (err) {
107
+ const error = err instanceof Error ? err : new Error(String(err));
108
+ const isTimeout = error.name === "AbortError" || error.name === "TimeoutError" || /timeout|abort/i.test(error.message);
109
+ if (isTimeout) {
110
+ this.setState("pending");
111
+ } else {
112
+ this.setState("error");
113
+ }
114
+ this.options.onError?.(error);
115
+ throw error;
116
+ }
117
+ }
118
+ reset() {
119
+ this.currentPaymentId = null;
120
+ this.setState("idle");
121
+ }
122
+ };
123
+
124
+ // src/angular.ts
125
+ var BkashService = class {
126
+ client;
127
+ constructor(options) {
128
+ this.client = new BkashClient(options);
129
+ }
130
+ getState() {
131
+ return this.client.getState();
132
+ }
133
+ getPaymentId() {
134
+ return this.client.getPaymentId();
135
+ }
136
+ subscribe(listener) {
137
+ return this.client.subscribe(listener);
138
+ }
139
+ checkout(params) {
140
+ return this.client.checkout(params);
141
+ }
142
+ reset() {
143
+ this.client.reset();
144
+ }
145
+ };
146
+
147
+ exports.BkashService = BkashService;
148
+ //# sourceMappingURL=angular.cjs.map
149
+ //# sourceMappingURL=angular.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/angular.ts"],"names":[],"mappings":";;;AAqDO,IAAM,cAAN,MAAkB;AAAA,EACf,KAAA,GAA0B,MAAA;AAAA,EAC1B,OAAA;AAAA,EACA,gBAAA,GAAkC,IAAA;AAAA,EAClC,SAAA,uBAAgB,GAAA,EAAuC;AAAA,EAE/D,YAAY,OAAA,EAA8B;AACxC,IAAA,IAAA,CAAK,OAAA,GAAU;AAAA,MACb,SAAA,EAAW,mBAAA;AAAA,MACX,GAAG;AAAA,KACL;AAAA,EACF;AAAA,EAEO,QAAA,GAA6B;AAClC,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EACd;AAAA,EAEO,YAAA,GAA8B;AACnC,IAAA,OAAO,IAAA,CAAK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AA,GAA6B;AAClC,IAAA,OAAO,IAAA,CAAK,OAAO,QAAA,EAAS;AAAA,EAC9B;AAAA,EAEO,YAAA,GAA8B;AACnC,IAAA,OAAO,IAAA,CAAK,OAAO,YAAA,EAAa;AAAA,EAClC;AAAA,EAEO,UAAU,QAAA,EAAyD;AACxE,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,SAAA,CAAU,QAAQ,CAAA;AAAA,EACvC;AAAA,EAEO,SAAS,MAAA,EAA+C;AAC7D,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,QAAA,CAAS,MAAM,CAAA;AAAA,EACpC;AAAA,EAEO,KAAA,GAAc;AACnB,IAAA,IAAA,CAAK,OAAO,KAAA,EAAM;AAAA,EACpB;AACF","file":"angular.cjs","sourcesContent":["/**\n * @bkash/client\n * Universal, headless client SDK for bKash payment integrations.\n */\n\nexport type BkashClientState =\n | 'idle'\n | 'creating'\n | 'awaiting_user'\n | 'verifying'\n | 'success'\n | 'pending'\n | 'cancelled'\n | 'timeout'\n | 'offline'\n | 'error';\n\nexport interface BkashClientOptions {\n /**\n * Endpoint on merchant backend to create payment session.\n * Defaults to \"/api/bkash/create\".\n */\n createUrl?: string;\n /**\n * Callback URL registered with merchant backend.\n */\n callbackUrl?: string;\n /**\n * Hook triggered on state transition.\n */\n onStateChange?: (state: BkashClientState) => void;\n /**\n * Hook triggered when payment completes successfully.\n */\n onSuccess?: (paymentId: string) => void;\n /**\n * Hook triggered on payment error.\n */\n onError?: (error: Error) => void;\n /**\n * Hook triggered if user cancels payment.\n */\n onCancel?: () => void;\n}\n\nexport interface InitiateCheckoutParams {\n amount: number | string;\n invoiceNumber: string;\n orderId?: string;\n payerReference?: string;\n metadata?: Record<string, string>;\n}\n\nexport class BkashClient {\n private state: BkashClientState = 'idle';\n private options: BkashClientOptions;\n private currentPaymentId: string | null = null;\n private listeners = new Set<(state: BkashClientState) => void>();\n\n constructor(options?: BkashClientOptions) {\n this.options = {\n createUrl: '/api/bkash/create',\n ...options,\n };\n }\n\n public getState(): BkashClientState {\n return this.state;\n }\n\n public getPaymentId(): string | null {\n return this.currentPaymentId;\n }\n\n /**\n * Returns human-readable UI guidance for the current client state.\n * Specifically guarantees that unknown or timed-out outcomes are presented as\n * \"payment pending, do not pay again\" rather than a false failure.\n */\n public getStateMessage(): string {\n switch (this.state) {\n case 'idle':\n return 'Ready to initiate checkout.';\n case 'creating':\n return 'Initializing payment session with bKash...';\n case 'awaiting_user':\n return 'Redirecting to bKash secure payment page...';\n case 'verifying':\n return 'Verifying payment with bKash...';\n case 'success':\n return 'Payment completed successfully!';\n case 'pending':\n case 'timeout':\n return 'Payment pending, do not pay again. Please wait while your transaction is reconciled with bKash.';\n case 'cancelled':\n return 'Payment was cancelled.';\n case 'offline':\n return 'Device is offline. Please check your internet connection before retrying.';\n case 'error':\n return 'An error occurred during checkout.';\n default:\n return '';\n }\n }\n\n public subscribe(listener: (state: BkashClientState) => void): () => void {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n\n public cancel(): void {\n this.setState('cancelled');\n this.options.onCancel?.();\n }\n\n public setPending(paymentId?: string): void {\n if (paymentId) this.currentPaymentId = paymentId;\n this.setState('pending');\n }\n\n private setState(newState: BkashClientState): void {\n this.state = newState;\n this.options.onStateChange?.(newState);\n this.listeners.forEach((fn) => fn(newState));\n }\n\n /**\n * Initiates payment flow by calling the merchant backend,\n * obtaining the gateway URL, and redirecting the customer.\n */\n public async checkout(params: InitiateCheckoutParams): Promise<void> {\n // Offline pre-check\n if (typeof navigator !== 'undefined' && navigator.onLine === false) {\n this.setState('offline');\n const offlineErr = new Error('Device is offline. Please check your internet connection.');\n this.options.onError?.(offlineErr);\n throw offlineErr;\n }\n\n try {\n this.setState('creating');\n\n const defaultCallback = typeof window !== 'undefined' ? window.location?.href : '';\n const res = await fetch(this.options.createUrl!, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n amount: params.amount,\n invoiceNumber: params.invoiceNumber,\n orderId: params.orderId,\n callbackUrl: this.options.callbackUrl || defaultCallback,\n payerReference: params.payerReference,\n metadata: params.metadata,\n }),\n });\n\n if (!res.ok) {\n throw new Error(`Failed to create payment session: HTTP ${res.status}`);\n }\n\n const data = (await res.json()) as {\n redirectUrl?: string;\n paymentId?: string;\n error?: string;\n };\n if (!data.redirectUrl || !data.paymentId) {\n throw new Error(data.error || 'Invalid session response from payment server.');\n }\n\n this.currentPaymentId = data.paymentId;\n this.setState('awaiting_user');\n\n // Launch bKash Hosted Checkout\n if (typeof window !== 'undefined' && window.location) {\n window.location.href = data.redirectUrl;\n }\n } catch (err: unknown) {\n const error = err instanceof Error ? err : new Error(String(err));\n const isTimeout =\n error.name === 'AbortError' ||\n error.name === 'TimeoutError' ||\n /timeout|abort/i.test(error.message);\n\n if (isTimeout) {\n // Under AUD-08: timeout / unknown outcome MUST display pending (\"do not pay again\")\n this.setState('pending');\n } else {\n this.setState('error');\n }\n\n this.options.onError?.(error);\n throw error;\n }\n }\n\n public reset(): void {\n this.currentPaymentId = null;\n this.setState('idle');\n }\n}\n","import {\n BkashClient,\n type BkashClientOptions,\n type BkashClientState,\n type InitiateCheckoutParams,\n} from './index.js';\n\n/**\n * Plain TypeScript Service for Angular applications.\n *\n * Design Decision & Justification:\n * Modern Angular (16+) seamlessly imports standard TypeScript services directly\n * without requiring the heavy complexity of ng-packagr / Angular Package Format (APF),\n * ensuring broad compatibility across Angular 16, 17, 18, and 19 without version pinning.\n */\nexport class BkashService {\n private client: BkashClient;\n\n constructor(options?: BkashClientOptions) {\n this.client = new BkashClient(options);\n }\n\n public getState(): BkashClientState {\n return this.client.getState();\n }\n\n public getPaymentId(): string | null {\n return this.client.getPaymentId();\n }\n\n public subscribe(listener: (state: BkashClientState) => void): () => void {\n return this.client.subscribe(listener);\n }\n\n public checkout(params: InitiateCheckoutParams): Promise<void> {\n return this.client.checkout(params);\n }\n\n public reset(): void {\n this.client.reset();\n }\n}\n"]}
@@ -0,0 +1,21 @@
1
+ import { BkashClientOptions, BkashClientState, InitiateCheckoutParams } from './index.cjs';
2
+
3
+ /**
4
+ * Plain TypeScript Service for Angular applications.
5
+ *
6
+ * Design Decision & Justification:
7
+ * Modern Angular (16+) seamlessly imports standard TypeScript services directly
8
+ * without requiring the heavy complexity of ng-packagr / Angular Package Format (APF),
9
+ * ensuring broad compatibility across Angular 16, 17, 18, and 19 without version pinning.
10
+ */
11
+ declare class BkashService {
12
+ private client;
13
+ constructor(options?: BkashClientOptions);
14
+ getState(): BkashClientState;
15
+ getPaymentId(): string | null;
16
+ subscribe(listener: (state: BkashClientState) => void): () => void;
17
+ checkout(params: InitiateCheckoutParams): Promise<void>;
18
+ reset(): void;
19
+ }
20
+
21
+ export { BkashService };
@@ -0,0 +1,21 @@
1
+ import { BkashClientOptions, BkashClientState, InitiateCheckoutParams } from './index.js';
2
+
3
+ /**
4
+ * Plain TypeScript Service for Angular applications.
5
+ *
6
+ * Design Decision & Justification:
7
+ * Modern Angular (16+) seamlessly imports standard TypeScript services directly
8
+ * without requiring the heavy complexity of ng-packagr / Angular Package Format (APF),
9
+ * ensuring broad compatibility across Angular 16, 17, 18, and 19 without version pinning.
10
+ */
11
+ declare class BkashService {
12
+ private client;
13
+ constructor(options?: BkashClientOptions);
14
+ getState(): BkashClientState;
15
+ getPaymentId(): string | null;
16
+ subscribe(listener: (state: BkashClientState) => void): () => void;
17
+ checkout(params: InitiateCheckoutParams): Promise<void>;
18
+ reset(): void;
19
+ }
20
+
21
+ export { BkashService };
@@ -0,0 +1,29 @@
1
+ import { BkashClient } from './chunk-L3C2S2EZ.js';
2
+ import './chunk-DGUM43GV.js';
3
+
4
+ // src/angular.ts
5
+ var BkashService = class {
6
+ client;
7
+ constructor(options) {
8
+ this.client = new BkashClient(options);
9
+ }
10
+ getState() {
11
+ return this.client.getState();
12
+ }
13
+ getPaymentId() {
14
+ return this.client.getPaymentId();
15
+ }
16
+ subscribe(listener) {
17
+ return this.client.subscribe(listener);
18
+ }
19
+ checkout(params) {
20
+ return this.client.checkout(params);
21
+ }
22
+ reset() {
23
+ this.client.reset();
24
+ }
25
+ };
26
+
27
+ export { BkashService };
28
+ //# sourceMappingURL=angular.js.map
29
+ //# sourceMappingURL=angular.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/angular.ts"],"names":[],"mappings":";;;;AAeO,IAAM,eAAN,MAAmB;AAAA,EAChB,MAAA;AAAA,EAER,YAAY,OAAA,EAA8B;AACxC,IAAA,IAAA,CAAK,MAAA,GAAS,IAAI,WAAA,CAAY,OAAO,CAAA;AAAA,EACvC;AAAA,EAEO,QAAA,GAA6B;AAClC,IAAA,OAAO,IAAA,CAAK,OAAO,QAAA,EAAS;AAAA,EAC9B;AAAA,EAEO,YAAA,GAA8B;AACnC,IAAA,OAAO,IAAA,CAAK,OAAO,YAAA,EAAa;AAAA,EAClC;AAAA,EAEO,UAAU,QAAA,EAAyD;AACxE,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,SAAA,CAAU,QAAQ,CAAA;AAAA,EACvC;AAAA,EAEO,SAAS,MAAA,EAA+C;AAC7D,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,QAAA,CAAS,MAAM,CAAA;AAAA,EACpC;AAAA,EAEO,KAAA,GAAc;AACnB,IAAA,IAAA,CAAK,OAAO,KAAA,EAAM;AAAA,EACpB;AACF","file":"angular.js","sourcesContent":["import {\n BkashClient,\n type BkashClientOptions,\n type BkashClientState,\n type InitiateCheckoutParams,\n} from './index.js';\n\n/**\n * Plain TypeScript Service for Angular applications.\n *\n * Design Decision & Justification:\n * Modern Angular (16+) seamlessly imports standard TypeScript services directly\n * without requiring the heavy complexity of ng-packagr / Angular Package Format (APF),\n * ensuring broad compatibility across Angular 16, 17, 18, and 19 without version pinning.\n */\nexport class BkashService {\n private client: BkashClient;\n\n constructor(options?: BkashClientOptions) {\n this.client = new BkashClient(options);\n }\n\n public getState(): BkashClientState {\n return this.client.getState();\n }\n\n public getPaymentId(): string | null {\n return this.client.getPaymentId();\n }\n\n public subscribe(listener: (state: BkashClientState) => void): () => void {\n return this.client.subscribe(listener);\n }\n\n public checkout(params: InitiateCheckoutParams): Promise<void> {\n return this.client.checkout(params);\n }\n\n public reset(): void {\n this.client.reset();\n }\n}\n"]}
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+ var BkashClient = (() => {
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
+
23
+ // src/index.ts
24
+ var src_exports = {};
25
+ __export(src_exports, {
26
+ BkashClient: () => BkashClient
27
+ });
28
+ var BkashClient = class {
29
+ constructor(options) {
30
+ __publicField(this, "state", "idle");
31
+ __publicField(this, "options");
32
+ __publicField(this, "currentPaymentId", null);
33
+ __publicField(this, "listeners", /* @__PURE__ */ new Set());
34
+ this.options = {
35
+ createUrl: "/api/bkash/create",
36
+ ...options
37
+ };
38
+ }
39
+ getState() {
40
+ return this.state;
41
+ }
42
+ getPaymentId() {
43
+ return this.currentPaymentId;
44
+ }
45
+ /**
46
+ * Returns human-readable UI guidance for the current client state.
47
+ * Specifically guarantees that unknown or timed-out outcomes are presented as
48
+ * "payment pending, do not pay again" rather than a false failure.
49
+ */
50
+ getStateMessage() {
51
+ switch (this.state) {
52
+ case "idle":
53
+ return "Ready to initiate checkout.";
54
+ case "creating":
55
+ return "Initializing payment session with bKash...";
56
+ case "awaiting_user":
57
+ return "Redirecting to bKash secure payment page...";
58
+ case "verifying":
59
+ return "Verifying payment with bKash...";
60
+ case "success":
61
+ return "Payment completed successfully!";
62
+ case "pending":
63
+ case "timeout":
64
+ return "Payment pending, do not pay again. Please wait while your transaction is reconciled with bKash.";
65
+ case "cancelled":
66
+ return "Payment was cancelled.";
67
+ case "offline":
68
+ return "Device is offline. Please check your internet connection before retrying.";
69
+ case "error":
70
+ return "An error occurred during checkout.";
71
+ default:
72
+ return "";
73
+ }
74
+ }
75
+ subscribe(listener) {
76
+ this.listeners.add(listener);
77
+ return () => this.listeners.delete(listener);
78
+ }
79
+ cancel() {
80
+ this.setState("cancelled");
81
+ this.options.onCancel?.();
82
+ }
83
+ setPending(paymentId) {
84
+ if (paymentId) this.currentPaymentId = paymentId;
85
+ this.setState("pending");
86
+ }
87
+ setState(newState) {
88
+ this.state = newState;
89
+ this.options.onStateChange?.(newState);
90
+ this.listeners.forEach((fn) => fn(newState));
91
+ }
92
+ /**
93
+ * Initiates payment flow by calling the merchant backend,
94
+ * obtaining the gateway URL, and redirecting the customer.
95
+ */
96
+ async checkout(params) {
97
+ if (typeof navigator !== "undefined" && navigator.onLine === false) {
98
+ this.setState("offline");
99
+ const offlineErr = new Error("Device is offline. Please check your internet connection.");
100
+ this.options.onError?.(offlineErr);
101
+ throw offlineErr;
102
+ }
103
+ try {
104
+ this.setState("creating");
105
+ const defaultCallback = typeof window !== "undefined" ? window.location?.href : "";
106
+ const res = await fetch(this.options.createUrl, {
107
+ method: "POST",
108
+ headers: { "Content-Type": "application/json" },
109
+ body: JSON.stringify({
110
+ amount: params.amount,
111
+ invoiceNumber: params.invoiceNumber,
112
+ orderId: params.orderId,
113
+ callbackUrl: this.options.callbackUrl || defaultCallback,
114
+ payerReference: params.payerReference,
115
+ metadata: params.metadata
116
+ })
117
+ });
118
+ if (!res.ok) {
119
+ throw new Error(`Failed to create payment session: HTTP ${res.status}`);
120
+ }
121
+ const data = await res.json();
122
+ if (!data.redirectUrl || !data.paymentId) {
123
+ throw new Error(data.error || "Invalid session response from payment server.");
124
+ }
125
+ this.currentPaymentId = data.paymentId;
126
+ this.setState("awaiting_user");
127
+ if (typeof window !== "undefined" && window.location) {
128
+ window.location.href = data.redirectUrl;
129
+ }
130
+ } catch (err) {
131
+ const error = err instanceof Error ? err : new Error(String(err));
132
+ const isTimeout = error.name === "AbortError" || error.name === "TimeoutError" || /timeout|abort/i.test(error.message);
133
+ if (isTimeout) {
134
+ this.setState("pending");
135
+ } else {
136
+ this.setState("error");
137
+ }
138
+ this.options.onError?.(error);
139
+ throw error;
140
+ }
141
+ }
142
+ reset() {
143
+ this.currentPaymentId = null;
144
+ this.setState("idle");
145
+ }
146
+ };
147
+ return __toCommonJS(src_exports);
148
+ })();
149
+ //# sourceMappingURL=bkash-client.browser.global.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @bkash/client\n * Universal, headless client SDK for bKash payment integrations.\n */\n\nexport type BkashClientState =\n | 'idle'\n | 'creating'\n | 'awaiting_user'\n | 'verifying'\n | 'success'\n | 'pending'\n | 'cancelled'\n | 'timeout'\n | 'offline'\n | 'error';\n\nexport interface BkashClientOptions {\n /**\n * Endpoint on merchant backend to create payment session.\n * Defaults to \"/api/bkash/create\".\n */\n createUrl?: string;\n /**\n * Callback URL registered with merchant backend.\n */\n callbackUrl?: string;\n /**\n * Hook triggered on state transition.\n */\n onStateChange?: (state: BkashClientState) => void;\n /**\n * Hook triggered when payment completes successfully.\n */\n onSuccess?: (paymentId: string) => void;\n /**\n * Hook triggered on payment error.\n */\n onError?: (error: Error) => void;\n /**\n * Hook triggered if user cancels payment.\n */\n onCancel?: () => void;\n}\n\nexport interface InitiateCheckoutParams {\n amount: number | string;\n invoiceNumber: string;\n orderId?: string;\n payerReference?: string;\n metadata?: Record<string, string>;\n}\n\nexport class BkashClient {\n private state: BkashClientState = 'idle';\n private options: BkashClientOptions;\n private currentPaymentId: string | null = null;\n private listeners = new Set<(state: BkashClientState) => void>();\n\n constructor(options?: BkashClientOptions) {\n this.options = {\n createUrl: '/api/bkash/create',\n ...options,\n };\n }\n\n public getState(): BkashClientState {\n return this.state;\n }\n\n public getPaymentId(): string | null {\n return this.currentPaymentId;\n }\n\n /**\n * Returns human-readable UI guidance for the current client state.\n * Specifically guarantees that unknown or timed-out outcomes are presented as\n * \"payment pending, do not pay again\" rather than a false failure.\n */\n public getStateMessage(): string {\n switch (this.state) {\n case 'idle':\n return 'Ready to initiate checkout.';\n case 'creating':\n return 'Initializing payment session with bKash...';\n case 'awaiting_user':\n return 'Redirecting to bKash secure payment page...';\n case 'verifying':\n return 'Verifying payment with bKash...';\n case 'success':\n return 'Payment completed successfully!';\n case 'pending':\n case 'timeout':\n return 'Payment pending, do not pay again. Please wait while your transaction is reconciled with bKash.';\n case 'cancelled':\n return 'Payment was cancelled.';\n case 'offline':\n return 'Device is offline. Please check your internet connection before retrying.';\n case 'error':\n return 'An error occurred during checkout.';\n default:\n return '';\n }\n }\n\n public subscribe(listener: (state: BkashClientState) => void): () => void {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n\n public cancel(): void {\n this.setState('cancelled');\n this.options.onCancel?.();\n }\n\n public setPending(paymentId?: string): void {\n if (paymentId) this.currentPaymentId = paymentId;\n this.setState('pending');\n }\n\n private setState(newState: BkashClientState): void {\n this.state = newState;\n this.options.onStateChange?.(newState);\n this.listeners.forEach((fn) => fn(newState));\n }\n\n /**\n * Initiates payment flow by calling the merchant backend,\n * obtaining the gateway URL, and redirecting the customer.\n */\n public async checkout(params: InitiateCheckoutParams): Promise<void> {\n // Offline pre-check\n if (typeof navigator !== 'undefined' && navigator.onLine === false) {\n this.setState('offline');\n const offlineErr = new Error('Device is offline. Please check your internet connection.');\n this.options.onError?.(offlineErr);\n throw offlineErr;\n }\n\n try {\n this.setState('creating');\n\n const defaultCallback = typeof window !== 'undefined' ? window.location?.href : '';\n const res = await fetch(this.options.createUrl!, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n amount: params.amount,\n invoiceNumber: params.invoiceNumber,\n orderId: params.orderId,\n callbackUrl: this.options.callbackUrl || defaultCallback,\n payerReference: params.payerReference,\n metadata: params.metadata,\n }),\n });\n\n if (!res.ok) {\n throw new Error(`Failed to create payment session: HTTP ${res.status}`);\n }\n\n const data = (await res.json()) as {\n redirectUrl?: string;\n paymentId?: string;\n error?: string;\n };\n if (!data.redirectUrl || !data.paymentId) {\n throw new Error(data.error || 'Invalid session response from payment server.');\n }\n\n this.currentPaymentId = data.paymentId;\n this.setState('awaiting_user');\n\n // Launch bKash Hosted Checkout\n if (typeof window !== 'undefined' && window.location) {\n window.location.href = data.redirectUrl;\n }\n } catch (err: unknown) {\n const error = err instanceof Error ? err : new Error(String(err));\n const isTimeout =\n error.name === 'AbortError' ||\n error.name === 'TimeoutError' ||\n /timeout|abort/i.test(error.message);\n\n if (isTimeout) {\n // Under AUD-08: timeout / unknown outcome MUST display pending (\"do not pay again\")\n this.setState('pending');\n } else {\n this.setState('error');\n }\n\n this.options.onError?.(error);\n throw error;\n }\n }\n\n public reset(): void {\n this.currentPaymentId = null;\n this.setState('idle');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAqDO,MAAM,cAAN,MAAkB;AAAA,IAMvB,YAAY,SAA8B;AAL1C,0BAAQ,SAA0B;AAClC,0BAAQ;AACR,0BAAQ,oBAAkC;AAC1C,0BAAQ,aAAY,oBAAI,IAAuC;AAG7D,WAAK,UAAU;AAAA,QACb,WAAW;AAAA,QACX,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IA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new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
7
+
8
+ export { __require };
9
+ //# sourceMappingURL=chunk-DGUM43GV.js.map
10
+ //# sourceMappingURL=chunk-DGUM43GV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-DGUM43GV.js"}