pesafy 0.3.4 → 0.3.6

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.
@@ -3,10 +3,6 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
6
  var __copyProps = (to, from, except, desc) => {
11
7
  if (from && typeof from === "object" || typeof from === "function") {
12
8
  for (let key of __getOwnPropNames(from))
@@ -19,212 +15,5 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
15
 
20
16
  // src/components/react/index.tsx
21
17
  var index_exports = {};
22
- __export(index_exports, {
23
- PaymentButton: () => PaymentButton,
24
- PaymentForm: () => PaymentForm,
25
- PaymentStatus: () => PaymentStatus,
26
- QRCode: () => QRCode
27
- });
28
18
  module.exports = __toCommonJS(index_exports);
29
-
30
- // src/components/react/PaymentButton.tsx
31
- var import_jsx_runtime = require("react/jsx-runtime");
32
- function PaymentButton({
33
- amount,
34
- onPay,
35
- disabled = false,
36
- loading = false,
37
- children,
38
- className = ""
39
- }) {
40
- const handleClick = async () => {
41
- if (disabled || loading) return;
42
- await onPay({ amount });
43
- };
44
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
45
- "button",
46
- {
47
- type: "button",
48
- onClick: handleClick,
49
- disabled: disabled || loading,
50
- className: `pesafy-payment-btn ${className}`,
51
- "aria-busy": loading,
52
- children: loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "pesafy-payment-btn-loading", children: "Processing..." }) : children ?? `Pay KES ${amount.toLocaleString()}`
53
- }
54
- );
55
- }
56
-
57
- // src/components/react/PaymentForm.tsx
58
- var import_react = require("react");
59
- var import_jsx_runtime2 = require("react/jsx-runtime");
60
- function PaymentForm({
61
- onSubmit,
62
- defaultAmount = 0,
63
- defaultReference = "",
64
- disabled = false,
65
- loading = false,
66
- className = ""
67
- }) {
68
- const [amount, setAmount] = (0, import_react.useState)(defaultAmount.toString());
69
- const [phone, setPhone] = (0, import_react.useState)("");
70
- const [reference, setReference] = (0, import_react.useState)(defaultReference);
71
- const [desc, setDesc] = (0, import_react.useState)("Payment");
72
- const handleSubmit = async (e) => {
73
- e.preventDefault();
74
- if (disabled || loading) return;
75
- const amt = Number.parseFloat(amount);
76
- if (Number.isNaN(amt) || amt <= 0) return;
77
- const cleaned = phone.replace(/\D/g, "");
78
- if (cleaned.length < 9) return;
79
- await onSubmit({
80
- amount: amt,
81
- phoneNumber: phone,
82
- accountReference: reference || `REF-${Date.now()}`,
83
- transactionDesc: desc
84
- });
85
- };
86
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
87
- "form",
88
- {
89
- onSubmit: handleSubmit,
90
- className: `pesafy-payment-form ${className}`,
91
- children: [
92
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "pesafy-payment-form-field", children: [
93
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: "pesafy-amount", children: "Amount (KES)" }),
94
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
95
- "input",
96
- {
97
- id: "pesafy-amount",
98
- type: "number",
99
- min: "1",
100
- step: "0.01",
101
- value: amount,
102
- onChange: (e) => setAmount(e.target.value),
103
- placeholder: "100",
104
- disabled,
105
- required: true
106
- }
107
- )
108
- ] }),
109
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "pesafy-payment-form-field", children: [
110
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: "pesafy-phone", children: "M-Pesa Phone Number" }),
111
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
112
- "input",
113
- {
114
- id: "pesafy-phone",
115
- type: "tel",
116
- value: phone,
117
- onChange: (e) => setPhone(e.target.value),
118
- placeholder: "07XX XXX XXX or 2547XX XXX XXX",
119
- disabled,
120
- required: true
121
- }
122
- )
123
- ] }),
124
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "pesafy-payment-form-field", children: [
125
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: "pesafy-reference", children: "Reference" }),
126
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
127
- "input",
128
- {
129
- id: "pesafy-reference",
130
- type: "text",
131
- value: reference,
132
- onChange: (e) => setReference(e.target.value),
133
- placeholder: "ORDER-123",
134
- disabled,
135
- maxLength: 12
136
- }
137
- )
138
- ] }),
139
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "pesafy-payment-form-field", children: [
140
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: "pesafy-desc", children: "Description" }),
141
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
142
- "input",
143
- {
144
- id: "pesafy-desc",
145
- type: "text",
146
- value: desc,
147
- onChange: (e) => setDesc(e.target.value),
148
- placeholder: "Payment",
149
- disabled,
150
- maxLength: 13
151
- }
152
- )
153
- ] }),
154
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
155
- "button",
156
- {
157
- type: "submit",
158
- disabled: disabled || loading,
159
- className: "pesafy-payment-form-submit",
160
- "aria-busy": loading,
161
- children: loading ? "Processing..." : "Pay with M-Pesa"
162
- }
163
- )
164
- ]
165
- }
166
- );
167
- }
168
-
169
- // src/components/react/PaymentStatus.tsx
170
- var import_jsx_runtime3 = require("react/jsx-runtime");
171
- function PaymentStatus({
172
- status,
173
- message,
174
- transactionId,
175
- children,
176
- className = ""
177
- }) {
178
- if (status === "idle" && !children) return null;
179
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
180
- "div",
181
- {
182
- className: `pesafy-payment-status pesafy-payment-status--${status} ${className}`,
183
- role: "status",
184
- "aria-live": "polite",
185
- children: [
186
- status === "pending" && (children ?? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "Waiting for payment..." })),
187
- status === "success" && (children ?? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
188
- "Payment successful",
189
- transactionId && ` (${transactionId})`,
190
- message && ` - ${message}`
191
- ] })),
192
- status === "error" && (children ?? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
193
- "Payment failed",
194
- message && ` - ${message}`
195
- ] })),
196
- status === "idle" && children
197
- ]
198
- }
199
- );
200
- }
201
-
202
- // src/components/react/QRCode.tsx
203
- var import_jsx_runtime4 = require("react/jsx-runtime");
204
- function QRCode({
205
- base64,
206
- alt = "M-Pesa QR Code",
207
- size = 300,
208
- className = ""
209
- }) {
210
- const src = base64.startsWith("data:") ? base64 : `data:image/png;base64,${base64}`;
211
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
212
- "img",
213
- {
214
- src,
215
- alt,
216
- width: size,
217
- height: size,
218
- className: `pesafy-qrcode ${className}`,
219
- loading: "lazy"
220
- }
221
- );
222
- }
223
- // Annotate the CommonJS export names for ESM import in node:
224
- 0 && (module.exports = {
225
- PaymentButton,
226
- PaymentForm,
227
- PaymentStatus,
228
- QRCode
229
- });
230
19
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/react/index.tsx","../../../src/components/react/PaymentButton.tsx","../../../src/components/react/PaymentForm.tsx","../../../src/components/react/PaymentStatus.tsx","../../../src/components/react/QRCode.tsx"],"sourcesContent":["/**\n * Pesafy React Components\n * Use with your backend API - never expose Daraja credentials in the browser\n *\n * Import styles: import \"pesafy/components/react/styles.css\"\n */\n\nexport type { PaymentButtonProps } from \"./PaymentButton\";\nexport { PaymentButton } from \"./PaymentButton\";\nexport type { PaymentFormData, PaymentFormProps } from \"./PaymentForm\";\nexport { PaymentForm } from \"./PaymentForm\";\nexport type { PaymentStatusProps, PaymentStatusState } from \"./PaymentStatus\";\nexport { PaymentStatus } from \"./PaymentStatus\";\nexport type { QRCodeProps } from \"./QRCode\";\nexport { QRCode } from \"./QRCode\";\n","/**\n * PaymentButton - Trigger M-Pesa STK Push payment\n * Call onPay with payment details; parent handles API call (credentials stay server-side)\n */\n\nimport type { ReactNode } from \"react\";\n\nexport interface PaymentButtonProps {\n amount: number;\n /** Called when user clicks pay. Parent should call your backend which uses Pesafy */\n onPay: (params: { amount: number }) => void | Promise<void>;\n disabled?: boolean;\n loading?: boolean;\n children?: ReactNode;\n className?: string;\n}\n\nexport function PaymentButton({\n amount,\n onPay,\n disabled = false,\n loading = false,\n children,\n className = \"\",\n}: PaymentButtonProps) {\n const handleClick = async () => {\n if (disabled || loading) return;\n await onPay({ amount });\n };\n\n return (\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={disabled || loading}\n className={`pesafy-payment-btn ${className}`}\n aria-busy={loading}\n >\n {loading ? (\n <span className=\"pesafy-payment-btn-loading\">Processing...</span>\n ) : (\n (children ?? `Pay KES ${amount.toLocaleString()}`)\n )}\n </button>\n );\n}\n","/**\n * PaymentForm - Collect payment details for M-Pesa STK Push\n * Parent receives form data and handles API call (credentials stay server-side)\n */\n\nimport { type FormEvent, useState } from \"react\";\n\nexport interface PaymentFormData {\n amount: number;\n phoneNumber: string;\n accountReference: string;\n transactionDesc: string;\n}\n\nexport interface PaymentFormProps {\n /** Called on submit. Parent should call your backend which uses Pesafy stkPush */\n onSubmit: (data: PaymentFormData) => void | Promise<void>;\n defaultAmount?: number;\n defaultReference?: string;\n disabled?: boolean;\n loading?: boolean;\n className?: string;\n}\n\nexport function PaymentForm({\n onSubmit,\n defaultAmount = 0,\n defaultReference = \"\",\n disabled = false,\n loading = false,\n className = \"\",\n}: PaymentFormProps) {\n const [amount, setAmount] = useState(defaultAmount.toString());\n const [phone, setPhone] = useState(\"\");\n const [reference, setReference] = useState(defaultReference);\n const [desc, setDesc] = useState(\"Payment\");\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n if (disabled || loading) return;\n\n const amt = Number.parseFloat(amount);\n if (Number.isNaN(amt) || amt <= 0) return;\n\n const cleaned = phone.replace(/\\D/g, \"\");\n if (cleaned.length < 9) return;\n\n await onSubmit({\n amount: amt,\n phoneNumber: phone,\n accountReference: reference || `REF-${Date.now()}`,\n transactionDesc: desc,\n });\n };\n\n return (\n <form\n onSubmit={handleSubmit}\n className={`pesafy-payment-form ${className}`}\n >\n <div className=\"pesafy-payment-form-field\">\n <label htmlFor=\"pesafy-amount\">Amount (KES)</label>\n <input\n id=\"pesafy-amount\"\n type=\"number\"\n min=\"1\"\n step=\"0.01\"\n value={amount}\n onChange={(e) => setAmount((e.target as HTMLInputElement).value)}\n placeholder=\"100\"\n disabled={disabled}\n required\n />\n </div>\n <div className=\"pesafy-payment-form-field\">\n <label htmlFor=\"pesafy-phone\">M-Pesa Phone Number</label>\n <input\n id=\"pesafy-phone\"\n type=\"tel\"\n value={phone}\n onChange={(e) => setPhone((e.target as HTMLInputElement).value)}\n placeholder=\"07XX XXX XXX or 2547XX XXX XXX\"\n disabled={disabled}\n required\n />\n </div>\n <div className=\"pesafy-payment-form-field\">\n <label htmlFor=\"pesafy-reference\">Reference</label>\n <input\n id=\"pesafy-reference\"\n type=\"text\"\n value={reference}\n onChange={(e) => setReference((e.target as HTMLInputElement).value)}\n placeholder=\"ORDER-123\"\n disabled={disabled}\n maxLength={12}\n />\n </div>\n <div className=\"pesafy-payment-form-field\">\n <label htmlFor=\"pesafy-desc\">Description</label>\n <input\n id=\"pesafy-desc\"\n type=\"text\"\n value={desc}\n onChange={(e) => setDesc((e.target as HTMLInputElement).value)}\n placeholder=\"Payment\"\n disabled={disabled}\n maxLength={13}\n />\n </div>\n <button\n type=\"submit\"\n disabled={disabled || loading}\n className=\"pesafy-payment-form-submit\"\n aria-busy={loading}\n >\n {loading ? \"Processing...\" : \"Pay with M-Pesa\"}\n </button>\n </form>\n );\n}\n","/**\n * PaymentStatus - Display payment state (pending, success, failed)\n */\n\nimport type { ReactNode } from \"react\";\n\nexport type PaymentStatusState = \"idle\" | \"pending\" | \"success\" | \"error\";\n\nexport interface PaymentStatusProps {\n status: PaymentStatusState;\n /** Optional message for success/error states */\n message?: string;\n /** Optional transaction/callback data */\n transactionId?: string;\n children?: ReactNode;\n className?: string;\n}\n\nexport function PaymentStatus({\n status,\n message,\n transactionId,\n children,\n className = \"\",\n}: PaymentStatusProps) {\n if (status === \"idle\" && !children) return null;\n\n return (\n <div\n className={`pesafy-payment-status pesafy-payment-status--${status} ${className}`}\n role=\"status\"\n aria-live=\"polite\"\n >\n {status === \"pending\" &&\n (children ?? <span>Waiting for payment...</span>)}\n {status === \"success\" &&\n (children ?? (\n <span>\n Payment successful\n {transactionId && ` (${transactionId})`}\n {message && ` - ${message}`}\n </span>\n ))}\n {status === \"error\" &&\n (children ?? (\n <span>\n Payment failed\n {message && ` - ${message}`}\n </span>\n ))}\n {status === \"idle\" && children}\n </div>\n );\n}\n","/**\n * QRCode - Display M-Pesa Dynamic QR code\n * Pass base64 image from mpesa.qrCode() response\n */\n\nexport interface QRCodeProps {\n /** Base64 QR code image from Dynamic QR API */\n base64: string;\n alt?: string;\n size?: number;\n className?: string;\n}\n\nexport function QRCode({\n base64,\n alt = \"M-Pesa QR Code\",\n size = 300,\n className = \"\",\n}: QRCodeProps) {\n const src = base64.startsWith(\"data:\")\n ? base64\n : `data:image/png;base64,${base64}`;\n\n return (\n <img\n src={src}\n alt={alt}\n width={size}\n height={size}\n className={`pesafy-qrcode ${className}`}\n loading=\"lazy\"\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACuCQ;AAtBD,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,UAAU;AAAA,EACV;AAAA,EACA,YAAY;AACd,GAAuB;AACrB,QAAM,cAAc,YAAY;AAC9B,QAAI,YAAY,QAAS;AACzB,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AEV,oBAAU,kBAAkB;AAAA;AAAA,QAC/B;AAAA;AAAA;AAAA,EACF;AAEJ;;;ACtFqB,IAAAC,sBAAA;AAhBd,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AACd,GAAuB;AACrB,MAAI,WAAW,UAAU,CAAC,SAAU,QAAO;AAE3C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,gDAAgD,MAAM,IAAI,SAAS;AAAA,MAC9E,MAAK;AAAA,MACL,aAAU;AAAA,MAET;AAAA,mBAAW,cACT,YAAY,6CAAC,UAAK,oCAAsB;AAAA,QAC1C,WAAW,cACT,YACC,8CAAC,UAAK;AAAA;AAAA,UAEH,iBAAiB,KAAK,aAAa;AAAA,UACnC,WAAW,MAAM,OAAO;AAAA,WAC3B;AAAA,QAEH,WAAW,YACT,YACC,8CAAC,UAAK;AAAA;AAAA,UAEH,WAAW,MAAM,OAAO;AAAA,WAC3B;AAAA,QAEH,WAAW,UAAU;AAAA;AAAA;AAAA,EACxB;AAEJ;;;AC7BI,IAAAC,sBAAA;AAXG,SAAS,OAAO;AAAA,EACrB;AAAA,EACA,MAAM;AAAA,EACN,OAAO;AAAA,EACP,YAAY;AACd,GAAgB;AACd,QAAM,MAAM,OAAO,WAAW,OAAO,IACjC,SACA,yBAAyB,MAAM;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,WAAW,iBAAiB,SAAS;AAAA,MACrC,SAAQ;AAAA;AAAA,EACV;AAEJ;","names":["import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
1
+ {"version":3,"sources":["../../../src/components/react/index.tsx"],"sourcesContent":["// Stub — React components not included in this package version.\nexport {};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,63 +1,2 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode } from 'react';
3
1
 
4
- interface PaymentButtonProps {
5
- amount: number;
6
- /** Called when user clicks pay. Parent should call your backend which uses Pesafy */
7
- onPay: (params: {
8
- amount: number;
9
- }) => void | Promise<void>;
10
- disabled?: boolean;
11
- loading?: boolean;
12
- children?: ReactNode;
13
- className?: string;
14
- }
15
- declare function PaymentButton({ amount, onPay, disabled, loading, children, className, }: PaymentButtonProps): react_jsx_runtime.JSX.Element;
16
-
17
- /**
18
- * PaymentForm - Collect payment details for M-Pesa STK Push
19
- * Parent receives form data and handles API call (credentials stay server-side)
20
- */
21
- interface PaymentFormData {
22
- amount: number;
23
- phoneNumber: string;
24
- accountReference: string;
25
- transactionDesc: string;
26
- }
27
- interface PaymentFormProps {
28
- /** Called on submit. Parent should call your backend which uses Pesafy stkPush */
29
- onSubmit: (data: PaymentFormData) => void | Promise<void>;
30
- defaultAmount?: number;
31
- defaultReference?: string;
32
- disabled?: boolean;
33
- loading?: boolean;
34
- className?: string;
35
- }
36
- declare function PaymentForm({ onSubmit, defaultAmount, defaultReference, disabled, loading, className, }: PaymentFormProps): react_jsx_runtime.JSX.Element;
37
-
38
- type PaymentStatusState = "idle" | "pending" | "success" | "error";
39
- interface PaymentStatusProps {
40
- status: PaymentStatusState;
41
- /** Optional message for success/error states */
42
- message?: string;
43
- /** Optional transaction/callback data */
44
- transactionId?: string;
45
- children?: ReactNode;
46
- className?: string;
47
- }
48
- declare function PaymentStatus({ status, message, transactionId, children, className, }: PaymentStatusProps): react_jsx_runtime.JSX.Element | null;
49
-
50
- /**
51
- * QRCode - Display M-Pesa Dynamic QR code
52
- * Pass base64 image from mpesa.qrCode() response
53
- */
54
- interface QRCodeProps {
55
- /** Base64 QR code image from Dynamic QR API */
56
- base64: string;
57
- alt?: string;
58
- size?: number;
59
- className?: string;
60
- }
61
- declare function QRCode({ base64, alt, size, className, }: QRCodeProps): react_jsx_runtime.JSX.Element;
62
-
63
- export { PaymentButton, type PaymentButtonProps, PaymentForm, type PaymentFormData, type PaymentFormProps, PaymentStatus, type PaymentStatusProps, type PaymentStatusState, QRCode, type QRCodeProps };
2
+ export { }
@@ -1,63 +1,2 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode } from 'react';
3
1
 
4
- interface PaymentButtonProps {
5
- amount: number;
6
- /** Called when user clicks pay. Parent should call your backend which uses Pesafy */
7
- onPay: (params: {
8
- amount: number;
9
- }) => void | Promise<void>;
10
- disabled?: boolean;
11
- loading?: boolean;
12
- children?: ReactNode;
13
- className?: string;
14
- }
15
- declare function PaymentButton({ amount, onPay, disabled, loading, children, className, }: PaymentButtonProps): react_jsx_runtime.JSX.Element;
16
-
17
- /**
18
- * PaymentForm - Collect payment details for M-Pesa STK Push
19
- * Parent receives form data and handles API call (credentials stay server-side)
20
- */
21
- interface PaymentFormData {
22
- amount: number;
23
- phoneNumber: string;
24
- accountReference: string;
25
- transactionDesc: string;
26
- }
27
- interface PaymentFormProps {
28
- /** Called on submit. Parent should call your backend which uses Pesafy stkPush */
29
- onSubmit: (data: PaymentFormData) => void | Promise<void>;
30
- defaultAmount?: number;
31
- defaultReference?: string;
32
- disabled?: boolean;
33
- loading?: boolean;
34
- className?: string;
35
- }
36
- declare function PaymentForm({ onSubmit, defaultAmount, defaultReference, disabled, loading, className, }: PaymentFormProps): react_jsx_runtime.JSX.Element;
37
-
38
- type PaymentStatusState = "idle" | "pending" | "success" | "error";
39
- interface PaymentStatusProps {
40
- status: PaymentStatusState;
41
- /** Optional message for success/error states */
42
- message?: string;
43
- /** Optional transaction/callback data */
44
- transactionId?: string;
45
- children?: ReactNode;
46
- className?: string;
47
- }
48
- declare function PaymentStatus({ status, message, transactionId, children, className, }: PaymentStatusProps): react_jsx_runtime.JSX.Element | null;
49
-
50
- /**
51
- * QRCode - Display M-Pesa Dynamic QR code
52
- * Pass base64 image from mpesa.qrCode() response
53
- */
54
- interface QRCodeProps {
55
- /** Base64 QR code image from Dynamic QR API */
56
- base64: string;
57
- alt?: string;
58
- size?: number;
59
- className?: string;
60
- }
61
- declare function QRCode({ base64, alt, size, className, }: QRCodeProps): react_jsx_runtime.JSX.Element;
62
-
63
- export { PaymentButton, type PaymentButtonProps, PaymentForm, type PaymentFormData, type PaymentFormProps, PaymentStatus, type PaymentStatusProps, type PaymentStatusState, QRCode, type QRCodeProps };
2
+ export { }
@@ -1,200 +1 @@
1
- // src/components/react/PaymentButton.tsx
2
- import { jsx } from "react/jsx-runtime";
3
- function PaymentButton({
4
- amount,
5
- onPay,
6
- disabled = false,
7
- loading = false,
8
- children,
9
- className = ""
10
- }) {
11
- const handleClick = async () => {
12
- if (disabled || loading) return;
13
- await onPay({ amount });
14
- };
15
- return /* @__PURE__ */ jsx(
16
- "button",
17
- {
18
- type: "button",
19
- onClick: handleClick,
20
- disabled: disabled || loading,
21
- className: `pesafy-payment-btn ${className}`,
22
- "aria-busy": loading,
23
- children: loading ? /* @__PURE__ */ jsx("span", { className: "pesafy-payment-btn-loading", children: "Processing..." }) : children ?? `Pay KES ${amount.toLocaleString()}`
24
- }
25
- );
26
- }
27
-
28
- // src/components/react/PaymentForm.tsx
29
- import { useState } from "react";
30
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
31
- function PaymentForm({
32
- onSubmit,
33
- defaultAmount = 0,
34
- defaultReference = "",
35
- disabled = false,
36
- loading = false,
37
- className = ""
38
- }) {
39
- const [amount, setAmount] = useState(defaultAmount.toString());
40
- const [phone, setPhone] = useState("");
41
- const [reference, setReference] = useState(defaultReference);
42
- const [desc, setDesc] = useState("Payment");
43
- const handleSubmit = async (e) => {
44
- e.preventDefault();
45
- if (disabled || loading) return;
46
- const amt = Number.parseFloat(amount);
47
- if (Number.isNaN(amt) || amt <= 0) return;
48
- const cleaned = phone.replace(/\D/g, "");
49
- if (cleaned.length < 9) return;
50
- await onSubmit({
51
- amount: amt,
52
- phoneNumber: phone,
53
- accountReference: reference || `REF-${Date.now()}`,
54
- transactionDesc: desc
55
- });
56
- };
57
- return /* @__PURE__ */ jsxs(
58
- "form",
59
- {
60
- onSubmit: handleSubmit,
61
- className: `pesafy-payment-form ${className}`,
62
- children: [
63
- /* @__PURE__ */ jsxs("div", { className: "pesafy-payment-form-field", children: [
64
- /* @__PURE__ */ jsx2("label", { htmlFor: "pesafy-amount", children: "Amount (KES)" }),
65
- /* @__PURE__ */ jsx2(
66
- "input",
67
- {
68
- id: "pesafy-amount",
69
- type: "number",
70
- min: "1",
71
- step: "0.01",
72
- value: amount,
73
- onChange: (e) => setAmount(e.target.value),
74
- placeholder: "100",
75
- disabled,
76
- required: true
77
- }
78
- )
79
- ] }),
80
- /* @__PURE__ */ jsxs("div", { className: "pesafy-payment-form-field", children: [
81
- /* @__PURE__ */ jsx2("label", { htmlFor: "pesafy-phone", children: "M-Pesa Phone Number" }),
82
- /* @__PURE__ */ jsx2(
83
- "input",
84
- {
85
- id: "pesafy-phone",
86
- type: "tel",
87
- value: phone,
88
- onChange: (e) => setPhone(e.target.value),
89
- placeholder: "07XX XXX XXX or 2547XX XXX XXX",
90
- disabled,
91
- required: true
92
- }
93
- )
94
- ] }),
95
- /* @__PURE__ */ jsxs("div", { className: "pesafy-payment-form-field", children: [
96
- /* @__PURE__ */ jsx2("label", { htmlFor: "pesafy-reference", children: "Reference" }),
97
- /* @__PURE__ */ jsx2(
98
- "input",
99
- {
100
- id: "pesafy-reference",
101
- type: "text",
102
- value: reference,
103
- onChange: (e) => setReference(e.target.value),
104
- placeholder: "ORDER-123",
105
- disabled,
106
- maxLength: 12
107
- }
108
- )
109
- ] }),
110
- /* @__PURE__ */ jsxs("div", { className: "pesafy-payment-form-field", children: [
111
- /* @__PURE__ */ jsx2("label", { htmlFor: "pesafy-desc", children: "Description" }),
112
- /* @__PURE__ */ jsx2(
113
- "input",
114
- {
115
- id: "pesafy-desc",
116
- type: "text",
117
- value: desc,
118
- onChange: (e) => setDesc(e.target.value),
119
- placeholder: "Payment",
120
- disabled,
121
- maxLength: 13
122
- }
123
- )
124
- ] }),
125
- /* @__PURE__ */ jsx2(
126
- "button",
127
- {
128
- type: "submit",
129
- disabled: disabled || loading,
130
- className: "pesafy-payment-form-submit",
131
- "aria-busy": loading,
132
- children: loading ? "Processing..." : "Pay with M-Pesa"
133
- }
134
- )
135
- ]
136
- }
137
- );
138
- }
139
-
140
- // src/components/react/PaymentStatus.tsx
141
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
142
- function PaymentStatus({
143
- status,
144
- message,
145
- transactionId,
146
- children,
147
- className = ""
148
- }) {
149
- if (status === "idle" && !children) return null;
150
- return /* @__PURE__ */ jsxs2(
151
- "div",
152
- {
153
- className: `pesafy-payment-status pesafy-payment-status--${status} ${className}`,
154
- role: "status",
155
- "aria-live": "polite",
156
- children: [
157
- status === "pending" && (children ?? /* @__PURE__ */ jsx3("span", { children: "Waiting for payment..." })),
158
- status === "success" && (children ?? /* @__PURE__ */ jsxs2("span", { children: [
159
- "Payment successful",
160
- transactionId && ` (${transactionId})`,
161
- message && ` - ${message}`
162
- ] })),
163
- status === "error" && (children ?? /* @__PURE__ */ jsxs2("span", { children: [
164
- "Payment failed",
165
- message && ` - ${message}`
166
- ] })),
167
- status === "idle" && children
168
- ]
169
- }
170
- );
171
- }
172
-
173
- // src/components/react/QRCode.tsx
174
- import { jsx as jsx4 } from "react/jsx-runtime";
175
- function QRCode({
176
- base64,
177
- alt = "M-Pesa QR Code",
178
- size = 300,
179
- className = ""
180
- }) {
181
- const src = base64.startsWith("data:") ? base64 : `data:image/png;base64,${base64}`;
182
- return /* @__PURE__ */ jsx4(
183
- "img",
184
- {
185
- src,
186
- alt,
187
- width: size,
188
- height: size,
189
- className: `pesafy-qrcode ${className}`,
190
- loading: "lazy"
191
- }
192
- );
193
- }
194
- export {
195
- PaymentButton,
196
- PaymentForm,
197
- PaymentStatus,
198
- QRCode
199
- };
200
1
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/react/PaymentButton.tsx","../../../src/components/react/PaymentForm.tsx","../../../src/components/react/PaymentStatus.tsx","../../../src/components/react/QRCode.tsx"],"sourcesContent":["/**\n * PaymentButton - Trigger M-Pesa STK Push payment\n * Call onPay with payment details; parent handles API call (credentials stay server-side)\n */\n\nimport type { ReactNode } from \"react\";\n\nexport interface PaymentButtonProps {\n amount: number;\n /** Called when user clicks pay. Parent should call your backend which uses Pesafy */\n onPay: (params: { amount: number }) => void | Promise<void>;\n disabled?: boolean;\n loading?: boolean;\n children?: ReactNode;\n className?: string;\n}\n\nexport function PaymentButton({\n amount,\n onPay,\n disabled = false,\n loading = false,\n children,\n className = \"\",\n}: PaymentButtonProps) {\n const handleClick = async () => {\n if (disabled || loading) return;\n await onPay({ amount });\n };\n\n return (\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={disabled || loading}\n className={`pesafy-payment-btn ${className}`}\n aria-busy={loading}\n >\n {loading ? (\n <span className=\"pesafy-payment-btn-loading\">Processing...</span>\n ) : (\n (children ?? `Pay KES ${amount.toLocaleString()}`)\n )}\n </button>\n );\n}\n","/**\n * PaymentForm - Collect payment details for M-Pesa STK Push\n * Parent receives form data and handles API call (credentials stay server-side)\n */\n\nimport { type FormEvent, useState } from \"react\";\n\nexport interface PaymentFormData {\n amount: number;\n phoneNumber: string;\n accountReference: string;\n transactionDesc: string;\n}\n\nexport interface PaymentFormProps {\n /** Called on submit. Parent should call your backend which uses Pesafy stkPush */\n onSubmit: (data: PaymentFormData) => void | Promise<void>;\n defaultAmount?: number;\n defaultReference?: string;\n disabled?: boolean;\n loading?: boolean;\n className?: string;\n}\n\nexport function PaymentForm({\n onSubmit,\n defaultAmount = 0,\n defaultReference = \"\",\n disabled = false,\n loading = false,\n className = \"\",\n}: PaymentFormProps) {\n const [amount, setAmount] = useState(defaultAmount.toString());\n const [phone, setPhone] = useState(\"\");\n const [reference, setReference] = useState(defaultReference);\n const [desc, setDesc] = useState(\"Payment\");\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n if (disabled || loading) return;\n\n const amt = Number.parseFloat(amount);\n if (Number.isNaN(amt) || amt <= 0) return;\n\n const cleaned = phone.replace(/\\D/g, \"\");\n if (cleaned.length < 9) return;\n\n await onSubmit({\n amount: amt,\n phoneNumber: phone,\n accountReference: reference || `REF-${Date.now()}`,\n transactionDesc: desc,\n });\n };\n\n return (\n <form\n onSubmit={handleSubmit}\n className={`pesafy-payment-form ${className}`}\n >\n <div className=\"pesafy-payment-form-field\">\n <label htmlFor=\"pesafy-amount\">Amount (KES)</label>\n <input\n id=\"pesafy-amount\"\n type=\"number\"\n min=\"1\"\n step=\"0.01\"\n value={amount}\n onChange={(e) => setAmount((e.target as HTMLInputElement).value)}\n placeholder=\"100\"\n disabled={disabled}\n required\n />\n </div>\n <div className=\"pesafy-payment-form-field\">\n <label htmlFor=\"pesafy-phone\">M-Pesa Phone Number</label>\n <input\n id=\"pesafy-phone\"\n type=\"tel\"\n value={phone}\n onChange={(e) => setPhone((e.target as HTMLInputElement).value)}\n placeholder=\"07XX XXX XXX or 2547XX XXX XXX\"\n disabled={disabled}\n required\n />\n </div>\n <div className=\"pesafy-payment-form-field\">\n <label htmlFor=\"pesafy-reference\">Reference</label>\n <input\n id=\"pesafy-reference\"\n type=\"text\"\n value={reference}\n onChange={(e) => setReference((e.target as HTMLInputElement).value)}\n placeholder=\"ORDER-123\"\n disabled={disabled}\n maxLength={12}\n />\n </div>\n <div className=\"pesafy-payment-form-field\">\n <label htmlFor=\"pesafy-desc\">Description</label>\n <input\n id=\"pesafy-desc\"\n type=\"text\"\n value={desc}\n onChange={(e) => setDesc((e.target as HTMLInputElement).value)}\n placeholder=\"Payment\"\n disabled={disabled}\n maxLength={13}\n />\n </div>\n <button\n type=\"submit\"\n disabled={disabled || loading}\n className=\"pesafy-payment-form-submit\"\n aria-busy={loading}\n >\n {loading ? \"Processing...\" : \"Pay with M-Pesa\"}\n </button>\n </form>\n );\n}\n","/**\n * PaymentStatus - Display payment state (pending, success, failed)\n */\n\nimport type { ReactNode } from \"react\";\n\nexport type PaymentStatusState = \"idle\" | \"pending\" | \"success\" | \"error\";\n\nexport interface PaymentStatusProps {\n status: PaymentStatusState;\n /** Optional message for success/error states */\n message?: string;\n /** Optional transaction/callback data */\n transactionId?: string;\n children?: ReactNode;\n className?: string;\n}\n\nexport function PaymentStatus({\n status,\n message,\n transactionId,\n children,\n className = \"\",\n}: PaymentStatusProps) {\n if (status === \"idle\" && !children) return null;\n\n return (\n <div\n className={`pesafy-payment-status pesafy-payment-status--${status} ${className}`}\n role=\"status\"\n aria-live=\"polite\"\n >\n {status === \"pending\" &&\n (children ?? <span>Waiting for payment...</span>)}\n {status === \"success\" &&\n (children ?? (\n <span>\n Payment successful\n {transactionId && ` (${transactionId})`}\n {message && ` - ${message}`}\n </span>\n ))}\n {status === \"error\" &&\n (children ?? (\n <span>\n Payment failed\n {message && ` - ${message}`}\n </span>\n ))}\n {status === \"idle\" && children}\n </div>\n );\n}\n","/**\n * QRCode - Display M-Pesa Dynamic QR code\n * Pass base64 image from mpesa.qrCode() response\n */\n\nexport interface QRCodeProps {\n /** Base64 QR code image from Dynamic QR API */\n base64: string;\n alt?: string;\n size?: number;\n className?: string;\n}\n\nexport function QRCode({\n base64,\n alt = \"M-Pesa QR Code\",\n size = 300,\n className = \"\",\n}: QRCodeProps) {\n const src = base64.startsWith(\"data:\")\n ? base64\n : `data:image/png;base64,${base64}`;\n\n return (\n <img\n src={src}\n alt={alt}\n width={size}\n height={size}\n className={`pesafy-qrcode ${className}`}\n loading=\"lazy\"\n />\n );\n}\n"],"mappings":";AAuCQ;AAtBD,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,UAAU;AAAA,EACV;AAAA,EACA,YAAY;AACd,GAAuB;AACrB,QAAM,cAAc,YAAY;AAC9B,QAAI,YAAY,QAAS;AACzB,UAAM,MAAM,EAAE,OAAO,CAAC;AAAA,EACxB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS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