remita-inline 0.1.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.
- package/LICENSE +21 -0
- package/README.md +308 -0
- package/dist/index.cjs +371 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +102 -0
- package/dist/index.d.ts +102 -0
- package/dist/index.js +360 -0
- package/dist/index.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/constant.ts","../src/utils/once.ts","../src/utils/errors.ts","../src/core/loader.ts","../src/core/engine.ts","../src/core/validator.ts","../src/core/payment.ts","../src/hooks/useRemitaInline.ts","../src/components/RemitaPayButton.tsx"],"names":["isBrowserEnvironment","useState","useCallback","jsx"],"mappings":";;;;;;AAAO,IAAM,gBAAA,GAAmB,mBAAA;AAEzB,IAAM,4BAAA,GACX;AAEK,IAAM,sBAAA,GACX;AAEK,IAAM,iBAAA,GAAoB,4BAAA;AAE1B,IAAM,aAAA,GAAgB,iBAAA;;;ACV7B,IAAI,OAAA,GAAgC,IAAA;AAE7B,SAAS,UAAA,GAAa;AAC3B,EAAA,OAAO,OAAA;AACT;AAEO,SAAS,WAAW,KAAA,EAAsB;AAC/C,EAAA,OAAA,GAAU,KAAA;AACZ;AAEO,SAAS,YAAA,GAAe;AAC7B,EAAA,OAAA,GAAU,IAAA;AACZ;;;ACZO,IAAM,WAAA,GAAN,cAA0B,KAAA,CAAM;AAAA,EACrC,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,aAAA;AAAA,EACd;AACF,CAAA;AAEO,IAAM,eAAA,GAAN,cAA8B,WAAA,CAAY;AAAA,EAC/C,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,iBAAA;AAAA,EACd;AACF,CAAA;AAEO,I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EAAK,SAAA,EAAU,GAAI,eAAA,EAAgB;AAE3C,EAAA,MAAM,WAAA,GAAcA,iBAAAA;AAAA,IAClB,OAAO,KAAA,KAAyC;AAC9C,MAAA,OAAA,GAAU,KAAK,CAAA;AAEf,MAAA,IAAI,KAAA,CAAM,oBAAoB,SAAA,EAAW;AACvC,QAAA;AAAA,MACF;AAEA,MAAA,cAAA,IAAiB;AAEjB,MAAA,IAAI;AACF,QAAA,MAAM,GAAA,CAAI,eAAe,cAAc,CAAA;AAAA,MACzC,SAAS,KAAA,EAAO;AACd,QAAA,IAAI,cAAA,EAAgB;AAClB,UAAA,cAAA,CAAe,iBAAiB,KAAA,GAAQ,KAAA,GAAQ,IAAI,KAAA,CAAM,iBAAiB,CAAC,CAAA;AAAA,QAC9E;AAAA,MACF;AAAA,IACF,CAAA;AAAA,IACA,CAAC,SAAA,EAAW,OAAA,EAAS,gBAAgB,cAAA,EAAgB,GAAA,EAAK,eAAe,cAAc;AAAA,GACzF;AAEA,EAAA,uBACEC,cAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACJ,GAAG,KAAA;AAAA,MACJ,UAAU,QAAA,IAAY,SAAA;AAAA,MACtB,OAAA,EAAS,WAAA;AAAA,MAER,QAAA,EAAA,SAAA,GAAY,cAAc,QAAA,IAAY;AAAA;AAAA,GACzC;AAEJ","file":"index.cjs","sourcesContent":["export const REMITA_SCRIPT_ID = \"remita-inline-sdk\";\n\nexport const REMITA_PRODUCTION_SCRIPT_URL =\n \"https://login.remita.net/payment/v1/remita-pay-inline.bundle.js\";\n\nexport const REMITA_DEMO_SCRIPT_URL =\n \"https://demo.remita.net/payment/v1/remita-pay-inline.bundle.js\";\n\nexport const REMITA_SCRIPT_URL = REMITA_PRODUCTION_SCRIPT_URL;\n\nexport const REMITA_ENGINE = \"RmPaymentEngine\";\n","let promise: Promise<void> | null = null;\n\nexport function getPromise() {\n return promise;\n}\n\nexport function setPromise(value: Promise<void>) {\n promise = value;\n}\n\nexport function clearPromise() {\n promise = null;\n}\n","export class RemitaError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"RemitaError\";\n }\n}\n\nexport class ValidationError extends RemitaError {\n constructor(message: string) {\n super(message);\n this.name = \"ValidationError\";\n }\n}\n\nexport class ScriptLoadError extends RemitaError {\n constructor(message: string) {\n super(message);\n this.name = \"ScriptLoadError\";\n }\n}\n\nexport class EngineError extends RemitaError {\n constructor(message: string) {\n super(message);\n this.name = \"EngineError\";\n }\n}\n","import {\n\tREMITA_DEMO_SCRIPT_URL,\n\tREMITA_ENGINE,\n\tREMITA_PRODUCTION_SCRIPT_URL,\n\tREMITA_SCRIPT_ID,\n\tREMITA_SCRIPT_URL,\n} from \"./constant\";\nimport { clearPromise, getPromise, setPromise } from \"../utils/once\";\nimport { ScriptLoadError } from \"../utils/errors\";\nimport type { RemitaGlobalWindow } from \"../types\";\nimport type { RemitaLibraryOptions } from \"../types/public\";\n\nfunction isBrowserEnvironment(): boolean {\n\treturn typeof window !== \"undefined\" && typeof document !== \"undefined\";\n}\n\nfunction getEngine(win: RemitaGlobalWindow): unknown {\n\treturn win[REMITA_ENGINE as keyof RemitaGlobalWindow];\n}\n\nfunction resolveScriptUrl(options: RemitaLibraryOptions): string {\n\tif (options.scriptUrl) {\n\t\treturn options.scriptUrl;\n\t}\n\n\tif (options.environment === \"demo\") {\n\t\treturn REMITA_DEMO_SCRIPT_URL;\n\t}\n\n\tif (options.environment === \"production\") {\n\t\treturn REMITA_PRODUCTION_SCRIPT_URL;\n\t}\n\n\treturn REMITA_SCRIPT_URL;\n}\n\nfunction waitForExistingScript(\n\tscript: HTMLScriptElement,\n\ttimeoutMs: number,\n\twin: RemitaGlobalWindow,\n): Promise<void> {\n\tif (script.dataset.loaded === \"true\" && getEngine(win)) {\n\t\treturn Promise.resolve();\n\t}\n\n\treturn new Promise<void>((resolve, reject) => {\n\t\tlet timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n\t\tconst onLoad = () => {\n\t\t\tcleanup();\n\t\t\tscript.dataset.loaded = \"true\";\n\n\t\t\tif (!getEngine(win)) {\n\t\t\t\treject(new ScriptLoadError(\"Remita script loaded but payment engine is unavailable.\"));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolve();\n\t\t};\n\n\t\tconst onError = () => {\n\t\t\tcleanup();\n\t\t\treject(new ScriptLoadError(\"Failed to load Remita script.\"));\n\t\t};\n\n\t\tconst cleanup = () => {\n\t\t\tscript.removeEventListener(\"load\", onLoad);\n\t\t\tscript.removeEventListener(\"error\", onError);\n\t\t\tif (timeoutId) {\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t}\n\t\t};\n\n\t\tscript.addEventListener(\"load\", onLoad, { once: true });\n\t\tscript.addEventListener(\"error\", onError, { once: true });\n\n\t\ttimeoutId = setTimeout(() => {\n\t\t\tcleanup();\n\t\t\treject(new ScriptLoadError(`Timed out waiting for Remita script after ${timeoutMs}ms.`));\n\t\t}, timeoutMs);\n\t});\n}\n\nfunction createAndLoadScript(\n\tscriptId: string,\n\tscriptUrl: string,\n\ttimeoutMs: number,\n\tnonce?: string,\n): Promise<void> {\n\tconst win = window as RemitaGlobalWindow;\n\n\treturn new Promise<void>((resolve, reject) => {\n\t\tconst script = document.createElement(\"script\");\n\t\tlet timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n\t\tscript.id = scriptId;\n\t\tscript.src = scriptUrl;\n\t\tscript.async = true;\n\n\t\tif (nonce) {\n\t\t\tscript.nonce = nonce;\n\t\t}\n\n\t\tconst onLoad = () => {\n\t\t\tcleanup();\n\t\t\tscript.dataset.loaded = \"true\";\n\n\t\t\tif (!getEngine(win)) {\n\t\t\t\treject(new ScriptLoadError(\"Remita script loaded but payment engine is unavailable.\"));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolve();\n\t\t};\n\n\t\tconst onError = () => {\n\t\t\tcleanup();\n\t\t\treject(new ScriptLoadError(\"Failed to load Remita script.\"));\n\t\t};\n\n\t\tconst cleanup = () => {\n\t\t\tscript.removeEventListener(\"load\", onLoad);\n\t\t\tscript.removeEventListener(\"error\", onError);\n\t\t\tif (timeoutId) {\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t}\n\t\t};\n\n\t\tscript.addEventListener(\"load\", onLoad, { once: true });\n\t\tscript.addEventListener(\"error\", onError, { once: true });\n\n\t\ttimeoutId = setTimeout(() => {\n\t\t\tcleanup();\n\t\t\tscript.remove();\n\t\t\treject(new ScriptLoadError(`Timed out loading Remita script after ${timeoutMs}ms.`));\n\t\t}, timeoutMs);\n\n\t\tdocument.head.appendChild(script);\n\t});\n}\n\nexport async function loadRemitaScript(options: RemitaLibraryOptions = {}): Promise<void> {\n\tif (!isBrowserEnvironment()) {\n\t\tthrow new ScriptLoadError(\"Remita script loader can only run in a browser environment.\");\n\t}\n\n\tconst scriptId = options.scriptId ?? REMITA_SCRIPT_ID;\n\tconst scriptUrl = resolveScriptUrl(options);\n\tconst timeoutMs = options.timeoutMs ?? 15000;\n\tconst win = window as RemitaGlobalWindow;\n\n\tif (getEngine(win)) {\n\t\treturn;\n\t}\n\n\tconst inFlight = getPromise();\n\tif (inFlight) {\n\t\treturn inFlight;\n\t}\n\n\tconst task = (async () => {\n\t\tconst existingScript = document.getElementById(scriptId) as HTMLScriptElement | null;\n\n\t\tif (existingScript) {\n\t\t\tif (existingScript.src && existingScript.src !== scriptUrl) {\n\t\t\t\tthrow new ScriptLoadError(\n\t\t\t\t\t`Script with id \\\"${scriptId}\\\" already exists with a different src.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tawait waitForExistingScript(existingScript, timeoutMs, win);\n\t\t\treturn;\n\t\t}\n\n\t\tawait createAndLoadScript(scriptId, scriptUrl, timeoutMs, options.nonce);\n\t})();\n\n\tsetPromise(task);\n\n\ttry {\n\t\tawait task;\n\t} catch (error) {\n\t\tclearPromise();\n\t\tthrow error;\n\t}\n}\n","import { REMITA_ENGINE } from \"./constant\";\nimport { EngineError } from \"../utils/errors\";\nimport type { RemitaExtendedData } from \"../types\";\nimport type {\n\tRemitaEngine,\n\tRemitaEnginePaymentConfig,\n\tRemitaEngineSession,\n\tRemitaGlobalWindow,\n\tRemitaPaymentConfig,\n} from \"../types\";\n\nfunction isBrowserEnvironment(): boolean {\n\treturn typeof window !== \"undefined\";\n}\n\nexport function getRemitaEngine(win?: RemitaGlobalWindow): RemitaEngine {\n\tif (!isBrowserEnvironment()) {\n\t\tthrow new EngineError(\"Remita engine is only available in a browser environment.\");\n\t}\n\n\tconst targetWindow = win ?? (window as RemitaGlobalWindow);\n\tconst engine = targetWindow[REMITA_ENGINE as keyof RemitaGlobalWindow] as RemitaEngine | undefined;\n\n\tif (!engine || typeof engine.init !== \"function\") {\n\t\tthrow new EngineError(\"Remita payment engine is unavailable on window.\");\n\t}\n\n\treturn engine;\n}\n\nexport function initRemitaEngine(\n\tconfig: RemitaPaymentConfig,\n\twin?: RemitaGlobalWindow,\n): RemitaEngineSession {\n\tconst engine = getRemitaEngine(win);\n\tconst rawSession = engine.init(toEnginePaymentConfig(config)) as RemitaEngineSession & {\n\t\tshowPaymentWidget?: () => void;\n\t};\n\n\tconst openIframe =\n\t\ttypeof rawSession.openIframe === \"function\"\n\t\t\t? rawSession.openIframe.bind(rawSession)\n\t\t\t: typeof rawSession.showPaymentWidget === \"function\"\n\t\t\t\t? rawSession.showPaymentWidget.bind(rawSession)\n\t\t\t\t: undefined;\n\n\tif (!openIframe) {\n\t\tthrow new EngineError(\"Remita engine returned an invalid payment session.\");\n\t}\n\n\treturn {\n\t\topenIframe,\n\t\t...(typeof rawSession.showPaymentWidget === \"function\"\n\t\t\t? { showPaymentWidget: rawSession.showPaymentWidget.bind(rawSession) }\n\t\t\t: {}),\n\t};\n}\n\nexport function toEnginePaymentConfig(\n\tconfig: RemitaPaymentConfig,\n): RemitaEnginePaymentConfig {\n\tconst { rrr, extendedData, ...rest } = config;\n\tconst engineExtendedData: RemitaExtendedData = {\n\t\t...(extendedData ?? {}),\n\t\tcustomFields: [\n\t\t\t...((extendedData?.customFields ?? []).filter((field) => field?.name !== \"rrr\")),\n\t\t\t{\n\t\t\t\tname: \"rrr\",\n\t\t\t\tvalue: rrr,\n\t\t\t},\n\t\t],\n\t};\n\n\treturn {\n\t\t...rest,\n\t\tprocessRrr: true,\n\t\textendedData: engineExtendedData,\n\t};\n}\n","import { ValidationError } from \"../utils/errors\";\nimport type { RemitaPaymentConfig } from \"../types\";\n\nfunction assertNonEmptyString(value: unknown, fieldName: string): asserts value is string {\n\tif (typeof value !== \"string\" || value.trim().length === 0) {\n\t\tthrow new ValidationError(`${fieldName} is required and must be a non-empty string.`);\n\t}\n}\n\nfunction assertFinitePositiveNumber(value: unknown, fieldName: string): asserts value is number {\n\tif (typeof value !== \"number\" || !Number.isFinite(value) || value <= 0) {\n\t\tthrow new ValidationError(`${fieldName} is required and must be a positive number.`);\n\t}\n}\n\nfunction assertValidTransactionId(value: unknown): void {\n\tif (value === undefined) {\n\t\treturn;\n\t}\n\n\tconst isString = typeof value === \"string\" && value.trim().length > 0;\n\tconst isNumber = typeof value === \"number\" && Number.isFinite(value);\n\n\tif (!isString && !isNumber) {\n\t\tthrow new ValidationError(\n\t\t\t\"transactionId must be a non-empty string or a finite number when provided.\",\n\t\t);\n\t}\n}\n\nfunction assertValidRrr(value: unknown): void {\n\tconst isString = typeof value === \"string\" && value.trim().length > 0;\n\tconst isNumber = typeof value === \"number\" && Number.isFinite(value);\n\n\tif (!isString && !isNumber) {\n\t\tthrow new ValidationError(\"rrr is required and must be a non-empty string or a finite number.\");\n\t}\n}\n\nfunction validateRrrConfig(config: RemitaPaymentConfig): void {\n\tassertValidRrr(config.rrr);\n}\n\nexport function validatePaymentConfig(config: RemitaPaymentConfig): RemitaPaymentConfig {\n\tif (!config || typeof config !== \"object\") {\n\t\tthrow new ValidationError(\"Payment config is required.\");\n\t}\n\n\tassertNonEmptyString(config.key, \"key\");\n\tassertValidRrr(config.rrr);\n\tassertValidTransactionId(config.transactionId);\n\tvalidateRrrConfig(config);\n\n\treturn config;\n}\n","import { initRemitaEngine } from \"./engine\";\nimport { loadRemitaScript } from \"./loader\";\nimport { validatePaymentConfig } from \"./validator\";\nimport type { RemitaEngineSession, RemitaPaymentConfig } from \"../types\";\nimport type { RemitaLibraryOptions, RemitaOpenOptions } from \"../types/public\";\n\nexport type RemitaStartPaymentOptions = RemitaLibraryOptions & RemitaOpenOptions;\n\nexport interface RemitaPaymentSession {\n\topen: () => void;\n\tsession: RemitaEngineSession;\n}\n\nexport async function startRemitaPayment(\n\tconfig: RemitaPaymentConfig,\n\toptions: RemitaStartPaymentOptions = {},\n): Promise<RemitaPaymentSession> {\n\tvalidatePaymentConfig(config);\n\tawait loadRemitaScript(options);\n\n\tconst session = initRemitaEngine(config);\n\tconst open = () => {\n\t\tif (typeof session.showPaymentWidget === \"function\") {\n\t\t\tsession.showPaymentWidget();\n\t\t\treturn;\n\t\t}\n\n\t\tsession.openIframe();\n\t};\n\n\tif (options.autoOpen !== false) {\n\t\topen();\n\t}\n\n\treturn {\n\t\topen,\n\t\tsession,\n\t};\n}\n","import { useCallback, useState } from \"react\";\nimport { startRemitaPayment } from \"../core/payment\";\nimport type { RemitaPaymentConfig } from \"../types\";\nimport type { RemitaStartPaymentOptions } from \"../core/payment\";\n\nexport interface UseRemitaInlineResult {\n pay: (\n config: RemitaPaymentConfig,\n options?: RemitaStartPaymentOptions,\n ) => Promise<void>;\n isLoading: boolean;\n error: Error | null;\n reset: () => void;\n}\n\nexport function useRemitaInline(\n defaultOptions: RemitaStartPaymentOptions = {},\n): UseRemitaInlineResult {\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const pay = useCallback(\n async (config: RemitaPaymentConfig, options: RemitaStartPaymentOptions = {}) => {\n setIsLoading(true);\n setError(null);\n\n try {\n await startRemitaPayment(config, {\n ...defaultOptions,\n ...options,\n });\n } catch (err) {\n const nextError = err instanceof Error ? err : new Error(\"Payment initialization failed.\");\n setError(nextError);\n throw nextError;\n } finally {\n setIsLoading(false);\n }\n },\n [defaultOptions],\n );\n\n const reset = useCallback(() => {\n setError(null);\n }, []);\n\n return {\n pay,\n isLoading,\n error,\n reset,\n };\n}\n","import { useCallback } from \"react\";\nimport type { ButtonHTMLAttributes, MouseEvent } from \"react\";\nimport { useRemitaInline } from \"../hooks/useRemitaInline\";\nimport type { RemitaPaymentConfig } from \"../types\";\nimport type { RemitaStartPaymentOptions } from \"../core/payment\";\n\nexport interface RemitaPayButtonProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"onClick\"> {\n paymentConfig: RemitaPaymentConfig;\n paymentOptions?: RemitaStartPaymentOptions;\n onPaymentStart?: () => void;\n onPaymentError?: (error: Error) => void;\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\n loadingText?: string;\n}\n\nexport function RemitaPayButton({\n paymentConfig,\n paymentOptions,\n onPaymentStart,\n onPaymentError,\n onClick,\n loadingText = \"Processing...\",\n disabled,\n children,\n ...props\n}: RemitaPayButtonProps) {\n const { pay, isLoading } = useRemitaInline();\n\n const handleClick = useCallback(\n async (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (event.defaultPrevented || isLoading) {\n return;\n }\n\n onPaymentStart?.();\n\n try {\n await pay(paymentConfig, paymentOptions);\n } catch (error) {\n if (onPaymentError) {\n onPaymentError(error instanceof Error ? error : new Error(\"Payment failed.\"));\n }\n }\n },\n [isLoading, onClick, onPaymentError, onPaymentStart, pay, paymentConfig, paymentOptions],\n );\n\n return (\n <button\n type=\"button\"\n {...props}\n disabled={disabled || isLoading}\n onClick={handleClick}\n >\n {isLoading ? loadingText : children ?? \"Pay with Remita\"}\n </button>\n );\n}\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, MouseEvent } from 'react';
|
|
3
|
+
|
|
4
|
+
type RemitaCurrencyCode = "NGN" | (string & {});
|
|
5
|
+
type RemitaMetadataValue = string | number | boolean | null;
|
|
6
|
+
interface RemitaExtendedDataCustomField {
|
|
7
|
+
name: string;
|
|
8
|
+
value: string | number | boolean;
|
|
9
|
+
}
|
|
10
|
+
interface RemitaExtendedData {
|
|
11
|
+
customFields?: RemitaExtendedDataCustomField[];
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
interface RemitaSuccessfulPayment {
|
|
15
|
+
status: string;
|
|
16
|
+
transactionId: string;
|
|
17
|
+
paymentReference?: string;
|
|
18
|
+
message?: string;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
interface RemitaPaymentError {
|
|
22
|
+
message: string;
|
|
23
|
+
code?: string;
|
|
24
|
+
cause?: unknown;
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
}
|
|
27
|
+
interface RemitaPaymentConfig {
|
|
28
|
+
key: string;
|
|
29
|
+
rrr: string | number;
|
|
30
|
+
transactionId?: string | number;
|
|
31
|
+
extendedData?: RemitaExtendedData;
|
|
32
|
+
currency?: RemitaCurrencyCode;
|
|
33
|
+
metadata?: Record<string, RemitaMetadataValue>;
|
|
34
|
+
onSuccess?: (response: RemitaSuccessfulPayment) => void;
|
|
35
|
+
onError?: (error: RemitaPaymentError) => void;
|
|
36
|
+
onClose?: () => void;
|
|
37
|
+
}
|
|
38
|
+
interface RemitaEnginePaymentConfig extends Omit<RemitaPaymentConfig, "rrr"> {
|
|
39
|
+
processRrr: true;
|
|
40
|
+
extendedData: RemitaExtendedData;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface RemitaEngineSession {
|
|
44
|
+
openIframe: () => void;
|
|
45
|
+
showPaymentWidget?: () => void;
|
|
46
|
+
}
|
|
47
|
+
interface RemitaEngine {
|
|
48
|
+
init: (config: RemitaEnginePaymentConfig) => RemitaEngineSession;
|
|
49
|
+
}
|
|
50
|
+
interface RemitaGlobalWindow extends Window {
|
|
51
|
+
RmPaymentEngine?: RemitaEngine;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type RemitaEnvironment = "production" | "demo";
|
|
55
|
+
interface RemitaOpenOptions {
|
|
56
|
+
autoOpen?: boolean;
|
|
57
|
+
}
|
|
58
|
+
interface RemitaLibraryOptions {
|
|
59
|
+
environment?: RemitaEnvironment;
|
|
60
|
+
scriptUrl?: string;
|
|
61
|
+
scriptId?: string;
|
|
62
|
+
timeoutMs?: number;
|
|
63
|
+
nonce?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare function loadRemitaScript(options?: RemitaLibraryOptions): Promise<void>;
|
|
67
|
+
|
|
68
|
+
declare function getRemitaEngine(win?: RemitaGlobalWindow): RemitaEngine;
|
|
69
|
+
declare function initRemitaEngine(config: RemitaPaymentConfig, win?: RemitaGlobalWindow): RemitaEngineSession;
|
|
70
|
+
declare function toEnginePaymentConfig(config: RemitaPaymentConfig): RemitaEnginePaymentConfig;
|
|
71
|
+
|
|
72
|
+
declare function validatePaymentConfig(config: RemitaPaymentConfig): RemitaPaymentConfig;
|
|
73
|
+
|
|
74
|
+
type RemitaStartPaymentOptions = RemitaLibraryOptions & RemitaOpenOptions;
|
|
75
|
+
interface RemitaPaymentSession {
|
|
76
|
+
open: () => void;
|
|
77
|
+
session: RemitaEngineSession;
|
|
78
|
+
}
|
|
79
|
+
declare function startRemitaPayment(config: RemitaPaymentConfig, options?: RemitaStartPaymentOptions): Promise<RemitaPaymentSession>;
|
|
80
|
+
|
|
81
|
+
declare const REMITA_PRODUCTION_SCRIPT_URL = "https://login.remita.net/payment/v1/remita-pay-inline.bundle.js";
|
|
82
|
+
declare const REMITA_DEMO_SCRIPT_URL = "https://demo.remita.net/payment/v1/remita-pay-inline.bundle.js";
|
|
83
|
+
|
|
84
|
+
interface UseRemitaInlineResult {
|
|
85
|
+
pay: (config: RemitaPaymentConfig, options?: RemitaStartPaymentOptions) => Promise<void>;
|
|
86
|
+
isLoading: boolean;
|
|
87
|
+
error: Error | null;
|
|
88
|
+
reset: () => void;
|
|
89
|
+
}
|
|
90
|
+
declare function useRemitaInline(defaultOptions?: RemitaStartPaymentOptions): UseRemitaInlineResult;
|
|
91
|
+
|
|
92
|
+
interface RemitaPayButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> {
|
|
93
|
+
paymentConfig: RemitaPaymentConfig;
|
|
94
|
+
paymentOptions?: RemitaStartPaymentOptions;
|
|
95
|
+
onPaymentStart?: () => void;
|
|
96
|
+
onPaymentError?: (error: Error) => void;
|
|
97
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
98
|
+
loadingText?: string;
|
|
99
|
+
}
|
|
100
|
+
declare function RemitaPayButton({ paymentConfig, paymentOptions, onPaymentStart, onPaymentError, onClick, loadingText, disabled, children, ...props }: RemitaPayButtonProps): react.JSX.Element;
|
|
101
|
+
|
|
102
|
+
export { REMITA_DEMO_SCRIPT_URL, REMITA_PRODUCTION_SCRIPT_URL, type RemitaCurrencyCode, type RemitaEngine, type RemitaEnginePaymentConfig, type RemitaEngineSession, type RemitaEnvironment, type RemitaGlobalWindow, type RemitaLibraryOptions, type RemitaMetadataValue, type RemitaOpenOptions, RemitaPayButton, type RemitaPaymentConfig, type RemitaPaymentError, type RemitaPaymentSession, type RemitaStartPaymentOptions, type RemitaSuccessfulPayment, type UseRemitaInlineResult, getRemitaEngine, initRemitaEngine, loadRemitaScript, startRemitaPayment, toEnginePaymentConfig, useRemitaInline, validatePaymentConfig };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, MouseEvent } from 'react';
|
|
3
|
+
|
|
4
|
+
type RemitaCurrencyCode = "NGN" | (string & {});
|
|
5
|
+
type RemitaMetadataValue = string | number | boolean | null;
|
|
6
|
+
interface RemitaExtendedDataCustomField {
|
|
7
|
+
name: string;
|
|
8
|
+
value: string | number | boolean;
|
|
9
|
+
}
|
|
10
|
+
interface RemitaExtendedData {
|
|
11
|
+
customFields?: RemitaExtendedDataCustomField[];
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
interface RemitaSuccessfulPayment {
|
|
15
|
+
status: string;
|
|
16
|
+
transactionId: string;
|
|
17
|
+
paymentReference?: string;
|
|
18
|
+
message?: string;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
interface RemitaPaymentError {
|
|
22
|
+
message: string;
|
|
23
|
+
code?: string;
|
|
24
|
+
cause?: unknown;
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
}
|
|
27
|
+
interface RemitaPaymentConfig {
|
|
28
|
+
key: string;
|
|
29
|
+
rrr: string | number;
|
|
30
|
+
transactionId?: string | number;
|
|
31
|
+
extendedData?: RemitaExtendedData;
|
|
32
|
+
currency?: RemitaCurrencyCode;
|
|
33
|
+
metadata?: Record<string, RemitaMetadataValue>;
|
|
34
|
+
onSuccess?: (response: RemitaSuccessfulPayment) => void;
|
|
35
|
+
onError?: (error: RemitaPaymentError) => void;
|
|
36
|
+
onClose?: () => void;
|
|
37
|
+
}
|
|
38
|
+
interface RemitaEnginePaymentConfig extends Omit<RemitaPaymentConfig, "rrr"> {
|
|
39
|
+
processRrr: true;
|
|
40
|
+
extendedData: RemitaExtendedData;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface RemitaEngineSession {
|
|
44
|
+
openIframe: () => void;
|
|
45
|
+
showPaymentWidget?: () => void;
|
|
46
|
+
}
|
|
47
|
+
interface RemitaEngine {
|
|
48
|
+
init: (config: RemitaEnginePaymentConfig) => RemitaEngineSession;
|
|
49
|
+
}
|
|
50
|
+
interface RemitaGlobalWindow extends Window {
|
|
51
|
+
RmPaymentEngine?: RemitaEngine;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type RemitaEnvironment = "production" | "demo";
|
|
55
|
+
interface RemitaOpenOptions {
|
|
56
|
+
autoOpen?: boolean;
|
|
57
|
+
}
|
|
58
|
+
interface RemitaLibraryOptions {
|
|
59
|
+
environment?: RemitaEnvironment;
|
|
60
|
+
scriptUrl?: string;
|
|
61
|
+
scriptId?: string;
|
|
62
|
+
timeoutMs?: number;
|
|
63
|
+
nonce?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare function loadRemitaScript(options?: RemitaLibraryOptions): Promise<void>;
|
|
67
|
+
|
|
68
|
+
declare function getRemitaEngine(win?: RemitaGlobalWindow): RemitaEngine;
|
|
69
|
+
declare function initRemitaEngine(config: RemitaPaymentConfig, win?: RemitaGlobalWindow): RemitaEngineSession;
|
|
70
|
+
declare function toEnginePaymentConfig(config: RemitaPaymentConfig): RemitaEnginePaymentConfig;
|
|
71
|
+
|
|
72
|
+
declare function validatePaymentConfig(config: RemitaPaymentConfig): RemitaPaymentConfig;
|
|
73
|
+
|
|
74
|
+
type RemitaStartPaymentOptions = RemitaLibraryOptions & RemitaOpenOptions;
|
|
75
|
+
interface RemitaPaymentSession {
|
|
76
|
+
open: () => void;
|
|
77
|
+
session: RemitaEngineSession;
|
|
78
|
+
}
|
|
79
|
+
declare function startRemitaPayment(config: RemitaPaymentConfig, options?: RemitaStartPaymentOptions): Promise<RemitaPaymentSession>;
|
|
80
|
+
|
|
81
|
+
declare const REMITA_PRODUCTION_SCRIPT_URL = "https://login.remita.net/payment/v1/remita-pay-inline.bundle.js";
|
|
82
|
+
declare const REMITA_DEMO_SCRIPT_URL = "https://demo.remita.net/payment/v1/remita-pay-inline.bundle.js";
|
|
83
|
+
|
|
84
|
+
interface UseRemitaInlineResult {
|
|
85
|
+
pay: (config: RemitaPaymentConfig, options?: RemitaStartPaymentOptions) => Promise<void>;
|
|
86
|
+
isLoading: boolean;
|
|
87
|
+
error: Error | null;
|
|
88
|
+
reset: () => void;
|
|
89
|
+
}
|
|
90
|
+
declare function useRemitaInline(defaultOptions?: RemitaStartPaymentOptions): UseRemitaInlineResult;
|
|
91
|
+
|
|
92
|
+
interface RemitaPayButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> {
|
|
93
|
+
paymentConfig: RemitaPaymentConfig;
|
|
94
|
+
paymentOptions?: RemitaStartPaymentOptions;
|
|
95
|
+
onPaymentStart?: () => void;
|
|
96
|
+
onPaymentError?: (error: Error) => void;
|
|
97
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
98
|
+
loadingText?: string;
|
|
99
|
+
}
|
|
100
|
+
declare function RemitaPayButton({ paymentConfig, paymentOptions, onPaymentStart, onPaymentError, onClick, loadingText, disabled, children, ...props }: RemitaPayButtonProps): react.JSX.Element;
|
|
101
|
+
|
|
102
|
+
export { REMITA_DEMO_SCRIPT_URL, REMITA_PRODUCTION_SCRIPT_URL, type RemitaCurrencyCode, type RemitaEngine, type RemitaEnginePaymentConfig, type RemitaEngineSession, type RemitaEnvironment, type RemitaGlobalWindow, type RemitaLibraryOptions, type RemitaMetadataValue, type RemitaOpenOptions, RemitaPayButton, type RemitaPaymentConfig, type RemitaPaymentError, type RemitaPaymentSession, type RemitaStartPaymentOptions, type RemitaSuccessfulPayment, type UseRemitaInlineResult, getRemitaEngine, initRemitaEngine, loadRemitaScript, startRemitaPayment, toEnginePaymentConfig, useRemitaInline, validatePaymentConfig };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { useState, useCallback } from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/core/constant.ts
|
|
5
|
+
var REMITA_SCRIPT_ID = "remita-inline-sdk";
|
|
6
|
+
var REMITA_PRODUCTION_SCRIPT_URL = "https://login.remita.net/payment/v1/remita-pay-inline.bundle.js";
|
|
7
|
+
var REMITA_DEMO_SCRIPT_URL = "https://demo.remita.net/payment/v1/remita-pay-inline.bundle.js";
|
|
8
|
+
var REMITA_SCRIPT_URL = REMITA_PRODUCTION_SCRIPT_URL;
|
|
9
|
+
var REMITA_ENGINE = "RmPaymentEngine";
|
|
10
|
+
|
|
11
|
+
// src/utils/once.ts
|
|
12
|
+
var promise = null;
|
|
13
|
+
function getPromise() {
|
|
14
|
+
return promise;
|
|
15
|
+
}
|
|
16
|
+
function setPromise(value) {
|
|
17
|
+
promise = value;
|
|
18
|
+
}
|
|
19
|
+
function clearPromise() {
|
|
20
|
+
promise = null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// src/utils/errors.ts
|
|
24
|
+
var RemitaError = class extends Error {
|
|
25
|
+
constructor(message) {
|
|
26
|
+
super(message);
|
|
27
|
+
this.name = "RemitaError";
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var ValidationError = class extends RemitaError {
|
|
31
|
+
constructor(message) {
|
|
32
|
+
super(message);
|
|
33
|
+
this.name = "ValidationError";
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var ScriptLoadError = class extends RemitaError {
|
|
37
|
+
constructor(message) {
|
|
38
|
+
super(message);
|
|
39
|
+
this.name = "ScriptLoadError";
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var EngineError = class extends RemitaError {
|
|
43
|
+
constructor(message) {
|
|
44
|
+
super(message);
|
|
45
|
+
this.name = "EngineError";
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// src/core/loader.ts
|
|
50
|
+
function isBrowserEnvironment() {
|
|
51
|
+
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
52
|
+
}
|
|
53
|
+
function getEngine(win) {
|
|
54
|
+
return win[REMITA_ENGINE];
|
|
55
|
+
}
|
|
56
|
+
function resolveScriptUrl(options) {
|
|
57
|
+
if (options.scriptUrl) {
|
|
58
|
+
return options.scriptUrl;
|
|
59
|
+
}
|
|
60
|
+
if (options.environment === "demo") {
|
|
61
|
+
return REMITA_DEMO_SCRIPT_URL;
|
|
62
|
+
}
|
|
63
|
+
if (options.environment === "production") {
|
|
64
|
+
return REMITA_PRODUCTION_SCRIPT_URL;
|
|
65
|
+
}
|
|
66
|
+
return REMITA_SCRIPT_URL;
|
|
67
|
+
}
|
|
68
|
+
function waitForExistingScript(script, timeoutMs, win) {
|
|
69
|
+
if (script.dataset.loaded === "true" && getEngine(win)) {
|
|
70
|
+
return Promise.resolve();
|
|
71
|
+
}
|
|
72
|
+
return new Promise((resolve, reject) => {
|
|
73
|
+
let timeoutId;
|
|
74
|
+
const onLoad = () => {
|
|
75
|
+
cleanup();
|
|
76
|
+
script.dataset.loaded = "true";
|
|
77
|
+
if (!getEngine(win)) {
|
|
78
|
+
reject(new ScriptLoadError("Remita script loaded but payment engine is unavailable."));
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
resolve();
|
|
82
|
+
};
|
|
83
|
+
const onError = () => {
|
|
84
|
+
cleanup();
|
|
85
|
+
reject(new ScriptLoadError("Failed to load Remita script."));
|
|
86
|
+
};
|
|
87
|
+
const cleanup = () => {
|
|
88
|
+
script.removeEventListener("load", onLoad);
|
|
89
|
+
script.removeEventListener("error", onError);
|
|
90
|
+
if (timeoutId) {
|
|
91
|
+
clearTimeout(timeoutId);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
script.addEventListener("load", onLoad, { once: true });
|
|
95
|
+
script.addEventListener("error", onError, { once: true });
|
|
96
|
+
timeoutId = setTimeout(() => {
|
|
97
|
+
cleanup();
|
|
98
|
+
reject(new ScriptLoadError(`Timed out waiting for Remita script after ${timeoutMs}ms.`));
|
|
99
|
+
}, timeoutMs);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function createAndLoadScript(scriptId, scriptUrl, timeoutMs, nonce) {
|
|
103
|
+
const win = window;
|
|
104
|
+
return new Promise((resolve, reject) => {
|
|
105
|
+
const script = document.createElement("script");
|
|
106
|
+
let timeoutId;
|
|
107
|
+
script.id = scriptId;
|
|
108
|
+
script.src = scriptUrl;
|
|
109
|
+
script.async = true;
|
|
110
|
+
if (nonce) {
|
|
111
|
+
script.nonce = nonce;
|
|
112
|
+
}
|
|
113
|
+
const onLoad = () => {
|
|
114
|
+
cleanup();
|
|
115
|
+
script.dataset.loaded = "true";
|
|
116
|
+
if (!getEngine(win)) {
|
|
117
|
+
reject(new ScriptLoadError("Remita script loaded but payment engine is unavailable."));
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
resolve();
|
|
121
|
+
};
|
|
122
|
+
const onError = () => {
|
|
123
|
+
cleanup();
|
|
124
|
+
reject(new ScriptLoadError("Failed to load Remita script."));
|
|
125
|
+
};
|
|
126
|
+
const cleanup = () => {
|
|
127
|
+
script.removeEventListener("load", onLoad);
|
|
128
|
+
script.removeEventListener("error", onError);
|
|
129
|
+
if (timeoutId) {
|
|
130
|
+
clearTimeout(timeoutId);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
script.addEventListener("load", onLoad, { once: true });
|
|
134
|
+
script.addEventListener("error", onError, { once: true });
|
|
135
|
+
timeoutId = setTimeout(() => {
|
|
136
|
+
cleanup();
|
|
137
|
+
script.remove();
|
|
138
|
+
reject(new ScriptLoadError(`Timed out loading Remita script after ${timeoutMs}ms.`));
|
|
139
|
+
}, timeoutMs);
|
|
140
|
+
document.head.appendChild(script);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
async function loadRemitaScript(options = {}) {
|
|
144
|
+
if (!isBrowserEnvironment()) {
|
|
145
|
+
throw new ScriptLoadError("Remita script loader can only run in a browser environment.");
|
|
146
|
+
}
|
|
147
|
+
const scriptId = options.scriptId ?? REMITA_SCRIPT_ID;
|
|
148
|
+
const scriptUrl = resolveScriptUrl(options);
|
|
149
|
+
const timeoutMs = options.timeoutMs ?? 15e3;
|
|
150
|
+
const win = window;
|
|
151
|
+
if (getEngine(win)) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const inFlight = getPromise();
|
|
155
|
+
if (inFlight) {
|
|
156
|
+
return inFlight;
|
|
157
|
+
}
|
|
158
|
+
const task = (async () => {
|
|
159
|
+
const existingScript = document.getElementById(scriptId);
|
|
160
|
+
if (existingScript) {
|
|
161
|
+
if (existingScript.src && existingScript.src !== scriptUrl) {
|
|
162
|
+
throw new ScriptLoadError(
|
|
163
|
+
`Script with id "${scriptId}" already exists with a different src.`
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
await waitForExistingScript(existingScript, timeoutMs, win);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
await createAndLoadScript(scriptId, scriptUrl, timeoutMs, options.nonce);
|
|
170
|
+
})();
|
|
171
|
+
setPromise(task);
|
|
172
|
+
try {
|
|
173
|
+
await task;
|
|
174
|
+
} catch (error) {
|
|
175
|
+
clearPromise();
|
|
176
|
+
throw error;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// src/core/engine.ts
|
|
181
|
+
function isBrowserEnvironment2() {
|
|
182
|
+
return typeof window !== "undefined";
|
|
183
|
+
}
|
|
184
|
+
function getRemitaEngine(win) {
|
|
185
|
+
if (!isBrowserEnvironment2()) {
|
|
186
|
+
throw new EngineError("Remita engine is only available in a browser environment.");
|
|
187
|
+
}
|
|
188
|
+
const targetWindow = win ?? window;
|
|
189
|
+
const engine = targetWindow[REMITA_ENGINE];
|
|
190
|
+
if (!engine || typeof engine.init !== "function") {
|
|
191
|
+
throw new EngineError("Remita payment engine is unavailable on window.");
|
|
192
|
+
}
|
|
193
|
+
return engine;
|
|
194
|
+
}
|
|
195
|
+
function initRemitaEngine(config, win) {
|
|
196
|
+
const engine = getRemitaEngine(win);
|
|
197
|
+
const rawSession = engine.init(toEnginePaymentConfig(config));
|
|
198
|
+
const openIframe = typeof rawSession.openIframe === "function" ? rawSession.openIframe.bind(rawSession) : typeof rawSession.showPaymentWidget === "function" ? rawSession.showPaymentWidget.bind(rawSession) : void 0;
|
|
199
|
+
if (!openIframe) {
|
|
200
|
+
throw new EngineError("Remita engine returned an invalid payment session.");
|
|
201
|
+
}
|
|
202
|
+
return {
|
|
203
|
+
openIframe,
|
|
204
|
+
...typeof rawSession.showPaymentWidget === "function" ? { showPaymentWidget: rawSession.showPaymentWidget.bind(rawSession) } : {}
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function toEnginePaymentConfig(config) {
|
|
208
|
+
const { rrr, extendedData, ...rest } = config;
|
|
209
|
+
const engineExtendedData = {
|
|
210
|
+
...extendedData ?? {},
|
|
211
|
+
customFields: [
|
|
212
|
+
...(extendedData?.customFields ?? []).filter((field) => field?.name !== "rrr"),
|
|
213
|
+
{
|
|
214
|
+
name: "rrr",
|
|
215
|
+
value: rrr
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
};
|
|
219
|
+
return {
|
|
220
|
+
...rest,
|
|
221
|
+
processRrr: true,
|
|
222
|
+
extendedData: engineExtendedData
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// src/core/validator.ts
|
|
227
|
+
function assertNonEmptyString(value, fieldName) {
|
|
228
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
229
|
+
throw new ValidationError(`${fieldName} is required and must be a non-empty string.`);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
function assertValidTransactionId(value) {
|
|
233
|
+
if (value === void 0) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
const isString = typeof value === "string" && value.trim().length > 0;
|
|
237
|
+
const isNumber = typeof value === "number" && Number.isFinite(value);
|
|
238
|
+
if (!isString && !isNumber) {
|
|
239
|
+
throw new ValidationError(
|
|
240
|
+
"transactionId must be a non-empty string or a finite number when provided."
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
function assertValidRrr(value) {
|
|
245
|
+
const isString = typeof value === "string" && value.trim().length > 0;
|
|
246
|
+
const isNumber = typeof value === "number" && Number.isFinite(value);
|
|
247
|
+
if (!isString && !isNumber) {
|
|
248
|
+
throw new ValidationError("rrr is required and must be a non-empty string or a finite number.");
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
function validateRrrConfig(config) {
|
|
252
|
+
assertValidRrr(config.rrr);
|
|
253
|
+
}
|
|
254
|
+
function validatePaymentConfig(config) {
|
|
255
|
+
if (!config || typeof config !== "object") {
|
|
256
|
+
throw new ValidationError("Payment config is required.");
|
|
257
|
+
}
|
|
258
|
+
assertNonEmptyString(config.key, "key");
|
|
259
|
+
assertValidRrr(config.rrr);
|
|
260
|
+
assertValidTransactionId(config.transactionId);
|
|
261
|
+
validateRrrConfig(config);
|
|
262
|
+
return config;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// src/core/payment.ts
|
|
266
|
+
async function startRemitaPayment(config, options = {}) {
|
|
267
|
+
validatePaymentConfig(config);
|
|
268
|
+
await loadRemitaScript(options);
|
|
269
|
+
const session = initRemitaEngine(config);
|
|
270
|
+
const open = () => {
|
|
271
|
+
if (typeof session.showPaymentWidget === "function") {
|
|
272
|
+
session.showPaymentWidget();
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
session.openIframe();
|
|
276
|
+
};
|
|
277
|
+
if (options.autoOpen !== false) {
|
|
278
|
+
open();
|
|
279
|
+
}
|
|
280
|
+
return {
|
|
281
|
+
open,
|
|
282
|
+
session
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
function useRemitaInline(defaultOptions = {}) {
|
|
286
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
287
|
+
const [error, setError] = useState(null);
|
|
288
|
+
const pay = useCallback(
|
|
289
|
+
async (config, options = {}) => {
|
|
290
|
+
setIsLoading(true);
|
|
291
|
+
setError(null);
|
|
292
|
+
try {
|
|
293
|
+
await startRemitaPayment(config, {
|
|
294
|
+
...defaultOptions,
|
|
295
|
+
...options
|
|
296
|
+
});
|
|
297
|
+
} catch (err) {
|
|
298
|
+
const nextError = err instanceof Error ? err : new Error("Payment initialization failed.");
|
|
299
|
+
setError(nextError);
|
|
300
|
+
throw nextError;
|
|
301
|
+
} finally {
|
|
302
|
+
setIsLoading(false);
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
[defaultOptions]
|
|
306
|
+
);
|
|
307
|
+
const reset = useCallback(() => {
|
|
308
|
+
setError(null);
|
|
309
|
+
}, []);
|
|
310
|
+
return {
|
|
311
|
+
pay,
|
|
312
|
+
isLoading,
|
|
313
|
+
error,
|
|
314
|
+
reset
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
function RemitaPayButton({
|
|
318
|
+
paymentConfig,
|
|
319
|
+
paymentOptions,
|
|
320
|
+
onPaymentStart,
|
|
321
|
+
onPaymentError,
|
|
322
|
+
onClick,
|
|
323
|
+
loadingText = "Processing...",
|
|
324
|
+
disabled,
|
|
325
|
+
children,
|
|
326
|
+
...props
|
|
327
|
+
}) {
|
|
328
|
+
const { pay, isLoading } = useRemitaInline();
|
|
329
|
+
const handleClick = useCallback(
|
|
330
|
+
async (event) => {
|
|
331
|
+
onClick?.(event);
|
|
332
|
+
if (event.defaultPrevented || isLoading) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
onPaymentStart?.();
|
|
336
|
+
try {
|
|
337
|
+
await pay(paymentConfig, paymentOptions);
|
|
338
|
+
} catch (error) {
|
|
339
|
+
if (onPaymentError) {
|
|
340
|
+
onPaymentError(error instanceof Error ? error : new Error("Payment failed."));
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
[isLoading, onClick, onPaymentError, onPaymentStart, pay, paymentConfig, paymentOptions]
|
|
345
|
+
);
|
|
346
|
+
return /* @__PURE__ */ jsx(
|
|
347
|
+
"button",
|
|
348
|
+
{
|
|
349
|
+
type: "button",
|
|
350
|
+
...props,
|
|
351
|
+
disabled: disabled || isLoading,
|
|
352
|
+
onClick: handleClick,
|
|
353
|
+
children: isLoading ? loadingText : children ?? "Pay with Remita"
|
|
354
|
+
}
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export { REMITA_DEMO_SCRIPT_URL, REMITA_PRODUCTION_SCRIPT_URL, RemitaPayButton, getRemitaEngine, initRemitaEngine, loadRemitaScript, startRemitaPayment, toEnginePaymentConfig, useRemitaInline, validatePaymentConfig };
|
|
359
|
+
//# sourceMappingURL=index.js.map
|
|
360
|
+
//# sourceMappingURL=index.js.map
|