@tapayadot/accept-react-native 1.19.1 → 1.20.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/build/Accept.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { mapErrors, mapErrorsSync, toAcceptError } from "./AcceptError";
2
2
  import Native from "./AcceptSdkReactNativeModule";
3
+ import { mapNfcErrors } from "./TagSessionError";
3
4
  import { withoutUndefined } from "./withoutUndefined";
4
5
  /**
5
6
  * Correlates a `pay()` call with its events. Monotonic within a JavaScript context, which is all
@@ -196,6 +197,88 @@ const payments = {
196
197
  return mapErrors(() => Native.refundPayment(paymentToken, reason));
197
198
  },
198
199
  };
200
+ const bytes = (value) => Array.from(value);
201
+ const uint8Array = (value) => Uint8Array.from(value);
202
+ /** JavaScript handle for one opaque native `TagSession`. */
203
+ class NativeTagSession {
204
+ sessionId;
205
+ info;
206
+ ended;
207
+ constructor(sessionId, info) {
208
+ this.sessionId = sessionId;
209
+ this.info = info;
210
+ this.ended = mapNfcErrors(() => Native.awaitNfcSessionEnd(sessionId));
211
+ // Keep `ended` as the unmodified public promise. Cleanup is a side effect whose own failure
212
+ // must not turn a successfully observed end reason into a rejection.
213
+ this.ended
214
+ .finally(() => {
215
+ try {
216
+ Native.releaseNfcSession(sessionId);
217
+ }
218
+ catch {
219
+ // The native module is already being destroyed; it closes all sessions itself.
220
+ }
221
+ })
222
+ .catch(() => undefined);
223
+ }
224
+ authenticateClassic(block, keyType, key) {
225
+ return mapNfcErrors(() => Native.nfcAuthenticateClassic(this.sessionId, block, keyType, bytes(key)));
226
+ }
227
+ async readBlock(block) {
228
+ return uint8Array(await mapNfcErrors(() => Native.nfcReadBlock(this.sessionId, block)));
229
+ }
230
+ writeBlock(block, data) {
231
+ return mapNfcErrors(() => Native.nfcWriteBlock(this.sessionId, block, bytes(data)));
232
+ }
233
+ increment(block, value) {
234
+ return mapNfcErrors(() => Native.nfcIncrement(this.sessionId, block, value));
235
+ }
236
+ decrement(block, value) {
237
+ return mapNfcErrors(() => Native.nfcDecrement(this.sessionId, block, value));
238
+ }
239
+ transfer(block) {
240
+ return mapNfcErrors(() => Native.nfcTransfer(this.sessionId, block));
241
+ }
242
+ restore(block) {
243
+ return mapNfcErrors(() => Native.nfcRestore(this.sessionId, block));
244
+ }
245
+ async readPages(startPage) {
246
+ return uint8Array(await mapNfcErrors(() => Native.nfcReadPages(this.sessionId, startPage)));
247
+ }
248
+ writePage(page, data) {
249
+ return mapNfcErrors(() => Native.nfcWritePage(this.sessionId, page, bytes(data)));
250
+ }
251
+ async passwordAuth(password) {
252
+ return uint8Array(await mapNfcErrors(() => Native.nfcPasswordAuth(this.sessionId, bytes(password))));
253
+ }
254
+ ultralightCAuth(key) {
255
+ return mapNfcErrors(() => Native.nfcUltralightCAuth(this.sessionId, bytes(key)));
256
+ }
257
+ async transceiveType2(frame) {
258
+ return uint8Array(await mapNfcErrors(() => Native.nfcTransceiveType2(this.sessionId, bytes(frame))));
259
+ }
260
+ async transmitApdu(apdu) {
261
+ return uint8Array(await mapNfcErrors(() => Native.nfcTransmitApdu(this.sessionId, bytes(apdu))));
262
+ }
263
+ close() {
264
+ return mapNfcErrors(() => Native.closeNfcSession(this.sessionId));
265
+ }
266
+ }
267
+ /**
268
+ * NFC tag sessions on the device's own reader. Requires `initialize()`, but not merchant
269
+ * authentication. The optional NFC artifact must be enabled in the config plugin.
270
+ */
271
+ const nfc = {
272
+ /** Whether this device has a reader the configured NFC backend can use. */
273
+ isSupported() {
274
+ return mapErrorsSync(() => Native.isNfcSupported());
275
+ },
276
+ /** Waits for a tag and opens a session on it using the foreground Android activity. */
277
+ async openSession(timeouts = {}) {
278
+ const opened = await mapNfcErrors(() => Native.openNfcSession(withoutUndefined(timeouts)));
279
+ return new NativeTagSession(opened.sessionId, opened.info);
280
+ },
281
+ };
199
282
  /**
200
283
  * The Accept plugin app — the companion that drives the physical terminal. Mirrors `Accept.plugin`.
201
284
  */
