@tapayadot/accept-react-native 1.15.0 → 1.18.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/CHANGELOG.md ADDED
@@ -0,0 +1,272 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ Each release must have a `## [x.y.z]` section that matches the `version` in
9
+ `package.json`. The publish workflow refuses to release a version whose section
10
+ is missing or empty.
11
+
12
+ ## [1.18.0] - 2026-10-15
13
+
14
+ Carries Accept SDK for Android 1.17.0 and 1.18.0 to Expo apps. Both `com.tapaya:accept` and
15
+ the optional `com.tapaya:accept-installer` move to 1.18.0.
16
+
17
+ ### Added
18
+
19
+ - **`customerFacingFlip` on `setOptions()` and `pay()`.** It controls whether the payment UI
20
+ rotates 180° when the merchant turns the device toward the customer. `'disabled'` is for
21
+ hardware that is already customer-facing — a fixed POS, a dual-sided panel, a device in a stand
22
+ — where that turn never happens and the motion sensors only produce accidental flips. Defaults
23
+ to `'automatic'`, the existing behavior. A companion build that predates the option ignores it.
24
+
25
+ ```ts
26
+ Accept.payments.setOptions({ customerFacingFlip: 'disabled' });
27
+ ```
28
+
29
+ - **An `indicator` on the `externalReader` NFC position.** For kiosks and docks where the reader
30
+ sits outside the screen, it names the edge the reader is beyond (`'top'`, `'right'`,
31
+ `'bottom'`, `'left'`, in the device's natural orientation) and where along it
32
+ (`offsetFraction`, 0 to 1, default 0.5). The tap screen then shows animated chevrons pointing at
33
+ the reader. Omitting it keeps today's behavior, and a companion build that predates the option
34
+ ignores it.
35
+
36
+ ```ts
37
+ nfcPosition: { type: 'externalReader', indicator: { edge: 'bottom', offsetFraction: 0.5 } }
38
+ ```
39
+
40
+ ### Fixed
41
+
42
+ - **`activateTerminal()` rejects with `PluginUnavailable`, as documented,** when the plugin is not
43
+ installed or cannot handle activation. It resolved `{ type: 'failed', reason: 'UNKNOWN' }`
44
+ instead, after needlessly generating a handover code. Code that treated that result as "plugin
45
+ missing" should catch the `AcceptError` instead.
46
+
47
+ - **An optional key set to `undefined` no longer fails the call.** `setOptions()`, `pay()`,
48
+ `payAsync()` and `setTheme()` threw `ERR_UNEXPECTED` ("Value is undefined, expected an
49
+ Object") when an object carried an optional key whose value was `undefined` — for example
50
+ `{ type: 'externalReader', message: undefined }` — because the Expo bridge does not treat an
51
+ explicit `undefined` as absent. Those keys are now dropped before the call crosses the bridge.
52
+
53
+ ## [1.16.0] - 2026-10-02
54
+
55
+ ### Added
56
+
57
+ - **The SDK can install the plugin app on terminals with no app store.** `install()` used to
58
+ have one route — open the store listing — which is no route at all on a storeless terminal.
59
+ It now downloads the plugin APK and installs it through the system installer there, verifying
60
+ the APK against its SHA-256, declared package and version code, a pinned signer, and the
61
+ installed plugin's own signer before anything is committed.
62
+
63
+ This is opt-in, through a new `selfInstall` option on the config plugin:
64
+
65
+ ```json
66
+ ["@tapayadot/accept-react-native", { "selfInstall": true }]
67
+ ```
68
+
69
+ The option pulls in Android's optional `com.tapaya:accept-installer` artifact, which carries
70
+ `REQUEST_INSTALL_PACKAGES` — a permission that merges into the host app's manifest and that
71
+ Play requires every app declaring it to justify on its listing. That is not something to hand
72
+ an app that never asked for it, so the dependency is conditional and the default is off. An app
73
+ distributed through Play changes nothing and ships no new permission.
74
+
75
+ - **Five error codes on `AcceptError`, all from `install()`:** `PluginStoreUnavailable` (no store
76
+ could open the listing), `PluginSelfInstallUnavailable` (no store and `selfInstall` is off),
77
+ `PluginInstallAuthRequired` (the download route taken with no authenticated merchant),
78
+ `PluginInstallPermissionRequired` (the user has not granted the host app "Install unknown
79
+ apps"), and `PluginDownloadNotPermitted` (the backend does not allow this merchant the APK —
80
+ an entitlement decision rather than anything retryable; point them at their account manager or
81
+ developers@tapaya.com).
82
+
83
+ ### Changed
84
+
85
+ - **Android native SDK bumped from `1.15.0` to `1.16.0`.** The version of this package tracks the
86
+ version of the Accept SDK for Android it wraps.
87
+
88
+ - **`install()` no longer always opens a store listing.** With no store it takes the download
89
+ route above, which needs an authenticated merchant and says so before the transfer starts
90
+ rather than after.
91
+
92
+ - **`updateInfo()` is answered by the backend rather than by the plugin** (Android 1.16.0). It
93
+ reads the backend's release metadata against the installed package, unauthenticated, so it
94
+ works during device setup, with no store, and with the plugin absent — none of which it could
95
+ answer before. A Play-installed plugin is still measured against Play, since a release reaches
96
+ the backend while the same build can sit in review; the plugin's own check stays the fallback.
97
+ `PluginUpdateInfo` itself is unchanged.
98
+
99
+ ## [1.15.0] - 2026-09-24
100
+
101
+ ### Changed
102
+
103
+ - **Android native SDK bumped from `1.14.1` to `1.15.0`.** Nothing in
104
+ `com.tapaya.accept`'s public surface changed, so no wrapper code moved — this
105
+ release exists to carry the two Android fixes below to Expo apps. The version
106
+ of this package tracks the version of the Accept SDK for Android it wraps.
107
+ - **Payments no longer wait on a location fix** (Android 1.14.2). Every `pay()`
108
+ used to race a live fix against a timeout before the payment could be created,
109
+ so a terminal on a weak location stack paid that latency on every transaction.
110
+ The most recent known fix is now served immediately and refreshed in the
111
+ background, off the payment path, once it is older than an hour. The cache is
112
+ seeded from the OS last-known location on a cold start, so only a terminal that
113
+ has never held a fix blocks at all, and that first wait is capped at 30 seconds.
114
+ One consequence worth knowing: a cached fix no longer has an upper age bound, so
115
+ a terminal that has been offline for days serves a days-old fix and refreshes
116
+ afterwards.
117
+
118
+ ### Fixed
119
+
120
+ - **Payments failing with `LocationUnavailable` or `LocationTimeout` on terminals
121
+ whose `fused` provider never produces a fix** (Android 1.15.0). On API 31+ a
122
+ live fix was requested from `fused` alone, so a null or silent answer ended the
123
+ request even while `network` and `gps` were enabled and working. A live fix now
124
+ races every enabled provider at once and takes the first to answer, failing only
125
+ once all of them have answered without a location. The OS last-known lookup that
126
+ seeds the cache covers `fused` and `passive` now too, so a cold start more often
127
+ avoids blocking at all.
128
+
129
+ ## [1.14.1] - 2026-09-22
130
+
131
+ Complete rewrite against the rebuilt Accept SDK for Android. Nothing from the
132
+ 1.3.x line carries over — every export, every method name, and every payload
133
+ shape changed. Treat this as a new integration rather than an upgrade.
134
+
135
+ From this release the package version tracks the version of the Accept SDK for
136
+ Android it wraps.
137
+
138
+ ### Added
139
+
140
+ - **Namespaced API mirroring the Android SDK 1:1.** `Accept.auth`, `Accept.sdk`,
141
+ `Accept.merchant`, `Accept.payments`, `Accept.plugin`, and `Accept.displays`
142
+ carry the same names, arguments, and semantics as `com.tapaya.accept.Accept`,
143
+ so the [Android reference documentation](https://docs.tapaya.com) applies
144
+ unchanged.
145
+ - **Payments as an event stream.** `Accept.payments.pay(request, listener)`
146
+ mirrors the SDK's `Flow<PaymentEvent>`: `creating` → `created` → `launched` →
147
+ `result`, or a terminal `creationFailed`. `payAsync(request)` reduces the same
148
+ flow to its `PayResult` for callers that don't render the intermediate states.
149
+ - **Typed errors.** Failures reject with an `AcceptError` whose `code` is the
150
+ `AcceptException` subclass name, carrying that case's fields — `minimum` and
151
+ `currency` on `AmountBelowMinimum`, `status` on `PluginNotReadyForPayments`,
152
+ and so on.
153
+ - **Plugin (terminal) surface.** `isInstalled()`, `install()`,
154
+ `activateTerminal()`, `status()`, `updateInfo()`, and `logout()` against the
155
+ Accept plugin app that drives the terminal.
156
+ - **Dual-screen support.** `Accept.displays` enumerates the device's screens, and
157
+ a payment can be pinned to the customer-facing panel with
158
+ `display: { type: 'customerFacing' }`.
159
+ - **Refunds.** `Accept.payments.refund(paymentToken, reason)`.
160
+ - **Plugin update checks.** `Accept.plugin.updateInfo()` reports whether a newer
161
+ plugin build is on Google Play.
162
+ - **Log forwarding.** `Accept.setLogLevel(level)` and `Accept.setLogger(listener)`
163
+ route the SDK's diagnostics into the host app's own logging stack.
164
+ - **Session-wide payment defaults.** `Accept.payments.setOptions()` sets the
165
+ receipt behavior, NFC antenna position, transaction timeout, and target display
166
+ applied to payments that don't override them.
167
+ - **Readable failure when the native module is missing.** The module is now
168
+ resolved on first use rather than at import, so importing the package on iOS
169
+ or in Expo Go no longer crashes the bundle. Calling it there throws a message
170
+ naming the cause — Android-only, or a missing development build — instead of
171
+ Expo's bare "Cannot find native module".
172
+ - **Rebuilt example app.** `example/` is an Expo app mirroring the Accept SDK for
173
+ Android's own `example` module: one control per public API call and a log pane
174
+ showing what each returned. Credentials come from a gitignored
175
+ `example/.env.local` (see `.env.example`) or are typed at runtime. Every public
176
+ method was exercised against a physical terminal on sandbox.
177
+
178
+ ### Changed
179
+
180
+ - **Android native SDK bumped from `1.3.0` to `1.14.1`.** Among much else, 1.14.1
181
+ fixes payments failing with `LocationUnavailable` on devices with a weak or
182
+ non-GMS location stack: the last-known fallback used to reject any fix older
183
+ than two minutes, and on a stationary countertop terminal the last fix is
184
+ routinely tens of minutes old. The window is now 30 minutes.
185
+ - **Config plugin writes `android.minSdkVersion` itself**, importing from
186
+ `expo/config-plugins` rather than `@expo/config-plugins` and no longer routing
187
+ through `expo-build-properties`. The old import is not resolvable from this
188
+ package on Expo SDK 57, and `expo-build-properties` was never a dependency it
189
+ ships, so requiring it failed in a consumer's project. An app already on a
190
+ higher `minSdkVersion` is left alone.
191
+ - **Peer ranges narrowed** to `expo >=54.0.0` and `react-native >=0.76.0`, the
192
+ versions this package's Expo Modules and config-plugin APIs require. They were
193
+ `*`, which let an incompatible install succeed and fail later at Gradle time.
194
+ - **Android SDK versions inherited from `expo-modules-core`.** `android/build.gradle`
195
+ pinned its own `compileSdkVersion`, `targetSdkVersion`, and lint defaults; it
196
+ now calls `useDefaultAndroidSdkVersions()`, so the module tracks the toolchain
197
+ of whichever Expo SDK the host app is on — this package ships Android sources
198
+ rather than a prebuilt AAR, so that toolchain is what compiles it. The
199
+ resolved versions are unchanged. An explicit check replaces the pinned
200
+ `minSdkVersion`: a project below API 30 now fails naming the config plugin,
201
+ instead of the manifest merger reporting it against the AAR.
202
+ - **`minSdkVersion` raised from 24 to 30**, matching the Accept SDK for Android.
203
+ The config plugin applies it to the host app.
204
+ - **Theming reworked.** `AcceptTheme` is now a light/dark pair of Material color
205
+ roles plus logo image URLs, applied session-wide with `Accept.setTheme()`.
206
+ Local images are handed to the plugin via
207
+ `Accept.createLocalThemeImageUri(base64)`; `assetToBase64` from
208
+ `@tapayadot/accept-react-native/utils` is unchanged and still produces its
209
+ input.
210
+
211
+ ### Removed
212
+
213
+ - **iOS support.** This package is Android-only. The `ios/` sources, the podspec,
214
+ the Swift Package Manager wiring in the config plugin, and the `apple` platform
215
+ entry in `expo-module.config.json` are gone.
216
+ - **Demo mode** — `enableDemoMode()`, `disableDemoMode()`, `isDemoMode()`.
217
+ - **SEPA and Certis payments** — `startSepaPayment()`, `startCertisPayment()`,
218
+ and their intent and result types. Card payments over the plugin are the only
219
+ supported method.
220
+ - **In-SDK KYB** — `presentKyb()` and `KybPrefillData`. Merchant onboarding is
221
+ reported through `Accept.merchant.onboardingStatus()` and completed outside the
222
+ SDK.
223
+ - **Per-method readiness** — `getPaymentMethodStatus()` and `PaymentMethod`.
224
+ - **Companion app sheet** — `pairWithCompanionApp()`,
225
+ `isCompanionAppInstalled()`, and `presentCompanionAppSheet()`, superseded by
226
+ `Accept.plugin`.
227
+ - **`setUiBehavior()`** — superseded by `Accept.payments.setOptions()`.
228
+ - **`requestLocationPermission()`.** The host app requests location permission
229
+ itself; a payment attempted without it fails with
230
+ `LocationPermissionRequired`.
231
+ - **The `enableStripe` config plugin option.** The optional
232
+ `com.tapaya:accept-stripe` artifact is no longer part of this integration.
233
+
234
+ ## [1.3.3] - 2026-06-26
235
+
236
+ ### Changed
237
+
238
+ - **Android native SDK bumped from `1.3.1` to `1.3.2`.**
239
+
240
+ ## [1.3.2] - 2026-06-25
241
+
242
+ ### Changed
243
+
244
+ - **Android native SDK bumped from `1.3.0` to `1.3.1`.**
245
+
246
+ ## [1.3.1] - 2026-06-25
247
+
248
+ ### Changed
249
+
250
+ - **iOS native SDK bumped from `1.2.3` to `1.2.4`.**
251
+
252
+ ## [1.3.0] - 2026-06-25
253
+
254
+ ### Added
255
+
256
+ - **Android companion app support.** `isCompanionAppInstalled()`,
257
+ `pairWithCompanionApp()`, and `presentCompanionAppSheet()` are now functional on
258
+ Android. Companion pairing and checking is now cross-platform.
259
+ `pairWithCompanionApp()` rejects when the companion app is not
260
+ installed or not ready.
261
+ - **`enableStripe` config plugin option.** Set `enableStripe: true` in the
262
+ `@tapayadot/accept-react-native` plugin props in `app.json` to bundle the
263
+ optional `com.tapaya:accept-stripe` dependency on Android. Defaults to `false`.
264
+
265
+ ### Changed
266
+
267
+ - **Android native SDK bumped from `1.2.4` to `1.3.0`.**
268
+
269
+ ### Notes
270
+
271
+ - iOS is unchanged: the native AcceptSDK remains at `1.2.3` and already supported
272
+ the companion app methods.
package/NOTICE ADDED
@@ -0,0 +1,78 @@
1
+ Tapaya Accept SDK for React Native
2
+ Copyright 2026 Tapaya s.r.o.
3
+
4
+ This product includes software developed by third parties.
5
+ The following sets out attributions for those components.
6
+
7
+ ================================================================================
8
+ React Native
9
+ ================================================================================
10
+ Copyright (c) Meta Platforms, Inc. and affiliates.
11
+
12
+ Licensed under the MIT License.
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+
32
+ ================================================================================
33
+ Expo / expo-modules-core
34
+ ================================================================================
35
+ Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)
36
+
37
+ Licensed under the MIT License (see React Native entry above for terms).
38
+
39
+ ================================================================================
40
+ expo-module-scripts
41
+ ================================================================================
42
+ Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)
43
+
44
+ Licensed under the MIT License (see React Native entry above for terms).
45
+
46
+ ================================================================================
47
+ Tapaya Accept SDK for iOS
48
+ (bundled via Swift Package Manager on iOS builds)
49
+ ================================================================================
50
+ Copyright 2026 Tapaya s.r.o.
51
+
52
+ Licensed under the Apache License, Version 2.0.
53
+ https://www.apache.org/licenses/LICENSE-2.0
54
+
55
+ ================================================================================
56
+ Tapaya Accept SDK for Android
57
+ (bundled via Maven on Android builds)
58
+ ================================================================================
59
+ Copyright 2026 Tapaya s.r.o.
60
+
61
+ Licensed under the Apache License, Version 2.0.
62
+ https://www.apache.org/licenses/LICENSE-2.0
63
+
64
+ ================================================================================
65
+ Stripe Terminal Android SDK
66
+ (transitive dependency via Tapaya Accept SDK for Android)
67
+ ================================================================================
68
+ Copyright Stripe, Inc.
69
+
70
+ Licensed under the MIT License (see React Native entry above for terms).
71
+
72
+ ================================================================================
73
+ Stripe Connect Android SDK
74
+ (transitive dependency via Tapaya Accept SDK for Android)
75
+ ================================================================================
76
+ Copyright Stripe, Inc.
77
+
78
+ Licensed under the MIT License (see React Native entry above for terms).
package/README.md CHANGED
@@ -44,7 +44,28 @@ npx expo prebuild --clean
44
44
  npx expo run:android
45
45
  ```
46
46
 
47
- The plugin only raises `minSdkVersion` to 30. Everything else the SDK needs — the
47
+ ### Config plugin options
48
+
49
+ | Option | Default | What it does |
50
+ | --- | --- | --- |
51
+ | `selfInstall` | `false` | Lets the SDK install the plugin app itself on terminals with no app store. See [Installing the plugin app](#installing-the-plugin-app). |
52
+
53
+ ```json
54
+ {
55
+ "expo": {
56
+ "plugins": [
57
+ ["@tapayadot/accept-react-native", { "selfInstall": true }]
58
+ ]
59
+ }
60
+ }
61
+ ```
62
+
63
+ `selfInstall` adds the optional `com.tapaya:accept-installer` artifact, which carries
64
+ `REQUEST_INSTALL_PACKAGES`. That permission merges into your app's manifest and Play requires
65
+ you to justify it on your listing, so leave the option off unless your terminals are
66
+ storeless. Changing it takes effect on the next `npx expo prebuild`.
67
+
68
+ Beyond those options the plugin only raises `minSdkVersion` to 30. Everything else the SDK needs — the
48
69
  `INTERNET`, `ACCESS_NETWORK_STATE`, and location permissions, the `<queries>` entries that
49
70
  make the plugin app visible on API 30+, and the activities that run a payment on a
50
71
  customer-facing display — ships in the Android SDK's own manifest and merges in
@@ -63,7 +84,7 @@ await Accept.auth.authenticate(merchantToken);
63
84
 
64
85
  // 3. Make sure the plugin app is installed and its terminal is activated.
65
86
  if (!Accept.plugin.isInstalled()) {
66
- await Accept.plugin.install(); // opens the store listing
87
+ await Accept.plugin.install(); // store listing, or a direct install on a storeless terminal
67
88
  }
68
89
  if ((await Accept.plugin.status()) !== 'readyForPayments') {
69
90
  await Accept.plugin.activateTerminal();
@@ -164,6 +185,7 @@ Accept.payments.setOptions({
164
185
  },
165
186
  nfcPosition: { type: 'onDevice', surface: 'back', xFraction: 0.5, yFraction: 0.25 },
166
187
  transactionTimeoutMs: 60_000, // 0…120000
188
+ customerFacingFlip: 'disabled', // fixed POS / stand: never rotate the UI 180°
167
189
  });
168
190
 
169
191
  await Accept.payments.payAsync({
@@ -176,6 +198,16 @@ await Accept.payments.payAsync({
176
198
 
177
199
  Only the keys you pass are changed, so one default can be set without disturbing the others.
178
200
 
201
+ For a reader outside the screen (a kiosk or dock reader), point the tap screen at it with
202
+ animated chevrons:
203
+
204
+ ```ts
205
+ nfcPosition: {
206
+ type: 'externalReader',
207
+ indicator: { edge: 'bottom', offsetFraction: 0.5 }, // 0…1 along the edge
208
+ },
209
+ ```
210
+
179
211
  ### Dual-screen terminals
180
212
 
181
213
  On dual-sided hardware, run the payment UI on the customer-facing panel while your app keeps
@@ -190,6 +222,49 @@ if (Accept.displays.isDualScreen) {
190
222
  Set this **before** `authenticate()` — the terminal warm-up it fires follows the same target,
191
223
  and you don't want the warm-up flashing on the merchant's screen.
192
224
 
225
+ ### Installing the plugin app
226
+
227
+ `Accept.plugin.install()` takes whichever route the device has.
228
+
229
+ With an app store, it opens the plugin's listing — branded when the authenticated organization
230
+ configured one — and needs no merchant session to do it. `PluginStoreUnavailable` means the
231
+ listing could not be opened on this device.
232
+
233
+ With no store, the SDK downloads the APK and installs it through the system installer. The APK is
234
+ verified against its SHA-256, declared package and version code, a pinned signer, and the
235
+ installed plugin's own signer before anything is committed. That route needs three things, each
236
+ of which has its own error when missing:
237
+
238
+ | Error | Missing | Fix |
239
+ | --- | --- | --- |
240
+ | `PluginSelfInstallUnavailable` | the installer artifact | set `selfInstall: true` on the config plugin and re-run `npx expo prebuild` |
241
+ | `PluginInstallAuthRequired` | an authenticated merchant | call `Accept.auth.authenticate()` first |
242
+ | `PluginInstallPermissionRequired` | the user's "Install unknown apps" grant | send them to Android's `MANAGE_UNKNOWN_APP_SOURCES` screen, then call `install()` again |
243
+
244
+ ```ts
245
+ import { Linking } from 'react-native';
246
+
247
+ try {
248
+ await Accept.plugin.install();
249
+ } catch (error) {
250
+ if (!AcceptError.is(error)) throw error;
251
+
252
+ if (error.code === 'PluginInstallPermissionRequired') {
253
+ await Linking.sendIntent('android.settings.MANAGE_UNKNOWN_APP_SOURCES', [
254
+ { key: 'android.provider.extra.APP_PACKAGE', value: 'com.yourcompany.yourapp' },
255
+ ]);
256
+ }
257
+ }
258
+ ```
259
+
260
+ `PluginDownloadNotPermitted` is the one that is not fixed in code: the merchant is not enabled
261
+ for the non-store distribution channel. Point them at their account manager or
262
+ developers@tapaya.com.
263
+
264
+ `Accept.plugin.updateInfo()` answers from the backend's release metadata, unauthenticated and
265
+ against the installed package, so it works during device setup, with no store, and before the
266
+ plugin is installed at all.
267
+
193
268
  ### Errors
194
269
 
195
270
  Every rejection is an `AcceptError` whose `code` names the failure, carrying that case's
@@ -1,7 +1,13 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'com.tapaya.acceptsdkreactnative'
4
- version = '1.15.0'
4
+
5
+ // Derived, never written by hand: the module's version is the version of the npm package it ships
6
+ // inside. Keeping a second copy here is how 1.3.1 shipped as `1.3.0` — the release bumped
7
+ // package.json and missed this line. `../package.json` resolves in both contexts this file is
8
+ // evaluated in: this repo, and the installed package under node_modules, since package.json is
9
+ // always in the npm tarball.
10
+ version = new groovy.json.JsonSlurper().parse(file('../package.json')).version
5
11
 
6
12
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
13
  apply from: expoModulesCorePlugin
@@ -31,13 +37,37 @@ if (minSdkVersion < 30) {
31
37
 
32
38
  android {
33
39
  namespace "com.tapaya.acceptsdkreactnative"
34
- defaultConfig {
35
- versionCode 1
36
- versionName "1.15.0"
37
- }
40
+ // No versionCode/versionName: AGP ignores both for library modules, so they were a third copy of
41
+ // the version that nothing read — tag 1.0.0 shipped `versionName "0.1.0"` here and nothing
42
+ // noticed. Do not restore them from the expo-module template.
38
43
  }
39
44
 
45
+ // Opt-in to the SDK installing the plugin app itself on devices with no app store. Off unless the
46
+ // host app asked for it through the config plugin (`{ "selfInstall": true }`), which writes the
47
+ // property below into the app's gradle.properties.
48
+ //
49
+ // The opt-in exists because the artifact carries REQUEST_INSTALL_PACKAGES, which merges into the
50
+ // host app's manifest and which Play requires the integrator to declare on their listing. That is
51
+ // not a permission to hand an app that never asked for it, so the dependency is conditional rather
52
+ // than unconditional -- a storeless terminal gets self-install, a Play-distributed app does not.
53
+ //
54
+ // Read with `findProperty` rather than `safeExtGet`: `safeExtGet` only reads `rootProject.ext`, and
55
+ // nothing maps an arbitrary gradle.properties key into ext the way `expo-root-project` maps
56
+ // `android.minSdkVersion`. `findProperty` resolves gradle.properties from any project, and the ext
57
+ // lookup is kept first so an app that prefers to set it in build.gradle still works.
58
+ def selfInstallProperty = "tapaya.accept.selfInstall"
59
+ def selfInstall = Boolean.parseBoolean(
60
+ String.valueOf(safeExtGet(selfInstallProperty, findProperty(selfInstallProperty) ?: false))
61
+ )
62
+
40
63
  dependencies {
41
64
  // Published to Maven Central; no additional repository declaration is needed.
42
- implementation 'com.tapaya:accept:1.15.0'
65
+ implementation 'com.tapaya:accept:1.18.0'
66
+
67
+ // Optional, and version-locked to the line above: the installer calls into `:accept` internals
68
+ // that are not part of the public surface, so a skew between the two is a runtime failure
69
+ // rather than a resolution error.
70
+ if (selfInstall) {
71
+ implementation 'com.tapaya:accept-installer:1.18.0'
72
+ }
43
73
  }
@@ -133,6 +133,7 @@ class AcceptSdkReactNativeModule : Module() {
133
133
  options.receiptConfig()?.let { Accept.payments.setOptions(receiptConfig = it) }
134
134
  options.nfcPosition()?.let { Accept.payments.setOptions(nfcPosition = it) }
135
135
  options.display()?.let { Accept.payments.setOptions(display = it) }
136
+ options.customerFacingFlip()?.let { Accept.payments.setOptions(customerFacingFlip = it) }
136
137
  if (options.containsKey("transactionTimeoutMs")) {
137
138
  Accept.payments.setOptions(transactionTimeout = options.transactionTimeout())
138
139
  }
@@ -155,6 +156,7 @@ class AcceptSdkReactNativeModule : Module() {
155
156
  tip = request.tip(),
156
157
  transactionTimeout = request.transactionTimeout(),
157
158
  display = request.display(),
159
+ customerFacingFlip = request.customerFacingFlip(),
158
160
  ).collect { event ->
159
161
  sendEvent(EVENT_PAYMENT, mapOf("requestId" to requestId, "event" to event.serialize()))
160
162
  }
@@ -258,5 +260,8 @@ private fun Map<String, Any?>.nfcPosition() =
258
260
  private fun Map<String, Any?>.display() =
259
261
  (this["display"] as? Map<String, Any?>)?.let(::parsePaymentDisplay)
260
262
 
263
+ private fun Map<String, Any?>.customerFacingFlip() =
264
+ (this["customerFacingFlip"] as? String)?.let(::parseCustomerFacingFlip)
265
+
261
266
  @Suppress("UNCHECKED_CAST")
262
267
  private fun Map<String, Any?>.metadata() = this["metadata"] as? Map<String, Any?>
@@ -5,11 +5,14 @@ import com.tapaya.accept.domain.data.AcceptTheme
5
5
  import com.tapaya.accept.domain.data.AcceptThemeColors
6
6
  import com.tapaya.accept.domain.data.AcceptThemeImages
7
7
  import com.tapaya.accept.domain.data.AcceptThemeVariant
8
+ import com.tapaya.accept.domain.data.CustomerFacingFlipConfig
8
9
  import com.tapaya.accept.domain.data.DismissBehavior
9
10
  import com.tapaya.accept.domain.data.NfcPositionConfig
10
11
  import com.tapaya.accept.domain.data.OnDeviceSurface
11
12
  import com.tapaya.accept.domain.data.PaymentDisplay
12
13
  import com.tapaya.accept.domain.data.PaymentReceiptConfig
14
+ import com.tapaya.accept.domain.data.ReaderEdge
15
+ import com.tapaya.accept.domain.data.ReaderIndicator
13
16
  import com.tapaya.accept.domain.data.ReceiptPrintBehavior
14
17
  import com.tapaya.accept.domain.data.RefundReason
15
18
  import expo.modules.kotlin.exception.CodedException
@@ -70,7 +73,11 @@ internal fun parseNfcPosition(config: Map<String, Any?>): NfcPositionConfig =
70
73
  when (val type = config.string("type")) {
71
74
  "unspecified" -> NfcPositionConfig.Unspecified
72
75
  "externalAbove" -> NfcPositionConfig.ExternalAbove
73
- "externalReader" -> NfcPositionConfig.ExternalReader(config.string("message"))
76
+ "externalReader" -> NfcPositionConfig.ExternalReader(
77
+ message = config.string("message"),
78
+ indicator = config.map("indicator")?.let(::parseReaderIndicator),
79
+ )
80
+
74
81
  "onDevice" -> NfcPositionConfig.OnDevice(
75
82
  surface = when (val surface = config.string("surface")) {
76
83
  "back" -> OnDeviceSurface.BACK
@@ -84,6 +91,23 @@ internal fun parseNfcPosition(config: Map<String, Any?>): NfcPositionConfig =
84
91
  else -> invalid("NFC position", type)
85
92
  }
86
93
 
94
+ private fun parseReaderIndicator(indicator: Map<String, Any?>): ReaderIndicator = ReaderIndicator(
95
+ edge = when (val edge = indicator.string("edge")) {
96
+ "top" -> ReaderEdge.TOP
97
+ "right" -> ReaderEdge.RIGHT
98
+ "bottom" -> ReaderEdge.BOTTOM
99
+ "left" -> ReaderEdge.LEFT
100
+ else -> invalid("reader edge", edge)
101
+ },
102
+ offsetFraction = indicator.float("offsetFraction") ?: 0.5f,
103
+ )
104
+
105
+ internal fun parseCustomerFacingFlip(config: String): CustomerFacingFlipConfig = when (config) {
106
+ "automatic" -> CustomerFacingFlipConfig.Automatic
107
+ "disabled" -> CustomerFacingFlipConfig.Disabled
108
+ else -> invalid("customer-facing flip", config)
109
+ }
110
+
87
111
  internal fun parseReceiptConfig(config: Map<String, Any?>): PaymentReceiptConfig =
88
112
  when (val type = config.string("type")) {
89
113
  "dismissImmediately" -> PaymentReceiptConfig.DismissImmediately
Binary file
package/build/Accept.d.ts CHANGED
@@ -143,10 +143,25 @@ export declare const Accept: {
143
143
  */
144
144
  isInstalled(): boolean;
145
145
  /**
146
- * Opens the plugin's store listing so the merchant can install it. Uses the organization's
147
- * branded listing when one is configured and the SDK is authenticated.
146
+ * Installs the plugin app.
148
147
  *
149
- * @throws AcceptError `NotInitialized`, `Unknown`.
148
+ * On a device with an app store this opens the plugin's listing — branded when the authenticated
149
+ * organization configured one — and needs no session to do it.
150
+ *
151
+ * On a device with no store the SDK downloads the APK and installs it through the system
152
+ * installer. That path is opt-in: pass `{ selfInstall: true }` to this package's config plugin,
153
+ * or it fails with `PluginSelfInstallUnavailable`. It also needs an authenticated merchant
154
+ * (`PluginInstallAuthRequired`) and the user's "Install unknown apps" grant for the host app
155
+ * (`PluginInstallPermissionRequired` — send them to Android's
156
+ * `android.settings.MANAGE_UNKNOWN_APP_SOURCES` screen and call this again).
157
+ *
158
+ * `PluginDownloadNotPermitted` is an entitlement decision rather than anything retryable: the
159
+ * merchant is not enabled for the non-store distribution channel. Point them at their account
160
+ * manager or developers@tapaya.com.
161
+ *
162
+ * @throws AcceptError `NotInitialized`, `PluginStoreUnavailable`, `PluginSelfInstallUnavailable`,
163
+ * `PluginInstallAuthRequired`, `PluginInstallPermissionRequired`, `PluginDownloadNotPermitted`,
164
+ * `NoInternetConnection`, `Unknown`.
150
165
  */
151
166
  install(): Promise<void>;
152
167
  /**
@@ -165,8 +180,12 @@ export declare const Accept: {
165
180
  */
166
181
  status(): Promise<PluginStatus>;
167
182
  /**
168
- * Whether a newer plugin build is available on Google Play. Call {@link install} to send the
169
- * merchant to its listing.
183
+ * Whether a newer plugin build is available. Call {@link install} on `updateAvailable`.
184
+ *
185
+ * Answered from the backend's release metadata against the installed package, unauthenticated,
186
+ * so it works during device setup, with no store, and with the plugin absent. A Play-installed
187
+ * plugin is still measured against Play, since a release reaches the backend while the same
188
+ * build can sit in review; the plugin's own check is the fallback.
170
189
  *
171
190
  * @throws AcceptError `NotInitialized`, `PluginUnavailable`, `PluginTimeout`, `Unknown`.
172
191
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Accept.d.ts","sourceRoot":"","sources":["../src/Accept.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,cAAc,EACd,cAAc,EACd,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAsTxB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM;;QAnTjB;;;;;WAKG;oCACyB,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;;;QASlD,iGAAiG;0BAClF,MAAM;QAIrB;;;;WAIG;+BACiB,OAAO;QAI3B;;;;;;WAMG;oBACS,OAAO,CAAC,MAAM,GAAG,IAAI,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IAMnE;;;;;;OAMG;oBACa,WAAW,GAAG,IAAI,GAAG,IAAI;IAIzC;;;OAGG;gBACS,WAAW,GAAG,IAAI;IAI9B;;;;;;;;;;;OAWG;qCAEO,MAAM,kBACC,MAAM,GACpB,MAAM;CAKV,CAAC"}
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 { withoutUndefined } from "./withoutUndefined";
3
4
  /**
4
5
  * Correlates a `pay()` call with its events. Monotonic within a JavaScript context, which is all
5
6
  * that is needed: the native side only ever routes an event back to the caller that started it.
@@ -106,7 +107,7 @@ const payments = {
106
107
  * before authenticating to keep the warm-up off the merchant's screen.
107
108
  */
108
109
  setOptions(options) {
109
- Native.setPaymentOptions(options);
110
+ Native.setPaymentOptions(withoutUndefined(options));
110
111
  },
111
112
  /**
112
113
  * Launches the plugin's payment flow and streams its lifecycle to `listener`.
@@ -142,7 +143,7 @@ const payments = {
142
143
  subscription.remove();
143
144
  Native.stopPaymentEvents(requestId);
144
145
  };
145
- Native.startPayment(requestId, request);
146
+ Native.startPayment(requestId, withoutUndefined(request));
146
147
  return { remove };
147
148
  },
148
149
  /**
@@ -206,10 +207,25 @@ const plugin = {
206
207
  return mapErrorsSync(() => Native.isPluginInstalled());
207
208
  },
208
209
  /**
209
- * Opens the plugin's store listing so the merchant can install it. Uses the organization's
210
- * branded listing when one is configured and the SDK is authenticated.
210
+ * Installs the plugin app.
211
211
  *
212
- * @throws AcceptError `NotInitialized`, `Unknown`.
212
+ * On a device with an app store this opens the plugin's listing — branded when the authenticated
213
+ * organization configured one — and needs no session to do it.
214
+ *
215
+ * On a device with no store the SDK downloads the APK and installs it through the system
216
+ * installer. That path is opt-in: pass `{ selfInstall: true }` to this package's config plugin,
217
+ * or it fails with `PluginSelfInstallUnavailable`. It also needs an authenticated merchant
218
+ * (`PluginInstallAuthRequired`) and the user's "Install unknown apps" grant for the host app
219
+ * (`PluginInstallPermissionRequired` — send them to Android's
220
+ * `android.settings.MANAGE_UNKNOWN_APP_SOURCES` screen and call this again).
221
+ *
222
+ * `PluginDownloadNotPermitted` is an entitlement decision rather than anything retryable: the
223
+ * merchant is not enabled for the non-store distribution channel. Point them at their account
224
+ * manager or developers@tapaya.com.
225
+ *
226
+ * @throws AcceptError `NotInitialized`, `PluginStoreUnavailable`, `PluginSelfInstallUnavailable`,
227
+ * `PluginInstallAuthRequired`, `PluginInstallPermissionRequired`, `PluginDownloadNotPermitted`,
228
+ * `NoInternetConnection`, `Unknown`.
213
229
  */
214
230
  install() {
215
231
  return mapErrors(() => Native.installPlugin());
@@ -234,8 +250,12 @@ const plugin = {
234
250
  return mapErrors(() => Native.getPluginStatus());
235
251
  },
236
252
  /**
237
- * Whether a newer plugin build is available on Google Play. Call {@link install} to send the
238
- * merchant to its listing.
253
+ * Whether a newer plugin build is available. Call {@link install} on `updateAvailable`.
254
+ *
255
+ * Answered from the backend's release metadata against the installed package, unauthenticated,
256
+ * so it works during device setup, with no store, and with the plugin absent. A Play-installed
257
+ * plugin is still measured against Play, since a release reaches the backend while the same
258
+ * build can sit in review; the plugin's own check is the fallback.
239
259
  *
240
260
  * @throws AcceptError `NotInitialized`, `PluginUnavailable`, `PluginTimeout`, `Unknown`.
241
261
  */
@@ -359,7 +379,7 @@ export const Accept = {
359
379
  * that it was applied — the plugin may not be installed or running yet.
360
380
  */
361
381
  setTheme(theme) {
362
- Native.setTheme(theme);
382
+ Native.setTheme(withoutUndefined(theme));
363
383
  },
364
384
  /**
365
385
  * The theme currently set via {@link setTheme}, or `null`. Reflects local SDK state only, not
@@ -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;AAElD;;;GAGG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,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,KAAK,CAAC,CAAC;IACzB,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} from \"./Accept.types\";\nimport { mapErrors, mapErrorsSync, toAcceptError } from \"./AcceptError\";\nimport Native from \"./AcceptSdkReactNativeModule\";\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} and 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(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, 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 * Opens the plugin's store listing so the merchant can install it. Uses the organization's\n * branded listing when one is configured and the SDK is authenticated.\n *\n * @throws AcceptError `NotInitialized`, `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 on Google Play. Call {@link install} to send the\n * merchant to its listing.\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(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":"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;;;GAG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AAC,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} 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} and 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"]}
@@ -31,7 +31,7 @@ export type AcceptLogEntry = {
31
31
  throwable: string | null;
32
32
  };
33
33
  /** Discriminator on {@link AcceptError}; mirrors the `AcceptException` subclass names. */
34
- export type AcceptErrorCode = "NotInitialized" | "NotAuthenticated" | "PluginUnavailable" | "PaymentInProgress" | "ActivationInProgress" | "PluginAlreadyAuthenticated" | "PluginMerchantMismatch" | "NoTidsAvailableForMerchant" | "MerchantOnboardingIncomplete" | "UnsupportedCurrency" | "CurrencyNotAvailableForMerchant" | "AmountBelowMinimum" | "TransactionTimeoutOutOfRange" | "PluginNotReadyForPayments" | "PaymentCreationFailed" | "LocationPermissionRequired" | "LocationUnavailable" | "LocationTimeout" | "NoInternetConnection" | "SessionExpired" | "PaymentNotFound" | "PluginTimeout" | "UnknownEnvironment" | "Unknown";
34
+ export type AcceptErrorCode = "NotInitialized" | "NotAuthenticated" | "PluginUnavailable" | "PaymentInProgress" | "ActivationInProgress" | "PluginAlreadyAuthenticated" | "PluginMerchantMismatch" | "NoTidsAvailableForMerchant" | "MerchantOnboardingIncomplete" | "UnsupportedCurrency" | "CurrencyNotAvailableForMerchant" | "AmountBelowMinimum" | "TransactionTimeoutOutOfRange" | "PluginNotReadyForPayments" | "PaymentCreationFailed" | "LocationPermissionRequired" | "LocationUnavailable" | "LocationTimeout" | "NoInternetConnection" | "SessionExpired" | "PaymentNotFound" | "PluginStoreUnavailable" | "PluginSelfInstallUnavailable" | "PluginInstallPermissionRequired" | "PluginInstallAuthRequired" | "PluginDownloadNotPermitted" | "PluginTimeout" | "UnknownEnvironment" | "Unknown";
35
35
  /** The payload fields carried by the error codes that have any. */