@@ -319,6 +402,7 @@ export const Accept = {
319
402
  sdk,
320
403
  merchant,
321
404
  payments,
405
+ nfc,
322
406
  plugin,
323
407
  displays,
324
408
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Accept.js","sourceRoot":"","sources":["../src/Accept.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,MAAM,MAAM,8BAA8B,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,IAAI,aAAa,GAAG,CAAC,CAAC;AACtB,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC;AAEpD,4CAA4C;AAC5C,MAAM,UAAU,GAAG,CAAC,KAAmB,EAAE,EAAE,CACzC,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,gBAAgB,CAAC;AAE7D;;GAEG;AACH,MAAM,IAAI,GAAG;IACX;;;;;OAKG;IACH,YAAY,CAAC,aAAqB;QAChC,OAAO,SAAS,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC;IAC7D,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,GAAG,GAAG;IACV,iGAAiG;IACjG,IAAI,OAAO;QACT,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,IAAI,YAAY;QACd,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IACpD,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ;QACN,OAAO,SAAS,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACH,cAAc;QACZ,OAAO,SAAS,CAAC,GAAG,EAAE,CAAC,MAA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d,gBAAwB,KAAK;QAE7B,OAAO,aAAa,CAAC,GAAG,EAAE,CACxB,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,aAAa,CAAC,CACvD,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import type {\n AcceptDisplay,\n AcceptLogEntry,\n AcceptLogLevel,\n AcceptSubscription,\n AcceptTheme,\n ActivateTerminalResult,\n InitializeOptions,\n MerchantConfig,\n MerchantInformation,\n MinimumAmount,\n OnboardingStatus,\n PayResult,\n PaymentEvent,\n PaymentOptions,\n PaymentRequest,\n PaymentState,\n PaymentStatus,\n PaymentSubscription,\n PluginStatus,\n PluginUpdateInfo,\n RefundReason,\n SdkState,\n} from \"./Accept.types\";\nimport { mapErrors, mapErrorsSync, toAcceptError } from \"./AcceptError\";\nimport Native from \"./AcceptSdkReactNativeModule\";\nimport { withoutUndefined } from \"./withoutUndefined\";\n\n/**\n * Correlates a `pay()` call with its events. Monotonic within a JavaScript context, which is all\n * that is needed: the native side only ever routes an event back to the caller that started it.\n */\nlet nextRequestId = 0;\nconst newRequestId = () => `pay-${++nextRequestId}`;\n\n/** A payment event that ends the stream. */\nconst isTerminal = (event: PaymentEvent) =>\n event.type === \"result\" || event.type === \"creationFailed\";\n\n/**\n * Authentication surface. Mirrors `Accept.auth`.\n */\nconst auth = {\n /**\n * Authenticates the SDK for the merchant identified by `merchantToken`. Must succeed before\n * {@link merchant} or {@link payments} can be used.\n *\n * @throws AcceptError `NotInitialized`, `NoInternetConnection`, `Unknown`.\n */\n authenticate(merchantToken: string): Promise<void> {\n return mapErrors(() => Native.authenticate(merchantToken));\n },\n};\n\n/**\n * SDK-level configuration and diagnostics. Mirrors `Accept.sdk`.\n */\nconst sdk = {\n /** The version of the Accept SDK for Android bundled in this build. Safe before `initialize`. */\n get version(): string {\n return Native.getSdkVersion();\n },\n\n /**\n * Whether the SDK was initialized against production.\n *\n * @throws AcceptError `NotInitialized`.\n */\n get isProduction(): boolean {\n return mapErrorsSync(() => Native.isProduction());\n },\n\n /**\n * This device's stable identifier, assigned on the first successful\n * {@link auth.authenticate}. When the companion app reports one, its id is used, so the id is\n * shared by every host app on the device and survives a reinstall of this app; otherwise it is\n * retained until the app is uninstalled.\n *\n * @returns the device id, or `null` before the first authentication.\n * @throws AcceptError `NotInitialized`, `Unknown`.\n */\n deviceId(): Promise<string | null> {\n return mapErrors(() => Native.getDeviceId());\n },\n\n /**\n * The minimum payable amount per supported currency.\n *\n * @throws AcceptError `NotInitialized`, `NoInternetConnection`, `Unknown`.\n */\n minimumAmounts(): Promise<MinimumAmount[]> {\n return mapErrors(() => Native.getMinimumAmounts());\n },\n};\n\n/**\n * Merchant profile and onboarding. Mirrors `Accept.merchant`. Requires {@link auth.authenticate}.\n */\nconst merchant = {\n /**\n * The merchant's business profile, or `null` if onboarding hasn't been submitted yet.\n *\n * @throws AcceptError `NotAuthenticated`, `NoInternetConnection`, `Unknown`.\n */\n info(): Promise<MerchantInformation | null> {\n return mapErrors(() => Native.getMerchantInfo());\n },\n\n /**\n * The merchant's payment configuration.\n *\n * @throws AcceptError `NotAuthenticated`, `NoInternetConnection`, `Unknown`.\n */\n config(): Promise<MerchantConfig> {\n return mapErrors(() => Native.getMerchantConfig());\n },\n\n /**\n * Whether the merchant is ready to accept payments, or what is blocking it.\n *\n * @throws AcceptError `NotAuthenticated`, `NoInternetConnection`, `Unknown`.\n */\n onboardingStatus(): Promise<OnboardingStatus> {\n return mapErrors(() => Native.getOnboardingStatus());\n },\n\n /**\n * The currency codes the merchant accepts. Shorthand for `config().availableCurrencies`.\n *\n * @throws AcceptError `NotAuthenticated`, `NoInternetConnection`, `Unknown`.\n */\n availableCurrencies(): Promise<string[]> {\n return mapErrors(() => Native.getAvailableCurrencies());\n },\n};\n\n/**\n * Payments. Mirrors `Accept.payments`. Requires {@link auth.authenticate}.\n */\nconst payments = {\n /**\n * Sets the defaults applied to payments that don't override them on {@link pay}.\n *\n * Only the keys present are changed, so one option can be set without disturbing the others.\n * `display` is also what the terminal warm-up fired by {@link auth.authenticate} follows — set it\n * before authenticating to keep the warm-up off the merchant's screen.\n */\n setOptions(options: PaymentOptions): void {\n Native.setPaymentOptions(withoutUndefined(options));\n },\n\n /**\n * Launches the plugin's payment flow and streams its lifecycle to `listener`.\n *\n * Never throws: a failure to create the payment arrives as a `creationFailed` event carrying an\n * {@link AcceptError}. The stream ends after `result` or `creationFailed`, at which point the\n * subscription removes itself.\n *\n * ```ts\n * Accept.payments.pay({ amount: 1000, currency: 'USD' }, (event) => {\n * if (event.type === 'result' && event.payResult.type === 'success') {\n * console.log(event.payResult.paymentToken);\n * }\n * });\n * ```\n *\n * @returns a handle that stops delivering events; see {@link PaymentSubscription.remove}.\n */\n pay(\n request: PaymentRequest,\n listener: (event: PaymentEvent) => void,\n ): PaymentSubscription {\n const requestId = newRequestId();\n let removed = false;\n\n const subscription = Native.addListener(\"onPaymentEvent\", (payload) => {\n if (payload.requestId !== requestId) return;\n if (isTerminal(payload.event)) remove();\n listener(payload.event);\n });\n\n const remove = () => {\n if (removed) return;\n removed = true;\n subscription.remove();\n Native.stopPaymentEvents(requestId);\n };\n\n Native.startPayment(requestId, withoutUndefined(request));\n return { remove };\n },\n\n /**\n * {@link pay} reduced to its outcome, for callers that don't render the intermediate states.\n *\n * @returns the terminal {@link PayResult}.\n * @throws AcceptError whatever the payment would have reported as `creationFailed` — including\n * `PaymentInProgress`, `NotAuthenticated`, `PluginNotReadyForPayments`, `AmountBelowMinimum`,\n * and `LocationPermissionRequired`.\n */\n payAsync(request: PaymentRequest): Promise<PayResult> {\n return new Promise<PayResult>((resolve, reject) => {\n payments.pay(request, (event) => {\n if (event.type === \"result\") resolve(event.payResult);\n else if (event.type === \"creationFailed\")\n reject(toAcceptError(event.error));\n });\n });\n },\n\n /**\n * The current status of the payment identified by `paymentToken`.\n *\n * @throws AcceptError `NotAuthenticated`, `SessionExpired`, `PaymentNotFound`,\n * `NoInternetConnection`, `Unknown`.\n */\n status(paymentToken: string): Promise<PaymentStatus> {\n return mapErrors(() => Native.getPaymentStatus(paymentToken));\n },\n\n /**\n * Cancels the payment identified by `paymentToken`.\n *\n * @returns the resulting {@link PaymentState}.\n * @throws AcceptError `NotAuthenticated`, `SessionExpired`, `PaymentNotFound`,\n * `NoInternetConnection`, `Unknown`.\n */\n cancel(paymentToken: string): Promise<PaymentState> {\n return mapErrors(() => Native.cancelPayment(paymentToken));\n },\n\n /**\n * Refunds the payment identified by `paymentToken`.\n *\n * @returns the resulting {@link PaymentState}.\n * @throws AcceptError `NotAuthenticated`, `SessionExpired`, `PaymentNotFound`,\n * `NoInternetConnection`, `Unknown`.\n */\n refund(paymentToken: string, reason: RefundReason): Promise<PaymentState> {\n return mapErrors(() => Native.refundPayment(paymentToken, reason));\n },\n};\n\n/**\n * The Accept plugin app — the companion that drives the physical terminal. Mirrors `Accept.plugin`.\n */\nconst plugin = {\n /**\n * Whether the plugin app is installed on this device.\n *\n * @throws AcceptError `NotInitialized`, `Unknown`.\n */\n isInstalled(): boolean {\n return mapErrorsSync(() => Native.isPluginInstalled());\n },\n\n /**\n * Installs the plugin app.\n *\n * On a device with an app store this opens the plugin's listing — branded when the authenticated\n * organization configured one — and needs no session to do it.\n *\n * On a device with no store the SDK downloads the APK and installs it through the system\n * installer. That path is opt-in: pass `{ selfInstall: true }` to this package's config plugin,\n * or it fails with `PluginSelfInstallUnavailable`. It also needs an authenticated merchant\n * (`PluginInstallAuthRequired`) and the user's \"Install unknown apps\" grant for the host app\n * (`PluginInstallPermissionRequired` — send them to Android's\n * `android.settings.MANAGE_UNKNOWN_APP_SOURCES` screen and call this again).\n *\n * `PluginDownloadNotPermitted` is an entitlement decision rather than anything retryable: the\n * merchant is not enabled for the non-store distribution channel. Point them at their account\n * manager or developers@tapaya.com.\n *\n * @throws AcceptError `NotInitialized`, `PluginStoreUnavailable`, `PluginSelfInstallUnavailable`,\n * `PluginInstallAuthRequired`, `PluginInstallPermissionRequired`, `PluginDownloadNotPermitted`,\n * `NoInternetConnection`, `Unknown`.\n */\n install(): Promise<void> {\n return mapErrors(() => Native.installPlugin());\n },\n\n /**\n * Runs the plugin's terminal activation flow and resolves when it finishes. Activation is\n * required before the device can take card payments.\n *\n * @throws AcceptError `ActivationInProgress`, `NotAuthenticated`, `PluginUnavailable`,\n * `NoInternetConnection`, `NoTidsAvailableForMerchant`, `MerchantOnboardingIncomplete`,\n * `Unknown`.\n */\n activateTerminal(): Promise<ActivateTerminalResult> {\n return mapErrors(() => Native.activateTerminal());\n },\n\n /**\n * The plugin's current installed/authenticated/ready state.\n *\n * @throws AcceptError `NotInitialized`, `PluginUnavailable`, `PluginTimeout`, `Unknown`.\n */\n status(): Promise<PluginStatus> {\n return mapErrors(() => Native.getPluginStatus());\n },\n\n /**\n * Whether a newer plugin build is available. Call {@link install} on `updateAvailable`.\n *\n * Answered from the backend's release metadata against the installed package, unauthenticated,\n * so it works during device setup, with no store, and with the plugin absent. A Play-installed\n * plugin is still measured against Play, since a release reaches the backend while the same\n * build can sit in review; the plugin's own check is the fallback.\n *\n * @throws AcceptError `NotInitialized`, `PluginUnavailable`, `PluginTimeout`, `Unknown`.\n */\n updateInfo(): Promise<PluginUpdateInfo> {\n return mapErrors(() => Native.getPluginUpdateInfo());\n },\n\n /**\n * Logs the merchant out of the plugin app.\n *\n * @throws AcceptError `NotInitialized`, `PluginUnavailable`, `PluginTimeout`, `Unknown`.\n */\n logout(): Promise<void> {\n return mapErrors(() => Native.logoutPlugin());\n },\n};\n\n/**\n * Screen topology, for dual-sided POS hardware. Mirrors `Accept.displays`.\n *\n * Every member reads the platform live, so a display hot-plugged or powered off between calls is\n * reflected immediately. None of them throw.\n */\nconst displays = {\n /** Every display the device currently reports, primary first. */\n all(): AcceptDisplay[] {\n return Native.getDisplays();\n },\n\n /**\n * The customer-facing panel of a dual-sided device, or `null` on single-screen devices. This is\n * what `{ type: 'customerFacing' }` targets.\n */\n customerFacing(): AcceptDisplay | null {\n return Native.getCustomerFacingDisplay();\n },\n\n /** Whether a customer-facing display is available right now. */\n get isDualScreen(): boolean {\n return Native.isDualScreen();\n },\n};\n\n/** The listener currently receiving forwarded SDK logs, if any. */\nlet logSubscription: AcceptSubscription | null = null;\n\n/**\n * Entry point to the Accept SDK. Mirrors the `Accept` object in the Accept SDK for Android, so the\n * Android reference documentation applies unchanged.\n *\n * ```ts\n * import Accept from '@tapayadot/accept-react-native';\n *\n * Accept.initialize({ isProduction: false });\n * await Accept.auth.authenticate(merchantToken);\n *\n * if (!Accept.plugin.isInstalled()) await Accept.plugin.install();\n * await Accept.plugin.activateTerminal();\n *\n * const result = await Accept.payments.payAsync({ amount: 1000, currency: 'USD' });\n * ```\n */\nexport const Accept = {\n auth,\n sdk,\n merchant,\n payments,\n plugin,\n displays,\n\n /**\n * Initializes the SDK against sandbox or production. Must be called before any other surface is\n * used — typically once, at app startup.\n *\n * Safe to call more than once; each call resets which environment subsequent requests target.\n */\n initialize(options: InitializeOptions = {}): void {\n Native.initialize(options.isProduction ?? false);\n },\n\n /** The SDK's current lifecycle state. */\n get state(): SdkState {\n return Native.getState();\n },\n\n /**\n * Subscribes to {@link state} transitions. The listener fires with the current state on\n * subscription, then on every change.\n */\n addStateListener(listener: (state: SdkState) => void): AcceptSubscription {\n return Native.addListener(\"onStateChange\", ({ state }) => listener(state));\n },\n\n /**\n * Clears all locally persisted SDK state — auth token, device id, cached config, and theme — and\n * resets {@link state} to `idle`. Call this on merchant logout.\n *\n * @throws AcceptError `Unknown`.\n */\n clear(): Promise<void> {\n return mapErrors(() => Native.clear());\n },\n\n /**\n * Enables or disables diagnostic logging. Shorthand for {@link setLogLevel}: `true` maps to\n * `'DEBUG'`, `false` to `'NONE'`.\n */\n setDebugLoggingEnabled(enabled: boolean): void {\n Native.setDebugLoggingEnabled(enabled);\n },\n\n /**\n * Sets the verbosity of diagnostic logging. Defaults to `'DEBUG'` against sandbox and `'NONE'`\n * against production; call after {@link initialize} to override.\n */\n setLogLevel(level: AcceptLogLevel): void {\n Native.setLogLevel(level);\n },\n\n /**\n * Routes SDK logs into `listener` instead of Logcat, for forwarding into your own logging stack.\n * Pass `null` to restore the default Logcat sink.\n */\n setLogger(listener: ((entry: AcceptLogEntry) => void) | null): void {\n logSubscription?.remove();\n logSubscription = listener ? Native.addListener(\"onLog\", listener) : null;\n Native.setLogForwardingEnabled(listener !== null);\n },\n\n /**\n * Sets the branding applied to the plugin's activation, status, and payment screens.\n *\n * Session-wide, not per payment: it persists until changed or cleared with `null`. Pushed to the\n * plugin opportunistically the next time it is bound or launched, so there is no confirmation\n * that it was applied — the plugin may not be installed or running yet.\n */\n setTheme(theme: AcceptTheme | null): void {\n Native.setTheme(withoutUndefined(theme));\n },\n\n /**\n * The theme currently set via {@link setTheme}, or `null`. Reflects local SDK state only, not\n * whether the plugin applied it.\n */\n getTheme(): AcceptTheme | null {\n return Native.getTheme();\n },\n\n /**\n * Stores `base64` image data in SDK-private storage and returns a `content://` URL the plugin can\n * read — for a logo the host app holds locally rather than at a stable URL. Use the result\n * anywhere an {@link AcceptTheme} image field takes a URL.\n *\n * `assetToBase64` from `@tapayadot/accept-react-native/utils` turns a `require('./logo.png')`\n * into the expected string.\n *\n * @param fileExtension the extension to store the data under, without a leading dot. Tells the\n * plugin how to decode it; defaults to `'png'`.\n * @throws AcceptError `NotInitialized`.\n */\n createLocalThemeImageUri(\n base64: string,\n fileExtension: string = \"png\",\n ): string {\n return mapErrorsSync(() =>\n Native.createLocalThemeImageUri(base64, fileExtension),\n );\n },\n};\n"]}
1
+ {"version":3,"file":"Accept.js","sourceRoot":"","sources":["../src/Accept.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,MAAM,MAAM,8BAA8B,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,IAAI,aAAa,GAA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,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;OAKG;IACH,KAAK;QACH,OAAO,SAAS,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IACzC,CAAC;IAED;;;OAGG;IACH,sBAAsB,CAAC,OAAgB;QACrC,MAAM,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED;;;OAGG;IACH,WAAW,CAAC,KAAqB;QAC/B,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,QAAkD;QAC1D,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,eAAe,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1E,MAAM,CAAC,uBAAuB,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC;IACpD,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,KAAyB;QAChC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACH,QAAQ;QACN,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED;;;;;;;;;;;OAWG;IACH,wBAAwB,CACtB,MAAc,EACd,gBAAwB,KAAK;QAE7B,OAAO,aAAa,CAAC,GAAG,EAAE,CACxB,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,aAAa,CAAC,CACvD,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import type {\n AcceptDisplay,\n AcceptLogEntry,\n AcceptLogLevel,\n AcceptSubscription,\n AcceptTheme,\n ActivateTerminalResult,\n InitializeOptions,\n MerchantConfig,\n MerchantInformation,\n MinimumAmount,\n OnboardingStatus,\n PayResult,\n PaymentEvent,\n PaymentOptions,\n PaymentRequest,\n PaymentState,\n PaymentStatus,\n PaymentSubscription,\n PluginStatus,\n PluginUpdateInfo,\n RefundReason,\n SdkState,\n TagInfo,\n TagSession,\n TagSessionEndReason,\n TagTimeouts,\n MifareKeyType,\n} from \"./Accept.types\";\nimport { mapErrors, mapErrorsSync, toAcceptError } from \"./AcceptError\";\nimport Native from \"./AcceptSdkReactNativeModule\";\nimport { mapNfcErrors } from \"./TagSessionError\";\nimport { withoutUndefined } from \"./withoutUndefined\";\n\n/**\n * Correlates a `pay()` call with its events. Monotonic within a JavaScript context, which is all\n * that is needed: the native side only ever routes an event back to the caller that started it.\n */\nlet nextRequestId = 0;\nconst newRequestId = () => `pay-${++nextRequestId}`;\n\n/** A payment event that ends the stream. */\nconst isTerminal = (event: PaymentEvent) =>\n event.type === \"result\" || event.type === \"creationFailed\";\n\n/**\n * Authentication surface. Mirrors `Accept.auth`.\n */\nconst auth = {\n /**\n * Authenticates the SDK for the merchant identified by `merchantToken`. Must succeed before\n * {@link merchant} or {@link payments} can be used.\n *\n * @throws AcceptError `NotInitialized`, `NoInternetConnection`, `Unknown`.\n */\n authenticate(merchantToken: string): Promise<void> {\n return mapErrors(() => Native.authenticate(merchantToken));\n },\n};\n\n/**\n * SDK-level configuration and diagnostics. Mirrors `Accept.sdk`.\n */\nconst sdk = {\n /** The version of the Accept SDK for Android bundled in this build. Safe before `initialize`. */\n get version(): string {\n return Native.getSdkVersion();\n },\n\n /**\n * Whether the SDK was initialized against production.\n *\n * @throws AcceptError `NotInitialized`.\n */\n get isProduction(): boolean {\n return mapErrorsSync(() => Native.isProduction());\n },\n\n /**\n * This device's stable identifier, assigned on the first successful\n * {@link auth.authenticate}. When the companion app reports one, its id is used, so the id is\n * shared by every host app on the device and survives a reinstall of this app; otherwise it is\n * retained until the app is uninstalled.\n *\n * @returns the device id, or `null` before the first authentication.\n * @throws AcceptError `NotInitialized`, `Unknown`.\n */\n deviceId(): Promise<string | null> {\n return mapErrors(() => Native.getDeviceId());\n },\n\n /**\n * The minimum payable amount per supported currency.\n *\n * @throws AcceptError `NotInitialized`, `NoInternetConnection`, `Unknown`.\n */\n minimumAmounts(): Promise<MinimumAmount[]> {\n return mapErrors(() => Native.getMinimumAmounts());\n },\n};\n\n/**\n * Merchant profile and onboarding. Mirrors `Accept.merchant`. Requires {@link auth.authenticate}.\n */\nconst merchant = {\n /**\n * The merchant's business profile, or `null` if onboarding hasn't been submitted yet.\n *\n * @throws AcceptError `NotAuthenticated`, `NoInternetConnection`, `Unknown`.\n */\n info(): Promise<MerchantInformation | null> {\n return mapErrors(() => Native.getMerchantInfo());\n },\n\n /**\n * The merchant's payment configuration.\n *\n * @throws AcceptError `NotAuthenticated`, `NoInternetConnection`, `Unknown`.\n */\n config(): Promise<MerchantConfig> {\n return mapErrors(() => Native.getMerchantConfig());\n },\n\n /**\n * Whether the merchant is ready to accept payments, or what is blocking it.\n *\n * @throws AcceptError `NotAuthenticated`, `NoInternetConnection`, `Unknown`.\n */\n onboardingStatus(): Promise<OnboardingStatus> {\n return mapErrors(() => Native.getOnboardingStatus());\n },\n\n /**\n * The currency codes the merchant accepts. Shorthand for `config().availableCurrencies`.\n *\n * @throws AcceptError `NotAuthenticated`, `NoInternetConnection`, `Unknown`.\n */\n availableCurrencies(): Promise<string[]> {\n return mapErrors(() => Native.getAvailableCurrencies());\n },\n};\n\n/**\n * Payments. Mirrors `Accept.payments`. Requires {@link auth.authenticate}.\n */\nconst payments = {\n /**\n * Sets the defaults applied to payments that don't override them on {@link pay}.\n *\n * Only the keys present are changed, so one option can be set without disturbing the others.\n * `display` is also what the terminal warm-up fired by {@link auth.authenticate} follows — set it\n * before authenticating to keep the warm-up off the merchant's screen.\n */\n setOptions(options: PaymentOptions): void {\n Native.setPaymentOptions(withoutUndefined(options));\n },\n\n /**\n * Launches the plugin's payment flow and streams its lifecycle to `listener`.\n *\n * Never throws: a failure to create the payment arrives as a `creationFailed` event carrying an\n * {@link AcceptError}. The stream ends after `result` or `creationFailed`, at which point the\n * subscription removes itself.\n *\n * ```ts\n * Accept.payments.pay({ amount: 1000, currency: 'USD' }, (event) => {\n * if (event.type === 'result' && event.payResult.type === 'success') {\n * console.log(event.payResult.paymentToken);\n * }\n * });\n * ```\n *\n * @returns a handle that stops delivering events; see {@link PaymentSubscription.remove}.\n */\n pay(\n request: PaymentRequest,\n listener: (event: PaymentEvent) => void,\n ): PaymentSubscription {\n const requestId = newRequestId();\n let removed = false;\n\n const subscription = Native.addListener(\"onPaymentEvent\", (payload) => {\n if (payload.requestId !== requestId) return;\n if (isTerminal(payload.event)) remove();\n listener(payload.event);\n });\n\n const remove = () => {\n if (removed) return;\n removed = true;\n subscription.remove();\n Native.stopPaymentEvents(requestId);\n };\n\n Native.startPayment(requestId, withoutUndefined(request));\n return { remove };\n },\n\n /**\n * {@link pay} reduced to its outcome, for callers that don't render the intermediate states.\n *\n * @returns the terminal {@link PayResult}.\n * @throws AcceptError whatever the payment would have reported as `creationFailed` — including\n * `PaymentInProgress`, `NotAuthenticated`, `PluginNotReadyForPayments`, `AmountBelowMinimum`,\n * and `LocationPermissionRequired`.\n */\n payAsync(request: PaymentRequest): Promise<PayResult> {\n return new Promise<PayResult>((resolve, reject) => {\n payments.pay(request, (event) => {\n if (event.type === \"result\") resolve(event.payResult);\n else if (event.type === \"creationFailed\")\n reject(toAcceptError(event.error));\n });\n });\n },\n\n /**\n * The current status of the payment identified by `paymentToken`.\n *\n * @throws AcceptError `NotAuthenticated`, `SessionExpired`, `PaymentNotFound`,\n * `NoInternetConnection`, `Unknown`.\n */\n status(paymentToken: string): Promise<PaymentStatus> {\n return mapErrors(() => Native.getPaymentStatus(paymentToken));\n },\n\n /**\n * Cancels the payment identified by `paymentToken`.\n *\n * @returns the resulting {@link PaymentState}.\n * @throws AcceptError `NotAuthenticated`, `SessionExpired`, `PaymentNotFound`,\n * `NoInternetConnection`, `Unknown`.\n */\n cancel(paymentToken: string): Promise<PaymentState> {\n return mapErrors(() => Native.cancelPayment(paymentToken));\n },\n\n /**\n * Refunds the payment identified by `paymentToken`.\n *\n * @returns the resulting {@link PaymentState}.\n * @throws AcceptError `NotAuthenticated`, `SessionExpired`, `PaymentNotFound`,\n * `NoInternetConnection`, `Unknown`.\n */\n refund(paymentToken: string, reason: RefundReason): Promise<PaymentState> {\n return mapErrors(() => Native.refundPayment(paymentToken, reason));\n },\n};\n\nconst bytes = (value: Uint8Array): number[] => Array.from(value);\nconst uint8Array = (value: number[]): Uint8Array => Uint8Array.from(value);\n\n/** JavaScript handle for one opaque native `TagSession`. */\nclass NativeTagSession implements TagSession {\n readonly info: TagInfo;\n readonly ended: Promise<TagSessionEndReason>;\n\n constructor(\n private readonly sessionId: string,\n info: TagInfo,\n ) {\n this.info = info;\n this.ended = mapNfcErrors(() => Native.awaitNfcSessionEnd(sessionId));\n // Keep `ended` as the unmodified public promise. Cleanup is a side effect whose own failure\n // must not turn a successfully observed end reason into a rejection.\n this.ended\n .finally(() => {\n try {\n Native.releaseNfcSession(sessionId);\n } catch {\n // The native module is already being destroyed; it closes all sessions itself.\n }\n })\n .catch(() => undefined);\n }\n\n authenticateClassic(\n block: number,\n keyType: MifareKeyType,\n key: Uint8Array,\n ): Promise<void> {\n return mapNfcErrors(() =>\n Native.nfcAuthenticateClassic(this.sessionId, block, keyType, bytes(key)),\n );\n }\n\n async readBlock(block: number): Promise<Uint8Array> {\n return uint8Array(\n await mapNfcErrors(() => Native.nfcReadBlock(this.sessionId, block)),\n );\n }\n\n writeBlock(block: number, data: Uint8Array): Promise<void> {\n return mapNfcErrors(() =>\n Native.nfcWriteBlock(this.sessionId, block, bytes(data)),\n );\n }\n\n increment(block: number, value: number): Promise<void> {\n return mapNfcErrors(() =>\n Native.nfcIncrement(this.sessionId, block, value),\n );\n }\n\n decrement(block: number, value: number): Promise<void> {\n return mapNfcErrors(() =>\n Native.nfcDecrement(this.sessionId, block, value),\n );\n }\n\n transfer(block: number): Promise<void> {\n return mapNfcErrors(() => Native.nfcTransfer(this.sessionId, block));\n }\n\n restore(block: number): Promise<void> {\n return mapNfcErrors(() => Native.nfcRestore(this.sessionId, block));\n }\n\n async readPages(startPage: number): Promise<Uint8Array> {\n return uint8Array(\n await mapNfcErrors(() => Native.nfcReadPages(this.sessionId, startPage)),\n );\n }\n\n writePage(page: number, data: Uint8Array): Promise<void> {\n return mapNfcErrors(() =>\n Native.nfcWritePage(this.sessionId, page, bytes(data)),\n );\n }\n\n async passwordAuth(password: Uint8Array): Promise<Uint8Array> {\n return uint8Array(\n await mapNfcErrors(() =>\n Native.nfcPasswordAuth(this.sessionId, bytes(password)),\n ),\n );\n }\n\n ultralightCAuth(key: Uint8Array): Promise<void> {\n return mapNfcErrors(() =>\n Native.nfcUltralightCAuth(this.sessionId, bytes(key)),\n );\n }\n\n async transceiveType2(frame: Uint8Array): Promise<Uint8Array> {\n return uint8Array(\n await mapNfcErrors(() =>\n Native.nfcTransceiveType2(this.sessionId, bytes(frame)),\n ),\n );\n }\n\n async transmitApdu(apdu: Uint8Array): Promise<Uint8Array> {\n return uint8Array(\n await mapNfcErrors(() =>\n Native.nfcTransmitApdu(this.sessionId, bytes(apdu)),\n ),\n );\n }\n\n close(): Promise<void> {\n return mapNfcErrors(() => Native.closeNfcSession(this.sessionId));\n }\n}\n\n/**\n * NFC tag sessions on the device's own reader. Requires `initialize()`, but not merchant\n * authentication. The optional NFC artifact must be enabled in the config plugin.\n */\nconst nfc = {\n /** Whether this device has a reader the configured NFC backend can use. */\n isSupported(): boolean {\n return mapErrorsSync(() => Native.isNfcSupported());\n },\n\n /** Waits for a tag and opens a session on it using the foreground Android activity. */\n async openSession(timeouts: TagTimeouts = {}): Promise<TagSession> {\n const opened = await mapNfcErrors(() =>\n Native.openNfcSession(withoutUndefined(timeouts)),\n );\n return new NativeTagSession(opened.sessionId, opened.info);\n },\n};\n\n/**\n * The Accept plugin app — the companion that drives the physical terminal. Mirrors `Accept.plugin`.\n */\nconst plugin = {\n /**\n * Whether the plugin app is installed on this device.\n *\n * @throws AcceptError `NotInitialized`, `Unknown`.\n */\n isInstalled(): boolean {\n return mapErrorsSync(() => Native.isPluginInstalled());\n },\n\n /**\n * Installs the plugin app.\n *\n * On a device with an app store this opens the plugin's listing — branded when the authenticated\n * organization configured one — and needs no session to do it.\n *\n * On a device with no store the SDK downloads the APK and installs it through the system\n * installer. That path is opt-in: pass `{ selfInstall: true }` to this package's config plugin,\n * or it fails with `PluginSelfInstallUnavailable`. It also needs an authenticated merchant\n * (`PluginInstallAuthRequired`) and the user's \"Install unknown apps\" grant for the host app\n * (`PluginInstallPermissionRequired` — send them to Android's\n * `android.settings.MANAGE_UNKNOWN_APP_SOURCES` screen and call this again).\n *\n * `PluginDownloadNotPermitted` is an entitlement decision rather than anything retryable: the\n * merchant is not enabled for the non-store distribution channel. Point them at their account\n * manager or developers@tapaya.com.\n *\n * @throws AcceptError `NotInitialized`, `PluginStoreUnavailable`, `PluginSelfInstallUnavailable`,\n * `PluginInstallAuthRequired`, `PluginInstallPermissionRequired`, `PluginDownloadNotPermitted`,\n * `NoInternetConnection`, `Unknown`.\n */\n install(): Promise<void> {\n return mapErrors(() => Native.installPlugin());\n },\n\n /**\n * Runs the plugin's terminal activation flow and resolves when it finishes. Activation is\n * required before the device can take card payments.\n *\n * @throws AcceptError `ActivationInProgress`, `NotAuthenticated`, `PluginUnavailable`,\n * `NoInternetConnection`, `NoTidsAvailableForMerchant`, `MerchantOnboardingIncomplete`,\n * `Unknown`.\n */\n activateTerminal(): Promise<ActivateTerminalResult> {\n return mapErrors(() => Native.activateTerminal());\n },\n\n /**\n * The plugin's current installed/authenticated/ready state.\n *\n * @throws AcceptError `NotInitialized`, `PluginUnavailable`, `PluginTimeout`, `Unknown`.\n */\n status(): Promise<PluginStatus> {\n return mapErrors(() => Native.getPluginStatus());\n },\n\n /**\n * Whether a newer plugin build is available. Call {@link install} on `updateAvailable`.\n *\n * Answered from the backend's release metadata against the installed package, unauthenticated,\n * so it works during device setup, with no store, and with the plugin absent. A Play-installed\n * plugin is still measured against Play, since a release reaches the backend while the same\n * build can sit in review; the plugin's own check is the fallback.\n *\n * @throws AcceptError `NotInitialized`, `PluginUnavailable`, `PluginTimeout`, `Unknown`.\n */\n updateInfo(): Promise<PluginUpdateInfo> {\n return mapErrors(() => Native.getPluginUpdateInfo());\n },\n\n /**\n * Logs the merchant out of the plugin app.\n *\n * @throws AcceptError `NotInitialized`, `PluginUnavailable`, `PluginTimeout`, `Unknown`.\n */\n logout(): Promise<void> {\n return mapErrors(() => Native.logoutPlugin());\n },\n};\n\n/**\n * Screen topology, for dual-sided POS hardware. Mirrors `Accept.displays`.\n *\n * Every member reads the platform live, so a display hot-plugged or powered off between calls is\n * reflected immediately. None of them throw.\n */\nconst displays = {\n /** Every display the device currently reports, primary first. */\n all(): AcceptDisplay[] {\n return Native.getDisplays();\n },\n\n /**\n * The customer-facing panel of a dual-sided device, or `null` on single-screen devices. This is\n * what `{ type: 'customerFacing' }` targets.\n */\n customerFacing(): AcceptDisplay | null {\n return Native.getCustomerFacingDisplay();\n },\n\n /** Whether a customer-facing display is available right now. */\n get isDualScreen(): boolean {\n return Native.isDualScreen();\n },\n};\n\n/** The listener currently receiving forwarded SDK logs, if any. */\nlet logSubscription: AcceptSubscription | null = null;\n\n/**\n * Entry point to the Accept SDK. Mirrors the `Accept` object in the Accept SDK for Android, so the\n * Android reference documentation applies unchanged.\n *\n * ```ts\n * import Accept from '@tapayadot/accept-react-native';\n *\n * Accept.initialize({ isProduction: false });\n * await Accept.auth.authenticate(merchantToken);\n *\n * if (!Accept.plugin.isInstalled()) await Accept.plugin.install();\n * await Accept.plugin.activateTerminal();\n *\n * const result = await Accept.payments.payAsync({ amount: 1000, currency: 'USD' });\n * ```\n */\nexport const Accept = {\n auth,\n sdk,\n merchant,\n payments,\n nfc,\n plugin,\n displays,\n\n /**\n * Initializes the SDK against sandbox or production. Must be called before any other surface is\n * used — typically once, at app startup.\n *\n * Safe to call more than once; each call resets which environment subsequent requests target.\n */\n initialize(options: InitializeOptions = {}): void {\n Native.initialize(options.isProduction ?? false);\n },\n\n /** The SDK's current lifecycle state. */\n get state(): SdkState {\n return Native.getState();\n },\n\n /**\n * Subscribes to {@link state} transitions. The listener fires with the current state on\n * subscription, then on every change.\n */\n addStateListener(listener: (state: SdkState) => void): AcceptSubscription {\n return Native.addListener(\"onStateChange\", ({ state }) => listener(state));\n },\n\n /**\n * Clears all locally persisted SDK state — auth token, device id, cached config, and theme — and\n * resets {@link state} to `idle`. Call this on merchant logout.\n *\n * @throws AcceptError `Unknown`.\n */\n clear(): Promise<void> {\n return mapErrors(() => Native.clear());\n },\n\n /**\n * Enables or disables diagnostic logging. Shorthand for {@link setLogLevel}: `true` maps to\n * `'DEBUG'`, `false` to `'NONE'`.\n */\n setDebugLoggingEnabled(enabled: boolean): void {\n Native.setDebugLoggingEnabled(enabled);\n },\n\n /**\n * Sets the verbosity of diagnostic logging. Defaults to `'DEBUG'` against sandbox and `'NONE'`\n * against production; call after {@link initialize} to override.\n */\n setLogLevel(level: AcceptLogLevel): void {\n Native.setLogLevel(level);\n },\n\n /**\n * Routes SDK logs into `listener` instead of Logcat, for forwarding into your own logging stack.\n * Pass `null` to restore the default Logcat sink.\n */\n setLogger(listener: ((entry: AcceptLogEntry) => void) | null): void {\n logSubscription?.remove();\n logSubscription = listener ? Native.addListener(\"onLog\", listener) : null;\n Native.setLogForwardingEnabled(listener !== null);\n },\n\n /**\n * Sets the branding applied to the plugin's activation, status, and payment screens.\n *\n * Session-wide, not per payment: it persists until changed or cleared with `null`. Pushed to the\n * plugin opportunistically the next time it is bound or launched, so there is no confirmation\n * that it was applied — the plugin may not be installed or running yet.\n */\n setTheme(theme: AcceptTheme | null): void {\n Native.setTheme(withoutUndefined(theme));\n },\n\n /**\n * The theme currently set via {@link setTheme}, or `null`. Reflects local SDK state only, not\n * whether the plugin applied it.\n */\n getTheme(): AcceptTheme | null {\n return Native.getTheme();\n },\n\n /**\n * Stores `base64` image data in SDK-private storage and returns a `content://` URL the plugin can\n * read — for a logo the host app holds locally rather than at a stable URL. Use the result\n * anywhere an {@link AcceptTheme} image field takes a URL.\n *\n * `assetToBase64` from `@tapayadot/accept-react-native/utils` turns a `require('./logo.png')`\n * into the expected string.\n *\n * @param fileExtension the extension to store the data under, without a leading dot. Tells the\n * plugin how to decode it; defaults to `'png'`.\n * @throws AcceptError `NotInitialized`.\n */\n createLocalThemeImageUri(\n base64: string,\n fileExtension: string = \"png\",\n ): string {\n return mapErrorsSync(() =>\n Native.createLocalThemeImageUri(base64, fileExtension),\n );\n },\n};\n"]}
@@ -288,6 +288,65 @@ export type PaymentSubscription = {
288
288
  */
289
289
  remove: () => void;
290
290
  };
291
+ /** The kind of tag selected by the NFC reader. Mirrors `TagFamily`. */
292
+ export type TagFamily = "MIFARE_CLASSIC_MINI" | "MIFARE_CLASSIC_1K" | "MIFARE_CLASSIC_4K" | "ULTRALIGHT" | "ULTRALIGHT_EV1" | "ULTRALIGHT_C" | "NTAG" | "TYPE2_OTHER" | "ISO_DEP" | "UNKNOWN";
293
+ /** What the reader learned while selecting a tag. Mirrors `TagInfo`. */
294
+ export type TagInfo = {
295
+ /** Upper-case UID bytes with no separators. */
296
+ uidHex: string;
297
+ family: TagFamily;
298
+ /** The select response's unsigned SAK byte. */
299
+ sak: number;
300
+ /** Upper-case ATQA bytes with no separators. */
301
+ atqaHex: string;
302
+ /** ISO-DEP ATS data, when available. */
303
+ atsHex: string | null;
304
+ /** Tag capacity when the selected family determines it. */
305
+ memoryBytes: number | null;
306
+ /** GET_VERSION response on tags that expose one. */
307
+ versionHex: string | null;
308
+ };
309
+ /** Which Mifare Classic key a block is authenticated with. */
310
+ export type MifareKeyType = "A" | "B";
311
+ /** Why an NFC tag session ended. Mirrors `TagSessionEndReason`. */
312
+ export type TagSessionEndReason = "CLOSED" | "CARD_REMOVED" | "IDLE_TIMEOUT" | "PAYMENT" | "ACTIVITY_PAUSED" | "READER_LOST";
313
+ /** Why opening a session or running a tag command failed. Mirrors `TagErrorReason`. */
314
+ export type TagErrorReason = "NAK" | "NO_RESPONSE" | "AUTH_FAILED" | "CARD_REMOVED" | "READER_BUSY" | "TIMEOUT" | "SESSION_ENDED" | "NOT_SUPPORTED" | "NFC_DISABLED" | "VENDOR_ERROR";
315
+ /** Optional NFC session timeouts, in milliseconds. Mirrors `TagTimeouts`. */
316
+ export type TagTimeouts = {
317
+ /** Wait for the initial tap; defaults to 30,000 and must be 1…60,000. */
318
+ tapWaitMs?: number;
319
+ /** One tag command; defaults to 1,000 and must be 1…5,000. */
320
+ operationMs?: number;
321
+ /** Re-select after losing the tag; defaults to 1,000 and must be 1…5,000. */
322
+ reselectMs?: number;
323
+ /** Inactivity before the session ends; defaults to 10,000 and must be 1…60,000. */
324
+ idleMs?: number;
325
+ };
326
+ /**
327
+ * One selected NFC tag. Methods use `Uint8Array` so every byte remains unsigned across the Expo
328
+ * bridge. Unsupported commands reject with `TagSessionError` reason `NOT_SUPPORTED`.
329
+ */
330
+ export type TagSession = {
331
+ readonly info: TagInfo;
332
+ /** Resolves exactly once with the reason this session stopped. */
333
+ readonly ended: Promise<TagSessionEndReason>;
334
+ authenticateClassic(block: number, keyType: MifareKeyType, key: Uint8Array): Promise<void>;
335
+ readBlock(block: number): Promise<Uint8Array>;
336
+ writeBlock(block: number, data: Uint8Array): Promise<void>;
337
+ increment(block: number, value: number): Promise<void>;
338
+ decrement(block: number, value: number): Promise<void>;
339
+ transfer(block: number): Promise<void>;
340
+ restore(block: number): Promise<void>;
341
+ readPages(startPage: number): Promise<Uint8Array>;
342
+ writePage(page: number, data: Uint8Array): Promise<void>;
343
+ passwordAuth(password: Uint8Array): Promise<Uint8Array>;
344
+ ultralightCAuth(key: Uint8Array): Promise<void>;
345
+ transceiveType2(frame: Uint8Array): Promise<Uint8Array>;
346
+ transmitApdu(apdu: Uint8Array): Promise<Uint8Array>;
347
+ /** Idempotently ends the session with `CLOSED`. */
348
+ close(): Promise<void>;
349
+ };
291
350
  /** The plugin app's installed/authenticated/ready state. Mirrors `PluginStatus`. */