36
36
  export type AcceptErrorDetails = {
37
37
  /** `MerchantOnboardingIncomplete`: the merchant's current onboarding state. */
@@ -204,7 +204,10 @@ export type NfcPositionConfig = {
204
204
  type: "externalAbove";
205
205
  } | {
206
206
  type: "externalReader";
207
+ /** Replaces the companion's own prompt; you own its localization. Blank keeps the default. */
207
208
  message?: string;
209
+ /** Which screen edge the reader sits beyond. Omit to show no chevrons. */
210
+ indicator?: ReaderIndicator;
208
211
  } | {
209
212
  type: "onDevice";
210
213
  surface: OnDeviceSurface;
@@ -213,6 +216,25 @@ export type NfcPositionConfig = {
213
216
  /** Vertical position of the antenna, 0..1 down the surface. */
214
217
  yFraction: number;
215
218
  };
219
+ /** Screen edge an external reader sits beyond, in the device's natural orientation. Mirrors `ReaderEdge`. */
220
+ export type ReaderEdge = "top" | "right" | "bottom" | "left";
221
+ /** Where an external reader sits relative to the screen. Mirrors `ReaderIndicator`. */
222
+ export type ReaderIndicator = {
223
+ edge: ReaderEdge;
224
+ /**
225
+ * Position along {@link edge}, 0..1: left to right along `top`/`bottom`, top to bottom along
226
+ * `left`/`right`. Defaults to 0.5.
227
+ */
228
+ offsetFraction?: number;
229
+ };
230
+ /**
231
+ * Whether the payment UI may rotate 180° when the merchant turns the device toward the customer.
232
+ * Mirrors `CustomerFacingFlipConfig`. `'disabled'` is for hardware that is already
233
+ * customer-facing — a fixed POS, a dual-sided panel, a device in a stand — where the turn never
234
+ * happens and the sensors only produce accidental flips. A companion build that predates the
235
+ * option ignores it.
236
+ */
237
+ export type CustomerFacingFlipConfig = "automatic" | "disabled";
216
238
  /** Which screen the plugin's payment UI runs on. Mirrors `PaymentDisplay`. */
217
239
  export type PaymentDisplay = {
218
240
  type: "default";
@@ -232,6 +254,8 @@ export type PaymentOptions = {
232
254
  */
233
255
  transactionTimeoutMs?: number | null;
234
256
  display?: PaymentDisplay;
257
+ /** Defaults to `'automatic'`. */
258
+ customerFacingFlip?: CustomerFacingFlipConfig;
235
259
  };
236
260
  /** A payment to run. Mirrors the parameters of `AcceptPayments.pay`. */
237
261
  export type PaymentRequest = {
@@ -253,6 +277,8 @@ export type PaymentRequest = {
253
277
  transactionTimeoutMs?: number;
254
278
  /** Overrides the session default for this payment only. */
255
279
  display?: PaymentDisplay;
280
+ /** Overrides the session default for this payment only. */
281
+ customerFacingFlip?: CustomerFacingFlipConfig;
256
282
  };
257
283
  /** Handle returned by {@link AcceptPayments.pay}. */
258
284
  export type PaymentSubscription = {
@@ -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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,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 | \"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 | { type: \"externalReader\"; message?: string }\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/** 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};\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};\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// ── 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,9 @@
1
+ /**
2
+ * Drops every key whose value is `undefined`, at any depth, before an object crosses the bridge.
3
+ *
4
+ * Expo's converter for a `Map<String, Any?>` argument rejects an explicit `undefined` with
5
+ * `ERR_UNEXPECTED` ("Value is undefined, expected an Object") rather than treating it as absent,
6
+ * which is what an optional property means in TypeScript. Removing the key keeps the two the same.
7
+ */
8
+ export declare function withoutUndefined<T>(value: T): T;
9
+ //# sourceMappingURL=withoutUndefined.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withoutUndefined.d.ts","sourceRoot":"","sources":["../src/withoutUndefined.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAQ/C"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Drops every key whose value is `undefined`, at any depth, before an object crosses the bridge.
3
+ *
4
+ * Expo's converter for a `Map<String, Any?>` argument rejects an explicit `undefined` with
5
+ * `ERR_UNEXPECTED` ("Value is undefined, expected an Object") rather than treating it as absent,
6
+ * which is what an optional property means in TypeScript. Removing the key keeps the two the same.
7
+ */
8
+ export function withoutUndefined(value) {
9
+ if (Array.isArray(value))
10
+ return value.map(withoutUndefined);
11
+ if (value === null || typeof value !== "object")
12
+ return value;
13
+ return Object.fromEntries(Object.entries(value)
14
+ .filter(([, entry]) => entry !== undefined)
15
+ .map(([key, entry]) => [key, withoutUndefined(entry)]));
16
+ }
17
+ //# sourceMappingURL=withoutUndefined.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withoutUndefined.js","sourceRoot":"","sources":["../src/withoutUndefined.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAI,KAAQ;IAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAM,CAAC;IAClE,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9D,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;SAClB,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC;SAC1C,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CACpD,CAAC;AACT,CAAC","sourcesContent":["/**\n * Drops every key whose value is `undefined`, at any depth, before an object crosses the bridge.\n *\n * Expo's converter for a `Map<String, Any?>` argument rejects an explicit `undefined` with\n * `ERR_UNEXPECTED` (\"Value is undefined, expected an Object\") rather than treating it as absent,\n * which is what an optional property means in TypeScript. Removing the key keeps the two the same.\n */\nexport function withoutUndefined<T>(value: T): T {\n if (Array.isArray(value)) return value.map(withoutUndefined) as T;\n if (value === null || typeof value !== \"object\") return value;\n return Object.fromEntries(\n Object.entries(value)\n .filter(([, entry]) => entry !== undefined)\n .map(([key, entry]) => [key, withoutUndefined(entry)]),\n ) as T;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapayadot/accept-react-native",
3
- "version": "1.15.0",
3
+ "version": "1.18.0",
4
4
  "description": "Accept SDK for React Native/Expo (Android)",
5
5
  "keywords": [
6
6
  "react-native",
@@ -51,7 +51,10 @@
51
51
  "plugin",
52
52
  "app.json",
53
53
  "app.plugin.js",
54
- "expo-module.config.json"
54
+ "expo-module.config.json",
55
+ "CHANGELOG.md",
56
+ "NOTICE",
57
+ "banner-github.png"
55
58
  ],
56
59
  "sideEffects": false,
57
60
  "scripts": {
@@ -2,6 +2,18 @@ const { withGradleProperties } = require("expo/config-plugins");
2
2
 
3
3
  const MIN_SDK_VERSION = 30;
4
4
  const MIN_SDK_PROPERTY = "android.minSdkVersion";
5
+ const SELF_INSTALL_PROPERTY = "tapaya.accept.selfInstall";
6
+
7
+ /**
8
+ * Sets `key` in the host app's gradle.properties, replacing any value already there.
9
+ */
10
+ function setProperty(properties, key, value) {
11
+ const existing = properties.find(
12
+ (item) => item.type === "property" && item.key === key,
13
+ );
14
+ if (existing) existing.value = value;
15
+ else properties.push({ type: "property", key, value });
16
+ }
5
17
 
6
18
  /**
7
19
  * Expo config plugin for the Accept SDK.
@@ -20,26 +32,44 @@ const MIN_SDK_PROPERTY = "android.minSdkVersion";
20
32
  * Writing the Gradle property directly, rather than going through `expo-build-properties`, keeps
21
33
  * the plugin free of any dependency this package doesn't ship — `expo-build-properties` is not a
22
34
  * runtime dependency here, so requiring it would fail in a consumer's project.
35
+ *
36
+ * @param {object} config the Expo config being modified.
37
+ * @param {{ selfInstall?: boolean }} [options] plugin options from the `plugins` array.
38
+ * @param {boolean} [options.selfInstall] opt in to installing the plugin app without a store.
39
+ * Pulls in `com.tapaya:accept-installer`, which carries `REQUEST_INSTALL_PACKAGES` — see the
40
+ * README. Off by default, because that permission merges into the host app's manifest and Play
41
+ * requires every app declaring it to justify it on its listing.
23
42
  */
24
- module.exports = function withAcceptSdk(config) {
43
+ module.exports = function withAcceptSdk(config, options = {}) {
44
+ const { selfInstall = false } = options ?? {};
45
+
46
+ if (typeof selfInstall !== "boolean") {
47
+ throw new Error(
48
+ `@tapayadot/accept-react-native: the \`selfInstall\` plugin option must be a boolean, ` +
49
+ `received ${JSON.stringify(selfInstall)}.`,
50
+ );
51
+ }
52
+
25
53
  return withGradleProperties(config, (config) => {
26
- const existing = config.modResults.find(
54
+ const properties = config.modResults;
55
+
56
+ const existingMinSdk = properties.find(
27
57
  (item) => item.type === "property" && item.key === MIN_SDK_PROPERTY,
28
58
  );
29
59
 
30
60
  // Never lower a host app that already targets a higher API than the SDK needs.
31
- if (existing) {
32
- const current = Number.parseInt(existing.value, 10);
33
- if (Number.isFinite(current) && current >= MIN_SDK_VERSION) return config;
34
- existing.value = String(MIN_SDK_VERSION);
35
- return config;
61
+ const current = existingMinSdk
62
+ ? Number.parseInt(existingMinSdk.value, 10)
63
+ : Number.NaN;
64
+ if (!(Number.isFinite(current) && current >= MIN_SDK_VERSION)) {
65
+ setProperty(properties, MIN_SDK_PROPERTY, String(MIN_SDK_VERSION));
36
66
  }
37
67
 
38
- config.modResults.push({
39
- type: "property",
40
- key: MIN_SDK_PROPERTY,
41
- value: String(MIN_SDK_VERSION),
42
- });
68
+ // Always written, both values. Prebuild is incremental: a project that enabled self-install
69
+ // once and then turned it off keeps the stale `true` forever if the `false` case writes
70
+ // nothing, and the next build still ships REQUEST_INSTALL_PACKAGES with no trace of why.
71
+ setProperty(properties, SELF_INSTALL_PROPERTY, String(selfInstall));
72
+
43
73
  return config;
44
74
  });
45
75
  };