292
351
  export type PluginStatus = "notInstalled" | "notAuthenticated" | "authenticated" | "readyForPayments" | "merchantMismatch";
293
352
  /** Whether a newer plugin build is on Google Play. Mirrors `PluginUpdateInfo`. */
@@ -1 +1 @@
1
- {"version":3,"file":"Accept.types.d.ts","sourceRoot":"","sources":["../src/Accept.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,aAAa,GAAG,eAAe,CAAC;AAEhE,6CAA6C;AAC7C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,4EAA4E;IAC5E,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAIF,mFAAmF;AACnF,MAAM,MAAM,cAAc,GACxB,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAE3D,kGAAkG;AAClG,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,cAAc,CAAC;IACtB,mDAAmD;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAIF,0FAA0F;AAC1F,MAAM,MAAM,eAAe,GACvB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,mBAAmB,GACnB,sBAAsB,GACtB,4BAA4B,GAC5B,wBAAwB,GACxB,4BAA4B,GAC5B,8BAA8B,GAC9B,qBAAqB,GACrB,iCAAiC,GACjC,oBAAoB,GACpB,8BAA8B,GAC9B,2BAA2B,GAC3B,uBAAuB,GACvB,4BAA4B,GAC5B,qBAAqB,GACrB,iBAAiB,GACjB,sBAAsB,GACtB,gBAAgB,GAChB,iBAAiB,GACjB,wBAAwB,GACxB,8BAA8B,GAC9B,iCAAiC,GACjC,2BA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,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF,oCAAoC;AACpC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAEF,uGAAuG;AACvG,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,IAAI,CAAC,EAAE,kBAAkB,CAAC;CAC3B,CAAC;AAIF,kFAAkF;AAClF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Accept.types.js","sourceRoot":"","sources":["../src/Accept.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/**\n * Types mirroring the Accept SDK for Android.\n *\n * Every name here corresponds 1:1 to a type in `com.tapaya.accept`, so the Android reference\n * documentation applies unchanged. Kotlin sealed interfaces become tagged unions discriminated on\n * `type`; Kotlin enums become string-literal unions.\n */\n\n// ── Lifecycle ─────────────────────────────────────────────────────────────────\n\n/**\n * Lifecycle state of the SDK. Mirrors `SdkState`.\n *\n * - `idle` — {@link Accept.initialize} has not been called yet.\n * - `initialized` — ready for {@link AcceptAuth.authenticate}.\n * - `authenticated` — the merchant and payments surfaces are usable.\n */\nexport type SdkState = \"idle\" | \"initialized\" | \"authenticated\";\n\n/** Options for {@link Accept.initialize}. */\nexport type InitializeOptions = {\n /** `true` to target production, `false` (the default) to target sandbox. */\n isProduction?: boolean;\n};\n\n// ── Diagnostics ───────────────────────────────────────────────────────────────\n\n/** Verbosity threshold for the SDK's diagnostic logging, least to most verbose. */\nexport type AcceptLogLevel =\n \"NONE\" | \"ERROR\" | \"WARN\" | \"INFO\" | \"DEBUG\" | \"VERBOSE\";\n\n/** A single diagnostic log line, delivered to the listener passed to {@link Accept.setLogger}. */\nexport type AcceptLogEntry = {\n level: AcceptLogLevel;\n /** Stable Logcat-style tag identifying the SDK. */\n tag: string;\n /** Human-readable, already redacted message. */\n message: string;\n /** Message of the cause associated with this line, when there is one. */\n throwable: string | null;\n};\n\n// ── Errors ────────────────────────────────────────────────────────────────────\n\n/** Discriminator on {@link AcceptError}; mirrors the `AcceptException` subclass names. */\nexport type AcceptErrorCode =\n | \"NotInitialized\"\n | \"NotAuthenticated\"\n | \"PluginUnavailable\"\n | \"PaymentInProgress\"\n | \"ActivationInProgress\"\n | \"PluginAlreadyAuthenticated\"\n | \"PluginMerchantMismatch\"\n | \"NoTidsAvailableForMerchant\"\n | \"MerchantOnboardingIncomplete\"\n | \"UnsupportedCurrency\"\n | \"CurrencyNotAvailableForMerchant\"\n | \"AmountBelowMinimum\"\n | \"TransactionTimeoutOutOfRange\"\n | \"PluginNotReadyForPayments\"\n | \"PaymentCreationFailed\"\n | \"LocationPermissionRequired\"\n | \"LocationUnavailable\"\n | \"LocationTimeout\"\n | \"NoInternetConnection\"\n | \"SessionExpired\"\n | \"PaymentNotFound\"\n | \"PluginStoreUnavailable\"\n | \"PluginSelfInstallUnavailable\"\n | \"PluginInstallPermissionRequired\"\n | \"PluginInstallAuthRequired\"\n | \"PluginDownloadNotPermitted\"\n | \"PluginTimeout\"\n | \"UnknownEnvironment\"\n | \"Unknown\";\n\n/** The payload fields carried by the error codes that have any. */\nexport type AcceptErrorDetails = {\n /** `MerchantOnboardingIncomplete`: the merchant's current onboarding state. */\n state?: OnboardingState;\n /** `UnsupportedCurrency`, `CurrencyNotAvailableForMerchant`, `AmountBelowMinimum`. */\n currency?: string;\n /** `AmountBelowMinimum`: the minimum required amount, in minor units. */\n minimum?: number;\n /** `TransactionTimeoutOutOfRange`: the out-of-range value that was passed, in milliseconds. */\n transactionTimeoutMs?: number;\n /** `PluginNotReadyForPayments`: the plugin's status at the time of the call. */\n status?: PluginStatus;\n /** `UnknownEnvironment`: the environment key that was not recognized. */\n environment?: string;\n /** `PaymentCreationFailed`, `Unknown`: the underlying error's message. Not for end-user display. */\n cause?: string;\n};\n\n// ── SDK configuration ─────────────────────────────────────────────────────────\n\n/** The minimum payable amount for one currency. Mirrors `MinimumAmount`. */\nexport type MinimumAmount = {\n /** ISO 4217 currency code. */\n currency: string;\n /** The minimum amount, in the currency's minor unit. */\n amount: number;\n};\n\n// ── Merchant ──────────────────────────────────────────────────────────────────\n\n/** Mirrors `BusinessType`. */\nexport type BusinessType =\n | \"INDIVIDUAL\"\n | \"COMPANY\"\n | \"NONPROFIT_ORGANIZATION\"\n | \"GOVERNMENT_ENTITY\"\n | \"PARTNERSHIP\";\n\n/** The merchant's payment configuration. Mirrors `MerchantConfig`. */\nexport type MerchantConfig = {\n /** ISO 4217 codes the merchant is configured to accept. */\n availableCurrencies: string[];\n /** The merchant's default currency, when one is set. */\n currency: string | null;\n};\n\n/** The merchant's business profile. Mirrors `MerchantInformation`. */\nexport type MerchantInformation = {\n merchantId: string;\n email: string;\n businessType: BusinessType;\n legalName: string;\n registrationNumber: string;\n mcc: string;\n addressLine1: string;\n city: string;\n country: string;\n vatNumber: string | null;\n incorporationDate: string | null;\n addressLine2: string | null;\n postalCode: string | null;\n state: string | null;\n phone: string | null;\n averageItemValue: number | null;\n expectedMonthlyTurnover: number | null;\n businessModelDescription: string | null;\n numberOfEmployees: number | null;\n annualTurnover: number | null;\n balanceSheetTotal: number | null;\n statementDescriptor: string | null;\n termsVersion: string | null;\n};\n\n/** Mirrors `OnboardingState`. */\nexport type OnboardingState =\n | \"NOT_STARTED\"\n | \"PENDING\"\n | \"ACTIVE\"\n | \"ATTENTION_NEEDED\"\n | \"ACTION_REQUIRED\"\n | \"BLOCKED\"\n | \"WAITING_FOR_KYB\"\n | \"WAITING_FOR_STAKEHOLDERS\"\n | \"PENDING_ACQUIRER_APPROVAL\";\n\n/** Whether the merchant can accept payments, or what is blocking it. Mirrors `OnboardingStatus`. */\nexport type OnboardingStatus =\n | { type: \"readyForPayments\" }\n | { type: \"requiresAction\"; state: OnboardingState };\n\n// ── Payments ──────────────────────────────────────────────────────────────────\n\n/** Lifecycle state of a payment on the backend. Mirrors `PaymentState`. */\nexport type PaymentState =\n \"PENDING\" | \"SUCCESS\" | \"CANCELLED\" | \"REFUNDED\" | \"FAILED\" | \"ACTION_NEEDED\";\n\n/** Mirrors `PaymentStatus`. Amounts are decimal strings as returned by the backend. */\nexport type PaymentStatus = {\n state: PaymentState;\n paymentToken: string;\n requestedAmount: string;\n requestedCurrency: string;\n settlementAmount: string;\n settlementCurrency: string;\n createdAt: string;\n receiptUrl: string;\n processedAt: string | null;\n};\n\n/** Mirrors `RefundReason`. */\nexport type RefundReason =\n \"CUSTOMER_REQUEST\" | \"DUPLICATE\" | \"FRAUDULENT\" | \"EXPIRED_CHARGE\";\n\n/** Card-scheme detail for the completed transaction. Mirrors `ReceiptDetails`. */\nexport type ReceiptDetails = {\n merchantId: string | null;\n terminalId: string | null;\n cardBrand: string | null;\n appLabel: string | null;\n aid: string | null;\n maskedPan: string | null;\n responseCode: string | null;\n transactionTimestamp: string | null;\n};\n\n/** Why the plugin reported a `failed` {@link PayResult}. Mirrors `PayFailureReason`. */\nexport type PayFailureReason =\n | \"INVALID_INTENT\"\n | \"NOT_ACTIVATED\"\n | \"TERMINAL_INIT_FAILED\"\n | \"PAYMENT_SETUP_FAILED\"\n | \"PLUGIN_UNAVAILABLE\"\n | \"UNKNOWN\";\n\n/** Terminal outcome of a payment run by the plugin. Mirrors `PayResult`. */\nexport type PayResult =\n | {\n type: \"success\";\n paymentToken: string;\n metadata: Record<string, string> | null;\n authCode: string | null;\n receiptDetails: ReceiptDetails | null;\n receiptUrl: string | null;\n }\n | {\n type: \"declined\";\n metadata: Record<string, string> | null;\n receiptDetails: ReceiptDetails | null;\n receiptUrl: string | null;\n }\n | { type: \"canceled\"; metadata: Record<string, string> | null }\n | {\n type: \"failed\";\n reason: PayFailureReason;\n metadata: Record<string, string> | null;\n };\n\n/**\n * Lifecycle of a payment request, delivered to the listener passed to {@link AcceptPayments.pay}.\n * Mirrors `PaymentEvent`.\n *\n * Exactly one of `result` or `creationFailed` ends the stream.\n */\nexport type PaymentEvent =\n | { type: \"creating\" }\n | { type: \"created\"; paymentToken: string; receiptUrl: string | null }\n | { type: \"launched\" }\n | { type: \"result\"; payResult: PayResult }\n | {\n type: \"creationFailed\";\n error: { code: AcceptErrorCode; message: string } & AcceptErrorDetails;\n };\n\n/** How the plugin dismisses its receipt screen. Mirrors `DismissBehavior`. */\nexport type DismissBehavior =\n { type: \"manual\" } | { type: \"delayed\"; delayMs: number };\n\n/** Whether the plugin prints a paper receipt. Mirrors `ReceiptPrintBehavior`. */\nexport type ReceiptPrintBehavior = \"automatic\" | \"onDemand\" | \"disabled\";\n\n/** What the plugin shows after a payment completes. Mirrors `PaymentReceiptConfig`. */\nexport type PaymentReceiptConfig =\n | { type: \"dismissImmediately\" }\n | {\n type: \"show\";\n /** Defaults to `true`. */\n showQrCodeReceipt?: boolean;\n /** Defaults to `{ type: 'manual' }`. */\n dismissBehavior?: DismissBehavior;\n /** Defaults to `'onDemand'`. */\n printBehavior?: ReceiptPrintBehavior;\n };\n\n/** Which face of the device carries the NFC antenna. Mirrors `OnDeviceSurface`. */\nexport type OnDeviceSurface = \"back\" | \"frontScreen\";\n\n/** Where the merchant should tap the card. Mirrors `NfcPositionConfig`. */\nexport type NfcPositionConfig =\n | { type: \"unspecified\" }\n | { type: \"externalAbove\" }\n | {\n type: \"externalReader\";\n /** Replaces the companion's own prompt; you own its localization. Blank keeps the default. */\n message?: string;\n /** Which screen edge the reader sits beyond. Omit to show no chevrons. */\n indicator?: ReaderIndicator;\n }\n | {\n type: \"onDevice\";\n surface: OnDeviceSurface;\n /** Horizontal position of the antenna, 0..1 across the surface. */\n xFraction: number;\n /** Vertical position of the antenna, 0..1 down the surface. */\n yFraction: number;\n };\n\n/** Screen edge an external reader sits beyond, in the device's natural orientation. Mirrors `ReaderEdge`. */\nexport type ReaderEdge = \"top\" | \"right\" | \"bottom\" | \"left\";\n\n/** Where an external reader sits relative to the screen. Mirrors `ReaderIndicator`. */\nexport type ReaderIndicator = {\n edge: ReaderEdge;\n /**\n * Position along {@link edge}, 0..1: left to right along `top`/`bottom`, top to bottom along\n * `left`/`right`. Defaults to 0.5.\n */\n offsetFraction?: number;\n};\n\n/**\n * Whether the payment UI may rotate 180° when the merchant turns the device toward the customer.\n * Mirrors `CustomerFacingFlipConfig`. `'disabled'` is for hardware that is already\n * customer-facing — a fixed POS, a dual-sided panel, a device in a stand — where the turn never\n * happens and the sensors only produce accidental flips. A companion build that predates the\n * option ignores it.\n */\nexport type CustomerFacingFlipConfig = \"automatic\" | \"disabled\";\n\n/** Which screen the plugin's payment UI runs on. Mirrors `PaymentDisplay`. */\nexport type PaymentDisplay =\n | { type: \"default\" }\n | { type: \"customerFacing\" }\n | { type: \"specific\"; displayId: number };\n\n/** Session-wide payment defaults. Mirrors the parameters of `AcceptPayments.setOptions`. */\nexport type PaymentOptions = {\n receiptConfig?: PaymentReceiptConfig;\n nfcPosition?: NfcPositionConfig;\n /**\n * How long the plugin waits for the card tap, in milliseconds; 0..120000. Pass `null` to restore\n * the plugin's own fallback (~60 seconds). Omit the key to leave the current default alone.\n */\n transactionTimeoutMs?: number | null;\n display?: PaymentDisplay;\n /** Defaults to `'automatic'`. */\n customerFacingFlip?: CustomerFacingFlipConfig;\n};\n\n/** A payment to run. Mirrors the parameters of `AcceptPayments.pay`. */\nexport type PaymentRequest = {\n /** The amount to charge, in the currency's minor unit (e.g. cents for USD). */\n amount: number;\n /** ISO 4217 currency code. */\n currency: string;\n /** Token of an existing payment session to resume. */\n paymentToken?: string;\n /** Overrides the session default for this payment only. */\n receiptConfig?: PaymentReceiptConfig;\n /** Overrides the session default for this payment only. */\n nfcPosition?: NfcPositionConfig;\n /** Key-value data attached to the payment and echoed back on the {@link PayResult}. */\n metadata?: Record<string, string>;\n /** A fixed tip, in the currency's minor unit. When set, the plugin skips its own tip screen. */\n tip?: number;\n /** Overrides the session default for this payment only; 0..120000 milliseconds. */\n transactionTimeoutMs?: number;\n /** Overrides the session default for this payment only. */\n display?: PaymentDisplay;\n /** Overrides the session default for this payment only. */\n customerFacingFlip?: CustomerFacingFlipConfig;\n};\n\n/** Handle returned by {@link AcceptPayments.pay}. */\nexport type PaymentSubscription = {\n /**\n * Stops delivering events for this payment. The plugin's UI is already on screen by then — it is\n * dismissed by the user, or the payment is voided with {@link AcceptPayments.cancel}.\n */\n remove: () => void;\n};\n\n// ── Plugin ────────────────────────────────────────────────────────────────────\n\n/** The plugin app's installed/authenticated/ready state. Mirrors `PluginStatus`. */\nexport type PluginStatus =\n | \"notInstalled\"\n | \"notAuthenticated\"\n | \"authenticated\"\n | \"readyForPayments\"\n | \"merchantMismatch\";\n\n/** Whether a newer plugin build is on Google Play. Mirrors `PluginUpdateInfo`. */\nexport type PluginUpdateInfo =\n | { type: \"upToDate\" }\n | { type: \"updateAvailable\"; priority: number }\n | { type: \"unknown\" };\n\n/** Why an activation attempt failed. Mirrors `ActivateTerminalFailureReason`. */\nexport type ActivateTerminalFailureReason =\n | \"INVALID_INTENT\"\n | \"HANDOVER_FAILED\"\n | \"CONFIRM_FAILED\"\n | \"MERCHANT_NOT_ONBOARDED\"\n | \"UNKNOWN\";\n\n/** Outcome of {@link AcceptPlugin.activateTerminal}. Mirrors `ActivateTerminalResult`. */\nexport type ActivateTerminalResult =\n | { type: \"success\" }\n | { type: \"canceled\" }\n | { type: \"failed\"; reason: ActivateTerminalFailureReason };\n\n// ── Displays ──────────────────────────────────────────────────────────────────\n\n/** One display the device reports. Mirrors `AcceptDisplay`. */\nexport type AcceptDisplay = {\n id: number;\n name: string;\n isPrimary: boolean;\n isPresentation: boolean;\n widthPx: number;\n heightPx: number;\n};\n\n// ── Theming ───────────────────────────────────────────────────────────────────\n\n/** Mirrors `AcceptThemeColors`. Values are hex strings — `#RRGGBB` or `#AARRGGBB`. */\nexport type AcceptThemeColors = {\n primary?: string;\n onPrimary?: string;\n primaryContainer?: string;\n onPrimaryContainer?: string;\n secondary?: string;\n onSecondary?: string;\n secondaryContainer?: string;\n onSecondaryContainer?: string;\n error?: string;\n onError?: string;\n errorContainer?: string;\n onErrorContainer?: string;\n background?: string;\n onBackground?: string;\n surface?: string;\n onSurface?: string;\n surfaceVariant?: string;\n onSurfaceVariant?: string;\n outline?: string;\n outlineVariant?: string;\n warning?: string;\n onWarning?: string;\n warningContainer?: string;\n onWarningContainer?: string;\n success?: string;\n onSuccess?: string;\n successContainer?: string;\n onSuccessContainer?: string;\n};\n\n/**\n * Mirrors `AcceptThemeImages`. Each value is a URL the plugin loads — either an `https://` URL, or\n * a `content://` URL produced by {@link Accept.createLocalThemeImageUri} for an image the host app\n * holds locally.\n */\nexport type AcceptThemeImages = {\n logoText?: string;\n logoTextSolid?: string;\n logoSymbol?: string;\n logoSymbolWithBackground?: string;\n};\n\n/** Mirrors `AcceptThemeVariant`. */\nexport type AcceptThemeVariant = {\n colors?: AcceptThemeColors;\n images?: AcceptThemeImages;\n};\n\n/** Branding applied to the plugin's activation, status, and payment screens. Mirrors `AcceptTheme`. */\nexport type AcceptTheme = {\n light?: AcceptThemeVariant;\n dark?: AcceptThemeVariant;\n};\n\n// ── Subscriptions ─────────────────────────────────────────────────────────────\n\n/** Handle returned by the `on*` listeners. Mirrors Expo's `EventSubscription`. */\nexport type AcceptSubscription = {\n remove: () => void;\n};\n"]}
1
+ {"version":3,"file":"Accept.types.js","sourceRoot":"","sources":["../src/Accept.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/**\n * Types mirroring the Accept SDK for Android.\n *\n * Every name here corresponds 1:1 to a type in `com.tapaya.accept`, so the Android reference\n * documentation applies unchanged. Kotlin sealed interfaces become tagged unions discriminated on\n * `type`; Kotlin enums become string-literal unions.\n */\n\n// ── Lifecycle ─────────────────────────────────────────────────────────────────\n\n/**\n * Lifecycle state of the SDK. Mirrors `SdkState`.\n *\n * - `idle` — {@link Accept.initialize} has not been called yet.\n * - `initialized` — ready for {@link AcceptAuth.authenticate}.\n * - `authenticated` — the merchant and payments surfaces are usable.\n */\nexport type SdkState = \"idle\" | \"initialized\" | \"authenticated\";\n\n/** Options for {@link Accept.initialize}. */\nexport type InitializeOptions = {\n /** `true` to target production, `false` (the default) to target sandbox. */\n isProduction?: boolean;\n};\n\n// ── Diagnostics ───────────────────────────────────────────────────────────────\n\n/** Verbosity threshold for the SDK's diagnostic logging, least to most verbose. */\nexport type AcceptLogLevel =\n \"NONE\" | \"ERROR\" | \"WARN\" | \"INFO\" | \"DEBUG\" | \"VERBOSE\";\n\n/** A single diagnostic log line, delivered to the listener passed to {@link Accept.setLogger}. */\nexport type AcceptLogEntry = {\n level: AcceptLogLevel;\n /** Stable Logcat-style tag identifying the SDK. */\n tag: string;\n /** Human-readable, already redacted message. */\n message: string;\n /** Message of the cause associated with this line, when there is one. */\n throwable: string | null;\n};\n\n// ── Errors ────────────────────────────────────────────────────────────────────\n\n/** Discriminator on {@link AcceptError}; mirrors the `AcceptException` subclass names. */\nexport type AcceptErrorCode =\n | \"NotInitialized\"\n | \"NotAuthenticated\"\n | \"PluginUnavailable\"\n | \"PaymentInProgress\"\n | \"ActivationInProgress\"\n | \"PluginAlreadyAuthenticated\"\n | \"PluginMerchantMismatch\"\n | \"NoTidsAvailableForMerchant\"\n | \"MerchantOnboardingIncomplete\"\n | \"UnsupportedCurrency\"\n | \"CurrencyNotAvailableForMerchant\"\n | \"AmountBelowMinimum\"\n | \"TransactionTimeoutOutOfRange\"\n | \"PluginNotReadyForPayments\"\n | \"PaymentCreationFailed\"\n | \"LocationPermissionRequired\"\n | \"LocationUnavailable\"\n | \"LocationTimeout\"\n | \"NoInternetConnection\"\n | \"SessionExpired\"\n | \"PaymentNotFound\"\n | \"PluginStoreUnavailable\"\n | \"PluginSelfInstallUnavailable\"\n | \"PluginInstallPermissionRequired\"\n | \"PluginInstallAuthRequired\"\n | \"PluginDownloadNotPermitted\"\n | \"PluginTimeout\"\n | \"UnknownEnvironment\"\n | \"Unknown\";\n\n/** The payload fields carried by the error codes that have any. */\nexport type AcceptErrorDetails = {\n /** `MerchantOnboardingIncomplete`: the merchant's current onboarding state. */\n state?: OnboardingState;\n /** `UnsupportedCurrency`, `CurrencyNotAvailableForMerchant`, `AmountBelowMinimum`. */\n currency?: string;\n /** `AmountBelowMinimum`: the minimum required amount, in minor units. */\n minimum?: number;\n /** `TransactionTimeoutOutOfRange`: the out-of-range value that was passed, in milliseconds. */\n transactionTimeoutMs?: number;\n /** `PluginNotReadyForPayments`: the plugin's status at the time of the call. */\n status?: PluginStatus;\n /** `UnknownEnvironment`: the environment key that was not recognized. */\n environment?: string;\n /** `PaymentCreationFailed`, `Unknown`: the underlying error's message. Not for end-user display. */\n cause?: string;\n};\n\n// ── SDK configuration ─────────────────────────────────────────────────────────\n\n/** The minimum payable amount for one currency. Mirrors `MinimumAmount`. */\nexport type MinimumAmount = {\n /** ISO 4217 currency code. */\n currency: string;\n /** The minimum amount, in the currency's minor unit. */\n amount: number;\n};\n\n// ── Merchant ──────────────────────────────────────────────────────────────────\n\n/** Mirrors `BusinessType`. */\nexport type BusinessType =\n | \"INDIVIDUAL\"\n | \"COMPANY\"\n | \"NONPROFIT_ORGANIZATION\"\n | \"GOVERNMENT_ENTITY\"\n | \"PARTNERSHIP\";\n\n/** The merchant's payment configuration. Mirrors `MerchantConfig`. */\nexport type MerchantConfig = {\n /** ISO 4217 codes the merchant is configured to accept. */\n availableCurrencies: string[];\n /** The merchant's default currency, when one is set. */\n currency: string | null;\n};\n\n/** The merchant's business profile. Mirrors `MerchantInformation`. */\nexport type MerchantInformation = {\n merchantId: string;\n email: string;\n businessType: BusinessType;\n legalName: string;\n registrationNumber: string;\n mcc: string;\n addressLine1: string;\n city: string;\n country: string;\n vatNumber: string | null;\n incorporationDate: string | null;\n addressLine2: string | null;\n postalCode: string | null;\n state: string | null;\n phone: string | null;\n averageItemValue: number | null;\n expectedMonthlyTurnover: number | null;\n businessModelDescription: string | null;\n numberOfEmployees: number | null;\n annualTurnover: number | null;\n balanceSheetTotal: number | null;\n statementDescriptor: string | null;\n termsVersion: string | null;\n};\n\n/** Mirrors `OnboardingState`. */\nexport type OnboardingState =\n | \"NOT_STARTED\"\n | \"PENDING\"\n | \"ACTIVE\"\n | \"ATTENTION_NEEDED\"\n | \"ACTION_REQUIRED\"\n | \"BLOCKED\"\n | \"WAITING_FOR_KYB\"\n | \"WAITING_FOR_STAKEHOLDERS\"\n | \"PENDING_ACQUIRER_APPROVAL\";\n\n/** Whether the merchant can accept payments, or what is blocking it. Mirrors `OnboardingStatus`. */\nexport type OnboardingStatus =\n | { type: \"readyForPayments\" }\n | { type: \"requiresAction\"; state: OnboardingState };\n\n// ── Payments ──────────────────────────────────────────────────────────────────\n\n/** Lifecycle state of a payment on the backend. Mirrors `PaymentState`. */\nexport type PaymentState =\n \"PENDING\" | \"SUCCESS\" | \"CANCELLED\" | \"REFUNDED\" | \"FAILED\" | \"ACTION_NEEDED\";\n\n/** Mirrors `PaymentStatus`. Amounts are decimal strings as returned by the backend. */\nexport type PaymentStatus = {\n state: PaymentState;\n paymentToken: string;\n requestedAmount: string;\n requestedCurrency: string;\n settlementAmount: string;\n settlementCurrency: string;\n createdAt: string;\n receiptUrl: string;\n processedAt: string | null;\n};\n\n/** Mirrors `RefundReason`. */\nexport type RefundReason =\n \"CUSTOMER_REQUEST\" | \"DUPLICATE\" | \"FRAUDULENT\" | \"EXPIRED_CHARGE\";\n\n/** Card-scheme detail for the completed transaction. Mirrors `ReceiptDetails`. */\nexport type ReceiptDetails = {\n merchantId: string | null;\n terminalId: string | null;\n cardBrand: string | null;\n appLabel: string | null;\n aid: string | null;\n maskedPan: string | null;\n responseCode: string | null;\n transactionTimestamp: string | null;\n};\n\n/** Why the plugin reported a `failed` {@link PayResult}. Mirrors `PayFailureReason`. */\nexport type PayFailureReason =\n | \"INVALID_INTENT\"\n | \"NOT_ACTIVATED\"\n | \"TERMINAL_INIT_FAILED\"\n | \"PAYMENT_SETUP_FAILED\"\n | \"PLUGIN_UNAVAILABLE\"\n | \"UNKNOWN\";\n\n/** Terminal outcome of a payment run by the plugin. Mirrors `PayResult`. */\nexport type PayResult =\n | {\n type: \"success\";\n paymentToken: string;\n metadata: Record<string, string> | null;\n authCode: string | null;\n receiptDetails: ReceiptDetails | null;\n receiptUrl: string | null;\n }\n | {\n type: \"declined\";\n metadata: Record<string, string> | null;\n receiptDetails: ReceiptDetails | null;\n receiptUrl: string | null;\n }\n | { type: \"canceled\"; metadata: Record<string, string> | null }\n | {\n type: \"failed\";\n reason: PayFailureReason;\n metadata: Record<string, string> | null;\n };\n\n/**\n * Lifecycle of a payment request, delivered to the listener passed to {@link AcceptPayments.pay}.\n * Mirrors `PaymentEvent`.\n *\n * Exactly one of `result` or `creationFailed` ends the stream.\n */\nexport type PaymentEvent =\n | { type: \"creating\" }\n | { type: \"created\"; paymentToken: string; receiptUrl: string | null }\n | { type: \"launched\" }\n | { type: \"result\"; payResult: PayResult }\n | {\n type: \"creationFailed\";\n error: { code: AcceptErrorCode; message: string } & AcceptErrorDetails;\n };\n\n/** How the plugin dismisses its receipt screen. Mirrors `DismissBehavior`. */\nexport type DismissBehavior =\n { type: \"manual\" } | { type: \"delayed\"; delayMs: number };\n\n/** Whether the plugin prints a paper receipt. Mirrors `ReceiptPrintBehavior`. */\nexport type ReceiptPrintBehavior = \"automatic\" | \"onDemand\" | \"disabled\";\n\n/** What the plugin shows after a payment completes. Mirrors `PaymentReceiptConfig`. */\nexport type PaymentReceiptConfig =\n | { type: \"dismissImmediately\" }\n | {\n type: \"show\";\n /** Defaults to `true`. */\n showQrCodeReceipt?: boolean;\n /** Defaults to `{ type: 'manual' }`. */\n dismissBehavior?: DismissBehavior;\n /** Defaults to `'onDemand'`. */\n printBehavior?: ReceiptPrintBehavior;\n };\n\n/** Which face of the device carries the NFC antenna. Mirrors `OnDeviceSurface`. */\nexport type OnDeviceSurface = \"back\" | \"frontScreen\";\n\n/** Where the merchant should tap the card. Mirrors `NfcPositionConfig`. */\nexport type NfcPositionConfig =\n | { type: \"unspecified\" }\n | { type: \"externalAbove\" }\n | {\n type: \"externalReader\";\n /** Replaces the companion's own prompt; you own its localization. Blank keeps the default. */\n message?: string;\n /** Which screen edge the reader sits beyond. Omit to show no chevrons. */\n indicator?: ReaderIndicator;\n }\n | {\n type: \"onDevice\";\n surface: OnDeviceSurface;\n /** Horizontal position of the antenna, 0..1 across the surface. */\n xFraction: number;\n /** Vertical position of the antenna, 0..1 down the surface. */\n yFraction: number;\n };\n\n/** Screen edge an external reader sits beyond, in the device's natural orientation. Mirrors `ReaderEdge`. */\nexport type ReaderEdge = \"top\" | \"right\" | \"bottom\" | \"left\";\n\n/** Where an external reader sits relative to the screen. Mirrors `ReaderIndicator`. */\nexport type ReaderIndicator = {\n edge: ReaderEdge;\n /**\n * Position along {@link edge}, 0..1: left to right along `top`/`bottom`, top to bottom along\n * `left`/`right`. Defaults to 0.5.\n */\n offsetFraction?: number;\n};\n\n/**\n * Whether the payment UI may rotate 180° when the merchant turns the device toward the customer.\n * Mirrors `CustomerFacingFlipConfig`. `'disabled'` is for hardware that is already\n * customer-facing — a fixed POS, a dual-sided panel, a device in a stand — where the turn never\n * happens and the sensors only produce accidental flips. A companion build that predates the\n * option ignores it.\n */\nexport type CustomerFacingFlipConfig = \"automatic\" | \"disabled\";\n\n/** Which screen the plugin's payment UI runs on. Mirrors `PaymentDisplay`. */\nexport type PaymentDisplay =\n | { type: \"default\" }\n | { type: \"customerFacing\" }\n | { type: \"specific\"; displayId: number };\n\n/** Session-wide payment defaults. Mirrors the parameters of `AcceptPayments.setOptions`. */\nexport type PaymentOptions = {\n receiptConfig?: PaymentReceiptConfig;\n nfcPosition?: NfcPositionConfig;\n /**\n * How long the plugin waits for the card tap, in milliseconds; 0..120000. Pass `null` to restore\n * the plugin's own fallback (~60 seconds). Omit the key to leave the current default alone.\n */\n transactionTimeoutMs?: number | null;\n display?: PaymentDisplay;\n /** Defaults to `'automatic'`. */\n customerFacingFlip?: CustomerFacingFlipConfig;\n};\n\n/** A payment to run. Mirrors the parameters of `AcceptPayments.pay`. */\nexport type PaymentRequest = {\n /** The amount to charge, in the currency's minor unit (e.g. cents for USD). */\n amount: number;\n /** ISO 4217 currency code. */\n currency: string;\n /** Token of an existing payment session to resume. */\n paymentToken?: string;\n /** Overrides the session default for this payment only. */\n receiptConfig?: PaymentReceiptConfig;\n /** Overrides the session default for this payment only. */\n nfcPosition?: NfcPositionConfig;\n /** Key-value data attached to the payment and echoed back on the {@link PayResult}. */\n metadata?: Record<string, string>;\n /** A fixed tip, in the currency's minor unit. When set, the plugin skips its own tip screen. */\n tip?: number;\n /** Overrides the session default for this payment only; 0..120000 milliseconds. */\n transactionTimeoutMs?: number;\n /** Overrides the session default for this payment only. */\n display?: PaymentDisplay;\n /** Overrides the session default for this payment only. */\n customerFacingFlip?: CustomerFacingFlipConfig;\n};\n\n/** Handle returned by {@link AcceptPayments.pay}. */\nexport type PaymentSubscription = {\n /**\n * Stops delivering events for this payment. The plugin's UI is already on screen by then — it is\n * dismissed by the user, or the payment is voided with {@link AcceptPayments.cancel}.\n */\n remove: () => void;\n};\n\n// ── NFC tag sessions ─────────────────────────────────────────────────────────\n\n/** The kind of tag selected by the NFC reader. Mirrors `TagFamily`. */\nexport type TagFamily =\n | \"MIFARE_CLASSIC_MINI\"\n | \"MIFARE_CLASSIC_1K\"\n | \"MIFARE_CLASSIC_4K\"\n | \"ULTRALIGHT\"\n | \"ULTRALIGHT_EV1\"\n | \"ULTRALIGHT_C\"\n | \"NTAG\"\n | \"TYPE2_OTHER\"\n | \"ISO_DEP\"\n | \"UNKNOWN\";\n\n/** What the reader learned while selecting a tag. Mirrors `TagInfo`. */\nexport type TagInfo = {\n /** Upper-case UID bytes with no separators. */\n uidHex: string;\n family: TagFamily;\n /** The select response's unsigned SAK byte. */\n sak: number;\n /** Upper-case ATQA bytes with no separators. */\n atqaHex: string;\n /** ISO-DEP ATS data, when available. */\n atsHex: string | null;\n /** Tag capacity when the selected family determines it. */\n memoryBytes: number | null;\n /** GET_VERSION response on tags that expose one. */\n versionHex: string | null;\n};\n\n/** Which Mifare Classic key a block is authenticated with. */\nexport type MifareKeyType = \"A\" | \"B\";\n\n/** Why an NFC tag session ended. Mirrors `TagSessionEndReason`. */\nexport type TagSessionEndReason =\n | \"CLOSED\"\n | \"CARD_REMOVED\"\n | \"IDLE_TIMEOUT\"\n | \"PAYMENT\"\n | \"ACTIVITY_PAUSED\"\n | \"READER_LOST\";\n\n/** Why opening a session or running a tag command failed. Mirrors `TagErrorReason`. */\nexport type TagErrorReason =\n | \"NAK\"\n | \"NO_RESPONSE\"\n | \"AUTH_FAILED\"\n | \"CARD_REMOVED\"\n | \"READER_BUSY\"\n | \"TIMEOUT\"\n | \"SESSION_ENDED\"\n | \"NOT_SUPPORTED\"\n | \"NFC_DISABLED\"\n | \"VENDOR_ERROR\";\n\n/** Optional NFC session timeouts, in milliseconds. Mirrors `TagTimeouts`. */\nexport type TagTimeouts = {\n /** Wait for the initial tap; defaults to 30,000 and must be 1…60,000. */\n tapWaitMs?: number;\n /** One tag command; defaults to 1,000 and must be 1…5,000. */\n operationMs?: number;\n /** Re-select after losing the tag; defaults to 1,000 and must be 1…5,000. */\n reselectMs?: number;\n /** Inactivity before the session ends; defaults to 10,000 and must be 1…60,000. */\n idleMs?: number;\n};\n\n/**\n * One selected NFC tag. Methods use `Uint8Array` so every byte remains unsigned across the Expo\n * bridge. Unsupported commands reject with `TagSessionError` reason `NOT_SUPPORTED`.\n */\nexport type TagSession = {\n readonly info: TagInfo;\n /** Resolves exactly once with the reason this session stopped. */\n readonly ended: Promise<TagSessionEndReason>;\n authenticateClassic(\n block: number,\n keyType: MifareKeyType,\n key: Uint8Array,\n ): Promise<void>;\n readBlock(block: number): Promise<Uint8Array>;\n writeBlock(block: number, data: Uint8Array): Promise<void>;\n increment(block: number, value: number): Promise<void>;\n decrement(block: number, value: number): Promise<void>;\n transfer(block: number): Promise<void>;\n restore(block: number): Promise<void>;\n readPages(startPage: number): Promise<Uint8Array>;\n writePage(page: number, data: Uint8Array): Promise<void>;\n passwordAuth(password: Uint8Array): Promise<Uint8Array>;\n ultralightCAuth(key: Uint8Array): Promise<void>;\n transceiveType2(frame: Uint8Array): Promise<Uint8Array>;\n transmitApdu(apdu: Uint8Array): Promise<Uint8Array>;\n /** Idempotently ends the session with `CLOSED`. */\n close(): Promise<void>;\n};\n\n// ── Plugin ────────────────────────────────────────────────────────────────────\n\n/** The plugin app's installed/authenticated/ready state. Mirrors `PluginStatus`. */\nexport type PluginStatus =\n | \"notInstalled\"\n | \"notAuthenticated\"\n | \"authenticated\"\n | \"readyForPayments\"\n | \"merchantMismatch\";\n\n/** Whether a newer plugin build is on Google Play. Mirrors `PluginUpdateInfo`. */\nexport type PluginUpdateInfo =\n | { type: \"upToDate\" }\n | { type: \"updateAvailable\"; priority: number }\n | { type: \"unknown\" };\n\n/** Why an activation attempt failed. Mirrors `ActivateTerminalFailureReason`. */\nexport type ActivateTerminalFailureReason =\n | \"INVALID_INTENT\"\n | \"HANDOVER_FAILED\"\n | \"CONFIRM_FAILED\"\n | \"MERCHANT_NOT_ONBOARDED\"\n | \"UNKNOWN\";\n\n/** Outcome of {@link AcceptPlugin.activateTerminal}. Mirrors `ActivateTerminalResult`. */\nexport type ActivateTerminalResult =\n | { type: \"success\" }\n | { type: \"canceled\" }\n | { type: \"failed\"; reason: ActivateTerminalFailureReason };\n\n// ── Displays ──────────────────────────────────────────────────────────────────\n\n/** One display the device reports. Mirrors `AcceptDisplay`. */\nexport type AcceptDisplay = {\n id: number;\n name: string;\n isPrimary: boolean;\n isPresentation: boolean;\n widthPx: number;\n heightPx: number;\n};\n\n// ── Theming ───────────────────────────────────────────────────────────────────\n\n/** Mirrors `AcceptThemeColors`. Values are hex strings — `#RRGGBB` or `#AARRGGBB`. */\nexport type AcceptThemeColors = {\n primary?: string;\n onPrimary?: string;\n primaryContainer?: string;\n onPrimaryContainer?: string;\n secondary?: string;\n onSecondary?: string;\n secondaryContainer?: string;\n onSecondaryContainer?: string;\n error?: string;\n onError?: string;\n errorContainer?: string;\n onErrorContainer?: string;\n background?: string;\n onBackground?: string;\n surface?: string;\n onSurface?: string;\n surfaceVariant?: string;\n onSurfaceVariant?: string;\n outline?: string;\n outlineVariant?: string;\n warning?: string;\n onWarning?: string;\n warningContainer?: string;\n onWarningContainer?: string;\n success?: string;\n onSuccess?: string;\n successContainer?: string;\n onSuccessContainer?: string;\n};\n\n/**\n * Mirrors `AcceptThemeImages`. Each value is a URL the plugin loads — either an `https://` URL, or\n * a `content://` URL produced by {@link Accept.createLocalThemeImageUri} for an image the host app\n * holds locally.\n */\nexport type AcceptThemeImages = {\n logoText?: string;\n logoTextSolid?: string;\n logoSymbol?: string;\n logoSymbolWithBackground?: string;\n};\n\n/** Mirrors `AcceptThemeVariant`. */\nexport type AcceptThemeVariant = {\n colors?: AcceptThemeColors;\n images?: AcceptThemeImages;\n};\n\n/** Branding applied to the plugin's activation, status, and payment screens. Mirrors `AcceptTheme`. */\nexport type AcceptTheme = {\n light?: AcceptThemeVariant;\n dark?: AcceptThemeVariant;\n};\n\n// ── Subscriptions ─────────────────────────────────────────────────────────────\n\n/** Handle returned by the `on*` listeners. Mirrors Expo's `EventSubscription`. */\nexport type AcceptSubscription = {\n remove: () => void;\n};\n"]}
@@ -0,0 +1,7 @@
1
+ /** Package names of the production and sandbox Accept plugin applications. */
2
+ export declare const AcceptPluginPackages: Readonly<{
3
+ PRODUCTION: "com.tapaya.accept.plugin";
4
+ SANDBOX: "com.tapaya.accept.plugin.sandbox";
5
+ ALL: readonly ["com.tapaya.accept.plugin", "com.tapaya.accept.plugin.sandbox"];
6
+ }>;
7
+ //# sourceMappingURL=AcceptPluginPackages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcceptPluginPackages.d.ts","sourceRoot":"","sources":["../src/AcceptPluginPackages.ts"],"names":[],"mappings":"AAKA,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB;;;;EAI/B,CAAC"}
@@ -0,0 +1,11 @@
1
+ const ALL = Object.freeze([
2
+ "com.tapaya.accept.plugin",
3
+ "com.tapaya.accept.plugin.sandbox",
4
+ ]);
5
+ /** Package names of the production and sandbox Accept plugin applications. */
6
+ export const AcceptPluginPackages = Object.freeze({
7
+ PRODUCTION: ALL[0],
8
+ SANDBOX: ALL[1],
9
+ ALL,
10
+ });
11
+ //# sourceMappingURL=AcceptPluginPackages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcceptPluginPackages.js","sourceRoot":"","sources":["../src/AcceptPluginPackages.ts"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;IACxB,0BAA0B;IAC1B,kCAAkC;CAC1B,CAAC,CAAC;AAEZ,8EAA8E;AAC9E,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;IAClB,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACf,GAAG;CACJ,CAAC,CAAC","sourcesContent":["const ALL = Object.freeze([\n \"com.tapaya.accept.plugin\",\n \"com.tapaya.accept.plugin.sandbox\",\n] as const);\n\n/** Package names of the production and sandbox Accept plugin applications. */\nexport const AcceptPluginPackages = Object.freeze({\n PRODUCTION: ALL[0],\n SANDBOX: ALL[1],\n ALL,\n});\n"]}
@@ -1,5 +1,9 @@
1
1
  import { NativeModule } from "expo";
2
- import type { AcceptDisplay, AcceptLogEntry, AcceptLogLevel, AcceptTheme, ActivateTerminalResult, MerchantConfig, MerchantInformation, MinimumAmount, OnboardingStatus, PaymentEvent, PaymentOptions, PaymentRequest, PaymentState, PaymentStatus, PluginStatus, PluginUpdateInfo, RefundReason, SdkState } from "./Accept.types";
2
+ import type { AcceptDisplay, AcceptLogEntry, AcceptLogLevel, AcceptTheme, ActivateTerminalResult, MerchantConfig, MerchantInformation, MinimumAmount, OnboardingStatus, PaymentEvent, PaymentOptions, PaymentRequest, PaymentState, PaymentStatus, PluginStatus, PluginUpdateInfo, RefundReason, SdkState, TagInfo, TagSessionEndReason, TagTimeouts } from "./Accept.types";
3
+ type OpenNfcSessionResult = {
4
+ sessionId: string;
5
+ info: TagInfo;
6
+ };
3
7
  /**
4
8
  * Events the native module emits.
5
9
  *
@@ -49,6 +53,24 @@ declare class AcceptSdkReactNativeModule extends NativeModule<AcceptSdkReactNati
49
53
  getPaymentStatus(paymentToken: string): Promise<PaymentStatus>;
50
54
  cancelPayment(paymentToken: string): Promise<PaymentState>;
51
55
  refundPayment(paymentToken: string, reason: RefundReason): Promise<PaymentState>;
56
+ isNfcSupported(): boolean;
57
+ openNfcSession(timeouts: TagTimeouts): Promise<OpenNfcSessionResult>;
58
+ awaitNfcSessionEnd(sessionId: string): Promise<TagSessionEndReason>;
59
+ releaseNfcSession(sessionId: string): void;
60
+ nfcAuthenticateClassic(sessionId: string, block: number, keyType: string, key: number[]): Promise<void>;
61
+ nfcReadBlock(sessionId: string, block: number): Promise<number[]>;
62
+ nfcWriteBlock(sessionId: string, block: number, data: number[]): Promise<void>;
63
+ nfcIncrement(sessionId: string, block: number, value: number): Promise<void>;
64
+ nfcDecrement(sessionId: string, block: number, value: number): Promise<void>;
65
+ nfcTransfer(sessionId: string, block: number): Promise<void>;
66
+ nfcRestore(sessionId: string, block: number): Promise<void>;
67
+ nfcReadPages(sessionId: string, startPage: number): Promise<number[]>;
68
+ nfcWritePage(sessionId: string, page: number, data: number[]): Promise<void>;
69
+ nfcPasswordAuth(sessionId: string, password: number[]): Promise<number[]>;
70
+ nfcUltralightCAuth(sessionId: string, key: number[]): Promise<void>;
71
+ nfcTransceiveType2(sessionId: string, frame: number[]): Promise<number[]>;
72
+ nfcTransmitApdu(sessionId: string, apdu: number[]): Promise<number[]>;
73
+ closeNfcSession(sessionId: string): Promise<void>;
52
74
  isPluginInstalled(): boolean;
53
75
  installPlugin(): Promise<void>;
54
76
  activateTerminal(): Promise<ActivateTerminalResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"AcceptSdkReactNativeModule.d.ts","sourceRoot":"","sources":["../src/AcceptSdkReactNativeModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAGzD,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,sBAAsB,EACtB,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAExB;;;;;GAKG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,aAAa,EAAE,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAC;IACtD,cAAc,EAAE,CAAC,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,YAAY,CAAA;KAAE,KAAK,IAAI,CAAC;IAC9E,KAAK,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF;;;;;;;GAOG;AACH,OAAO,OAAO,0BAA2B,SAAQ,YAAY,CAAC,gCAAgC,CAAC;IAE7F,UAAU,CAAC,YAAY,EAAE,OAAO,GAAG,IAAI;IACvC,QAAQ,IAAI,QAAQ;IACpB,KAAK,IAAI,OAA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AAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from \"expo\";\nimport { Platform } from \"react-native\";\n\nimport type {\n AcceptDisplay,\n AcceptLogEntry,\n AcceptLogLevel,\n AcceptTheme,\n ActivateTerminalResult,\n MerchantConfig,\n MerchantInformation,\n MinimumAmount,\n OnboardingStatus,\n PaymentEvent,\n PaymentOptions,\n PaymentRequest,\n PaymentState,\n PaymentStatus,\n PluginStatus,\n PluginUpdateInfo,\n RefundReason,\n SdkState,\n} from \"./Accept.types\";\n\n/**\n * Events the native module emits.\n *\n * `onPaymentEvent` carries the `requestId` its caller passed to `startPayment`, because several\n * payments can be in flight across a JavaScript reload even though the SDK runs one at a time.\n */\nexport type AcceptSdkReactNativeModuleEvents = {\n onStateChange: (payload: { state: SdkState }) => void;\n onPaymentEvent: (payload: { requestId: string; event: PaymentEvent }) => void;\n onLog: (payload: AcceptLogEntry) => void;\n};\n\n/**\n * The flat native surface. Each function maps to one `Accept.*` call in the Android SDK; the\n * namespaced shape callers use is assembled in `Accept.ts`.\n *\n * Failures reject with an Expo `CodedException` whose `code` is the `AcceptException` subclass\n * name and whose `message` is a JSON object holding the human-readable text and the error's own\n * fields. `toAcceptError` turns that back into a typed `AcceptError`.\n */\ndeclare class AcceptSdkReactNativeModule extends NativeModule<AcceptSdkReactNativeModuleEvents> {\n // Lifecycle\n initialize(isProduction: boolean): void;\n getState(): SdkState;\n clear(): Promise<void>;\n\n // Diagnostics\n setDebugLoggingEnabled(enabled: boolean): void;\n setLogLevel(level: AcceptLogLevel): void;\n setLogForwardingEnabled(enabled: boolean): void;\n\n // Theming\n setTheme(theme: AcceptTheme | null): void;\n getTheme(): AcceptTheme | null;\n createLocalThemeImageUri(base64: string, fileExtension: string): string;\n\n // Auth\n authenticate(merchantToken: string): Promise<void>;\n\n // SDK\n getSdkVersion(): string;\n isProduction(): boolean;\n getDeviceId(): Promise<string | null>;\n getMinimumAmounts(): Promise<MinimumAmount[]>;\n\n // Merchant\n getMerchantInfo(): Promise<MerchantInformation | null>;\n getMerchantConfig(): Promise<MerchantConfig>;\n getOnboardingStatus(): Promise<OnboardingStatus>;\n getAvailableCurrencies(): Promise<string[]>;\n\n // Payments\n setPaymentOptions(options: PaymentOptions): void;\n startPayment(requestId: string, request: PaymentRequest): void;\n stopPaymentEvents(requestId: string): void;\n getPaymentStatus(paymentToken: string): Promise<PaymentStatus>;\n cancelPayment(paymentToken: string): Promise<PaymentState>;\n refundPayment(\n paymentToken: string,\n reason: RefundReason,\n ): Promise<PaymentState>;\n\n // Plugin\n isPluginInstalled(): boolean;\n installPlugin(): Promise<void>;\n activateTerminal(): Promise<ActivateTerminalResult>;\n getPluginStatus(): Promise<PluginStatus>;\n getPluginUpdateInfo(): Promise<PluginUpdateInfo>;\n logoutPlugin(): Promise<void>;\n\n // Displays\n getDisplays(): AcceptDisplay[];\n getCustomerFacingDisplay(): AcceptDisplay | null;\n isDualScreen(): boolean;\n}\n\nconst NATIVE_MODULE_NAME = \"AcceptSdkReactNative\";\n\n/**\n * Loads the native module, replacing the two ways it can be missing with an actionable message.\n *\n * The module is Android-only, so on any other platform the failure is structural and the caller\n * has to branch on `Platform.OS`. On Android the usual cause is a JavaScript-only runtime — Expo\n * Go, or a build made before the config plugin was added — which `requireNativeModule` reports as\n * a bare \"Cannot find native module\" with no hint about what to do next.\n */\nfunction loadNativeModule(): AcceptSdkReactNativeModule {\n if (Platform.OS !== \"android\") {\n throw new Error(\n `@tapayadot/accept-react-native is Android-only, but it was called on \"${Platform.OS}\". ` +\n `Guard your calls with \\`Platform.OS === 'android'\\`, or move them into an ` +\n `\\`*.android.ts\\` file.`,\n );\n }\n\n try {\n return requireNativeModule<AcceptSdkReactNativeModule>(NATIVE_MODULE_NAME);\n } catch (cause) {\n throw new Error(\n `The native module \"${NATIVE_MODULE_NAME}\" is not available. This package needs a ` +\n `development build and does not run in Expo Go. Add ` +\n `\"@tapayadot/accept-react-native\" to the \\`plugins\\` array in app.json, then rebuild ` +\n `with \\`npx expo prebuild --clean\\` and \\`npx expo run:android\\`.`,\n { cause },\n );\n }\n}\n\nlet nativeModule: AcceptSdkReactNativeModule | null = null;\n\n/** Loads the native module on first use, then memoizes it. */\nconst native = (): AcceptSdkReactNativeModule =>\n (nativeModule ??= loadNativeModule());\n\n/**\n * The native module, resolved lazily.\n *\n * Deferring the lookup past import time is what makes the errors above reachable: a top-level\n * `requireNativeModule` throws while the bundle is still evaluating, which surfaces as a crash at\n * the first `import` of this package rather than at the call that needed it. Importing on iOS is\n * then harmless, and only actually calling a method fails.\n */\nexport default new Proxy({} as AcceptSdkReactNativeModule, {\n get(_target, property) {\n const module = native();\n // The module itself is the receiver: native methods dispatch through it, and routing a getter\n // back through the proxy would re-enter this trap.\n const value = Reflect.get(module, property, module);\n return typeof value === \"function\" ? value.bind(module) : value;\n },\n set(_target, property, value) {\n return Reflect.set(native(), property, value);\n },\n has(_target, property) {\n return Reflect.has(native(), property);\n },\n});\n"]}
1
+ {"version":3,"file":"AcceptSdkReactNativeModule.js","sourceRoot":"","sources":["../src/AcceptSdkReactNativeModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAqIxC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAElD;;;;;;;GAOG;AACH,SAAS,gBAAgB;IACvB,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACb,yEAAyE,QAAQ,CAAC,EAAE,KAAK;YACvF,4EAA4E;YAC5E,wBAAwB,CAC3B,CAAC;IACJ,CAAC;IAED,IAAI,CAAC;QACH,OAAO,mBAAmB,CAA6B,kBAAkB,CAAC,CAAC;IAC7E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,sBAAsB,kBAAkB,2CAA2C;YACjF,qDAAqD;YACrD,sFAAsF;YACtF,kEAAkE,EACpE,EAAE,KAAK,EAAE,CACV,CAAC;IACJ,CAAC;AACH,CAAC;AAED,IAAI,YAAY,GAAsC,IAAI,CAAC;AAE3D,8DAA8D;AAC9D,MAAM,MAAM,GAAG,GAA+B,EAAE,CAC9C,CAAC,YAAY,KAAK,gBAAgB,EAAE,CAAC,CAAC;AAExC;;;;;;;GAOG;AACH,eAAe,IAAI,KAAK,CAAC,EAAgC,EAAE;IACzD,GAAG,CAAC,OAAO,EAAE,QAAQ;QACnB,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;QACxB,8FAA8F;QAC9F,mDAAmD;QACnD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACpD,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAClE,CAAC;IACD,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK;QAC1B,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;IACD,GAAG,CAAC,OAAO,EAAE,QAAQ;QACnB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from \"expo\";\nimport { Platform } from \"react-native\";\n\nimport type {\n AcceptDisplay,\n AcceptLogEntry,\n AcceptLogLevel,\n AcceptTheme,\n ActivateTerminalResult,\n MerchantConfig,\n MerchantInformation,\n MinimumAmount,\n OnboardingStatus,\n PaymentEvent,\n PaymentOptions,\n PaymentRequest,\n PaymentState,\n PaymentStatus,\n PluginStatus,\n PluginUpdateInfo,\n RefundReason,\n SdkState,\n TagInfo,\n TagSessionEndReason,\n TagTimeouts,\n} from \"./Accept.types\";\n\ntype OpenNfcSessionResult = { sessionId: string; info: TagInfo };\n\n/**\n * Events the native module emits.\n *\n * `onPaymentEvent` carries the `requestId` its caller passed to `startPayment`, because several\n * payments can be in flight across a JavaScript reload even though the SDK runs one at a time.\n */\nexport type AcceptSdkReactNativeModuleEvents = {\n onStateChange: (payload: { state: SdkState }) => void;\n onPaymentEvent: (payload: { requestId: string; event: PaymentEvent }) => void;\n onLog: (payload: AcceptLogEntry) => void;\n};\n\n/**\n * The flat native surface. Each function maps to one `Accept.*` call in the Android SDK; the\n * namespaced shape callers use is assembled in `Accept.ts`.\n *\n * Failures reject with an Expo `CodedException` whose `code` is the `AcceptException` subclass\n * name and whose `message` is a JSON object holding the human-readable text and the error's own\n * fields. `toAcceptError` turns that back into a typed `AcceptError`.\n */\ndeclare class AcceptSdkReactNativeModule extends NativeModule<AcceptSdkReactNativeModuleEvents> {\n // Lifecycle\n initialize(isProduction: boolean): void;\n getState(): SdkState;\n clear(): Promise<void>;\n\n // Diagnostics\n setDebugLoggingEnabled(enabled: boolean): void;\n setLogLevel(level: AcceptLogLevel): void;\n setLogForwardingEnabled(enabled: boolean): void;\n\n // Theming\n setTheme(theme: AcceptTheme | null): void;\n getTheme(): AcceptTheme | null;\n createLocalThemeImageUri(base64: string, fileExtension: string): string;\n\n // Auth\n authenticate(merchantToken: string): Promise<void>;\n\n // SDK\n getSdkVersion(): string;\n isProduction(): boolean;\n getDeviceId(): Promise<string | null>;\n getMinimumAmounts(): Promise<MinimumAmount[]>;\n\n // Merchant\n getMerchantInfo(): Promise<MerchantInformation | null>;\n getMerchantConfig(): Promise<MerchantConfig>;\n getOnboardingStatus(): Promise<OnboardingStatus>;\n getAvailableCurrencies(): Promise<string[]>;\n\n // Payments\n setPaymentOptions(options: PaymentOptions): void;\n startPayment(requestId: string, request: PaymentRequest): void;\n stopPaymentEvents(requestId: string): void;\n getPaymentStatus(paymentToken: string): Promise<PaymentStatus>;\n cancelPayment(paymentToken: string): Promise<PaymentState>;\n refundPayment(\n paymentToken: string,\n reason: RefundReason,\n ): Promise<PaymentState>;\n\n // NFC tag sessions\n isNfcSupported(): boolean;\n openNfcSession(timeouts: TagTimeouts): Promise<OpenNfcSessionResult>;\n awaitNfcSessionEnd(sessionId: string): Promise<TagSessionEndReason>;\n releaseNfcSession(sessionId: string): void;\n nfcAuthenticateClassic(\n sessionId: string,\n block: number,\n keyType: string,\n key: number[],\n ): Promise<void>;\n nfcReadBlock(sessionId: string, block: number): Promise<number[]>;\n nfcWriteBlock(\n sessionId: string,\n block: number,\n data: number[],\n ): Promise<void>;\n nfcIncrement(sessionId: string, block: number, value: number): Promise<void>;\n nfcDecrement(sessionId: string, block: number, value: number): Promise<void>;\n nfcTransfer(sessionId: string, block: number): Promise<void>;\n nfcRestore(sessionId: string, block: number): Promise<void>;\n nfcReadPages(sessionId: string, startPage: number): Promise<number[]>;\n nfcWritePage(sessionId: string, page: number, data: number[]): Promise<void>;\n nfcPasswordAuth(sessionId: string, password: number[]): Promise<number[]>;\n nfcUltralightCAuth(sessionId: string, key: number[]): Promise<void>;\n nfcTransceiveType2(sessionId: string, frame: number[]): Promise<number[]>;\n nfcTransmitApdu(sessionId: string, apdu: number[]): Promise<number[]>;\n closeNfcSession(sessionId: string): Promise<void>;\n\n // Plugin\n isPluginInstalled(): boolean;\n installPlugin(): Promise<void>;\n activateTerminal(): Promise<ActivateTerminalResult>;\n getPluginStatus(): Promise<PluginStatus>;\n getPluginUpdateInfo(): Promise<PluginUpdateInfo>;\n logoutPlugin(): Promise<void>;\n\n // Displays\n getDisplays(): AcceptDisplay[];\n getCustomerFacingDisplay(): AcceptDisplay | null;\n isDualScreen(): boolean;\n}\n\nconst NATIVE_MODULE_NAME = \"AcceptSdkReactNative\";\n\n/**\n * Loads the native module, replacing the two ways it can be missing with an actionable message.\n *\n * The module is Android-only, so on any other platform the failure is structural and the caller\n * has to branch on `Platform.OS`. On Android the usual cause is a JavaScript-only runtime — Expo\n * Go, or a build made before the config plugin was added — which `requireNativeModule` reports as\n * a bare \"Cannot find native module\" with no hint about what to do next.\n */\nfunction loadNativeModule(): AcceptSdkReactNativeModule {\n if (Platform.OS !== \"android\") {\n throw new Error(\n `@tapayadot/accept-react-native is Android-only, but it was called on \"${Platform.OS}\". ` +\n `Guard your calls with \\`Platform.OS === 'android'\\`, or move them into an ` +\n `\\`*.android.ts\\` file.`,\n );\n }\n\n try {\n return requireNativeModule<AcceptSdkReactNativeModule>(NATIVE_MODULE_NAME);\n } catch (cause) {\n throw new Error(\n `The native module \"${NATIVE_MODULE_NAME}\" is not available. This package needs a ` +\n `development build and does not run in Expo Go. Add ` +\n `\"@tapayadot/accept-react-native\" to the \\`plugins\\` array in app.json, then rebuild ` +\n `with \\`npx expo prebuild --clean\\` and \\`npx expo run:android\\`.`,\n { cause },\n );\n }\n}\n\nlet nativeModule: AcceptSdkReactNativeModule | null = null;\n\n/** Loads the native module on first use, then memoizes it. */\nconst native = (): AcceptSdkReactNativeModule =>\n (nativeModule ??= loadNativeModule());\n\n/**\n * The native module, resolved lazily.\n *\n * Deferring the lookup past import time is what makes the errors above reachable: a top-level\n * `requireNativeModule` throws while the bundle is still evaluating, which surfaces as a crash at\n * the first `import` of this package rather than at the call that needed it. Importing on iOS is\n * then harmless, and only actually calling a method fails.\n */\nexport default new Proxy({} as AcceptSdkReactNativeModule, {\n get(_target, property) {\n const module = native();\n // The module itself is the receiver: native methods dispatch through it, and routing a getter\n // back through the proxy would re-enter this trap.\n const value = Reflect.get(module, property, module);\n return typeof value === \"function\" ? value.bind(module) : value;\n },\n set(_target, property, value) {\n return Reflect.set(native(), property, value);\n },\n has(_target, property) {\n return Reflect.has(native(), property);\n },\n});\n"]}
@@ -0,0 +1,13 @@
1
+ import type { TagErrorReason } from "./Accept.types";
2
+ /** A checked failure from opening or operating an NFC tag session. */
3
+ export declare class TagSessionError extends Error {
4
+ readonly code: "TagSessionException";
5
+ readonly reason: TagErrorReason;
6
+ readonly authLost: boolean;
7
+ readonly vendorCode: number | null;
8
+ constructor(reason: TagErrorReason, message: string, authLost?: boolean, vendorCode?: number | null);
9
+ static is(error: unknown): error is TagSessionError;
10
+ }
11
+ /** Converts NFC and core-SDK native rejections while preserving unrelated Expo errors. */
12
+ export declare function mapNfcErrors<T>(call: () => Promise<T>): Promise<T>;
13
+ //# sourceMappingURL=TagSessionError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TagSessionError.d.ts","sourceRoot":"","sources":["../src/TagSessionError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAWrD,sEAAsE;AACtE,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,EAAG,qBAAqB,CAAU;IAC/C,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;gBAGjC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,MAAM,EACf,QAAQ,UAAQ,EAChB,UAAU,GAAE,MAAM,GAAG,IAAW;IASlC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe;CAGpD;AA4BD,0FAA0F;AAC1F,wBAAsB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAQxE"}