@tapayadot/accept-react-native 1.15.0 → 1.16.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,231 @@
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.16.0] - 2026-10-02
13
+
14
+ ### Added
15
+
16
+ - **The SDK can install the plugin app on terminals with no app store.** `install()` used to
17
+ have one route — open the store listing — which is no route at all on a storeless terminal.
18
+ It now downloads the plugin APK and installs it through the system installer there, verifying
19
+ the APK against its SHA-256, declared package and version code, a pinned signer, and the
20
+ installed plugin's own signer before anything is committed.
21
+
22
+ This is opt-in, through a new `selfInstall` option on the config plugin:
23
+
24
+ ```json
25
+ ["@tapayadot/accept-react-native", { "selfInstall": true }]
26
+ ```
27
+
28
+ The option pulls in Android's optional `com.tapaya:accept-installer` artifact, which carries
29
+ `REQUEST_INSTALL_PACKAGES` — a permission that merges into the host app's manifest and that
30
+ Play requires every app declaring it to justify on its listing. That is not something to hand
31
+ an app that never asked for it, so the dependency is conditional and the default is off. An app
32
+ distributed through Play changes nothing and ships no new permission.
33
+
34
+ - **Five error codes on `AcceptError`, all from `install()`:** `PluginStoreUnavailable` (no store
35
+ could open the listing), `PluginSelfInstallUnavailable` (no store and `selfInstall` is off),
36
+ `PluginInstallAuthRequired` (the download route taken with no authenticated merchant),
37
+ `PluginInstallPermissionRequired` (the user has not granted the host app "Install unknown
38
+ apps"), and `PluginDownloadNotPermitted` (the backend does not allow this merchant the APK —
39
+ an entitlement decision rather than anything retryable; point them at their account manager or
40
+ developers@tapaya.com).
41
+
42
+ ### Changed
43
+
44
+ - **Android native SDK bumped from `1.15.0` to `1.16.0`.** The version of this package tracks the
45
+ version of the Accept SDK for Android it wraps.
46
+
47
+ - **`install()` no longer always opens a store listing.** With no store it takes the download
48
+ route above, which needs an authenticated merchant and says so before the transfer starts
49
+ rather than after.
50
+
51
+ - **`updateInfo()` is answered by the backend rather than by the plugin** (Android 1.16.0). It
52
+ reads the backend's release metadata against the installed package, unauthenticated, so it
53
+ works during device setup, with no store, and with the plugin absent — none of which it could
54
+ answer before. A Play-installed plugin is still measured against Play, since a release reaches
55
+ the backend while the same build can sit in review; the plugin's own check stays the fallback.
56
+ `PluginUpdateInfo` itself is unchanged.
57
+
58
+ ## [1.15.0] - 2026-09-24
59
+
60
+ ### Changed
61
+
62
+ - **Android native SDK bumped from `1.14.1` to `1.15.0`.** Nothing in
63
+ `com.tapaya.accept`'s public surface changed, so no wrapper code moved — this
64
+ release exists to carry the two Android fixes below to Expo apps. The version
65
+ of this package tracks the version of the Accept SDK for Android it wraps.
66
+ - **Payments no longer wait on a location fix** (Android 1.14.2). Every `pay()`
67
+ used to race a live fix against a timeout before the payment could be created,
68
+ so a terminal on a weak location stack paid that latency on every transaction.
69
+ The most recent known fix is now served immediately and refreshed in the
70
+ background, off the payment path, once it is older than an hour. The cache is
71
+ seeded from the OS last-known location on a cold start, so only a terminal that
72
+ has never held a fix blocks at all, and that first wait is capped at 30 seconds.
73
+ One consequence worth knowing: a cached fix no longer has an upper age bound, so
74
+ a terminal that has been offline for days serves a days-old fix and refreshes
75
+ afterwards.
76
+
77
+ ### Fixed
78
+
79
+ - **Payments failing with `LocationUnavailable` or `LocationTimeout` on terminals
80
+ whose `fused` provider never produces a fix** (Android 1.15.0). On API 31+ a
81
+ live fix was requested from `fused` alone, so a null or silent answer ended the
82
+ request even while `network` and `gps` were enabled and working. A live fix now
83
+ races every enabled provider at once and takes the first to answer, failing only
84
+ once all of them have answered without a location. The OS last-known lookup that
85
+ seeds the cache covers `fused` and `passive` now too, so a cold start more often
86
+ avoids blocking at all.
87
+
88
+ ## [1.14.1] - 2026-09-22
89
+
90
+ Complete rewrite against the rebuilt Accept SDK for Android. Nothing from the
91
+ 1.3.x line carries over — every export, every method name, and every payload
92
+ shape changed. Treat this as a new integration rather than an upgrade.
93
+
94
+ From this release the package version tracks the version of the Accept SDK for
95
+ Android it wraps.
96
+
97
+ ### Added
98
+
99
+ - **Namespaced API mirroring the Android SDK 1:1.** `Accept.auth`, `Accept.sdk`,
100
+ `Accept.merchant`, `Accept.payments`, `Accept.plugin`, and `Accept.displays`
101
+ carry the same names, arguments, and semantics as `com.tapaya.accept.Accept`,
102
+ so the [Android reference documentation](https://docs.tapaya.com) applies
103
+ unchanged.
104
+ - **Payments as an event stream.** `Accept.payments.pay(request, listener)`
105
+ mirrors the SDK's `Flow<PaymentEvent>`: `creating` → `created` → `launched` →
106
+ `result`, or a terminal `creationFailed`. `payAsync(request)` reduces the same
107
+ flow to its `PayResult` for callers that don't render the intermediate states.
108
+ - **Typed errors.** Failures reject with an `AcceptError` whose `code` is the
109
+ `AcceptException` subclass name, carrying that case's fields — `minimum` and
110
+ `currency` on `AmountBelowMinimum`, `status` on `PluginNotReadyForPayments`,
111
+ and so on.
112
+ - **Plugin (terminal) surface.** `isInstalled()`, `install()`,
113
+ `activateTerminal()`, `status()`, `updateInfo()`, and `logout()` against the
114
+ Accept plugin app that drives the terminal.
115
+ - **Dual-screen support.** `Accept.displays` enumerates the device's screens, and
116
+ a payment can be pinned to the customer-facing panel with
117
+ `display: { type: 'customerFacing' }`.
118
+ - **Refunds.** `Accept.payments.refund(paymentToken, reason)`.
119
+ - **Plugin update checks.** `Accept.plugin.updateInfo()` reports whether a newer
120
+ plugin build is on Google Play.
121
+ - **Log forwarding.** `Accept.setLogLevel(level)` and `Accept.setLogger(listener)`
122
+ route the SDK's diagnostics into the host app's own logging stack.
123
+ - **Session-wide payment defaults.** `Accept.payments.setOptions()` sets the
124
+ receipt behavior, NFC antenna position, transaction timeout, and target display
125
+ applied to payments that don't override them.
126
+ - **Readable failure when the native module is missing.** The module is now
127
+ resolved on first use rather than at import, so importing the package on iOS
128
+ or in Expo Go no longer crashes the bundle. Calling it there throws a message
129
+ naming the cause — Android-only, or a missing development build — instead of
130
+ Expo's bare "Cannot find native module".
131
+ - **Rebuilt example app.** `example/` is an Expo app mirroring the Accept SDK for
132
+ Android's own `example` module: one control per public API call and a log pane
133
+ showing what each returned. Credentials come from a gitignored
134
+ `example/.env.local` (see `.env.example`) or are typed at runtime. Every public
135
+ method was exercised against a physical terminal on sandbox.
136
+
137
+ ### Changed
138
+
139
+ - **Android native SDK bumped from `1.3.0` to `1.14.1`.** Among much else, 1.14.1
140
+ fixes payments failing with `LocationUnavailable` on devices with a weak or
141
+ non-GMS location stack: the last-known fallback used to reject any fix older
142
+ than two minutes, and on a stationary countertop terminal the last fix is
143
+ routinely tens of minutes old. The window is now 30 minutes.
144
+ - **Config plugin writes `android.minSdkVersion` itself**, importing from
145
+ `expo/config-plugins` rather than `@expo/config-plugins` and no longer routing
146
+ through `expo-build-properties`. The old import is not resolvable from this
147
+ package on Expo SDK 57, and `expo-build-properties` was never a dependency it
148
+ ships, so requiring it failed in a consumer's project. An app already on a
149
+ higher `minSdkVersion` is left alone.
150
+ - **Peer ranges narrowed** to `expo >=54.0.0` and `react-native >=0.76.0`, the
151
+ versions this package's Expo Modules and config-plugin APIs require. They were
152
+ `*`, which let an incompatible install succeed and fail later at Gradle time.
153
+ - **Android SDK versions inherited from `expo-modules-core`.** `android/build.gradle`
154
+ pinned its own `compileSdkVersion`, `targetSdkVersion`, and lint defaults; it
155
+ now calls `useDefaultAndroidSdkVersions()`, so the module tracks the toolchain
156
+ of whichever Expo SDK the host app is on — this package ships Android sources
157
+ rather than a prebuilt AAR, so that toolchain is what compiles it. The
158
+ resolved versions are unchanged. An explicit check replaces the pinned
159
+ `minSdkVersion`: a project below API 30 now fails naming the config plugin,
160
+ instead of the manifest merger reporting it against the AAR.
161
+ - **`minSdkVersion` raised from 24 to 30**, matching the Accept SDK for Android.
162
+ The config plugin applies it to the host app.
163
+ - **Theming reworked.** `AcceptTheme` is now a light/dark pair of Material color
164
+ roles plus logo image URLs, applied session-wide with `Accept.setTheme()`.
165
+ Local images are handed to the plugin via
166
+ `Accept.createLocalThemeImageUri(base64)`; `assetToBase64` from
167
+ `@tapayadot/accept-react-native/utils` is unchanged and still produces its
168
+ input.
169
+
170
+ ### Removed
171
+
172
+ - **iOS support.** This package is Android-only. The `ios/` sources, the podspec,
173
+ the Swift Package Manager wiring in the config plugin, and the `apple` platform
174
+ entry in `expo-module.config.json` are gone.
175
+ - **Demo mode** — `enableDemoMode()`, `disableDemoMode()`, `isDemoMode()`.
176
+ - **SEPA and Certis payments** — `startSepaPayment()`, `startCertisPayment()`,
177
+ and their intent and result types. Card payments over the plugin are the only
178
+ supported method.
179
+ - **In-SDK KYB** — `presentKyb()` and `KybPrefillData`. Merchant onboarding is
180
+ reported through `Accept.merchant.onboardingStatus()` and completed outside the
181
+ SDK.
182
+ - **Per-method readiness** — `getPaymentMethodStatus()` and `PaymentMethod`.
183
+ - **Companion app sheet** — `pairWithCompanionApp()`,
184
+ `isCompanionAppInstalled()`, and `presentCompanionAppSheet()`, superseded by
185
+ `Accept.plugin`.
186
+ - **`setUiBehavior()`** — superseded by `Accept.payments.setOptions()`.
187
+ - **`requestLocationPermission()`.** The host app requests location permission
188
+ itself; a payment attempted without it fails with
189
+ `LocationPermissionRequired`.
190
+ - **The `enableStripe` config plugin option.** The optional
191
+ `com.tapaya:accept-stripe` artifact is no longer part of this integration.
192
+
193
+ ## [1.3.3] - 2026-06-26
194
+
195
+ ### Changed
196
+
197
+ - **Android native SDK bumped from `1.3.1` to `1.3.2`.**
198
+
199
+ ## [1.3.2] - 2026-06-25
200
+
201
+ ### Changed
202
+
203
+ - **Android native SDK bumped from `1.3.0` to `1.3.1`.**
204
+
205
+ ## [1.3.1] - 2026-06-25
206
+
207
+ ### Changed
208
+
209
+ - **iOS native SDK bumped from `1.2.3` to `1.2.4`.**
210
+
211
+ ## [1.3.0] - 2026-06-25
212
+
213
+ ### Added
214
+
215
+ - **Android companion app support.** `isCompanionAppInstalled()`,
216
+ `pairWithCompanionApp()`, and `presentCompanionAppSheet()` are now functional on
217
+ Android. Companion pairing and checking is now cross-platform.
218
+ `pairWithCompanionApp()` rejects when the companion app is not
219
+ installed or not ready.
220
+ - **`enableStripe` config plugin option.** Set `enableStripe: true` in the
221
+ `@tapayadot/accept-react-native` plugin props in `app.json` to bundle the
222
+ optional `com.tapaya:accept-stripe` dependency on Android. Defaults to `false`.
223
+
224
+ ### Changed
225
+
226
+ - **Android native SDK bumped from `1.2.4` to `1.3.0`.**
227
+
228
+ ### Notes
229
+
230
+ - iOS is unchanged: the native AcceptSDK remains at `1.2.3` and already supported
231
+ 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();
@@ -190,6 +211,49 @@ if (Accept.displays.isDualScreen) {
190
211
  Set this **before** `authenticate()` — the terminal warm-up it fires follows the same target,
191
212
  and you don't want the warm-up flashing on the merchant's screen.
192
213
 
214
+ ### Installing the plugin app
215
+
216
+ `Accept.plugin.install()` takes whichever route the device has.
217
+
218
+ With an app store, it opens the plugin's listing — branded when the authenticated organization
219
+ configured one — and needs no merchant session to do it. `PluginStoreUnavailable` means the
220
+ listing could not be opened on this device.
221
+
222
+ With no store, the SDK downloads the APK and installs it through the system installer. The APK is
223
+ verified against its SHA-256, declared package and version code, a pinned signer, and the
224
+ installed plugin's own signer before anything is committed. That route needs three things, each
225
+ of which has its own error when missing:
226
+
227
+ | Error | Missing | Fix |
228
+ | --- | --- | --- |
229
+ | `PluginSelfInstallUnavailable` | the installer artifact | set `selfInstall: true` on the config plugin and re-run `npx expo prebuild` |
230
+ | `PluginInstallAuthRequired` | an authenticated merchant | call `Accept.auth.authenticate()` first |
231
+ | `PluginInstallPermissionRequired` | the user's "Install unknown apps" grant | send them to Android's `MANAGE_UNKNOWN_APP_SOURCES` screen, then call `install()` again |
232
+
233
+ ```ts
234
+ import { Linking } from 'react-native';
235
+
236
+ try {
237
+ await Accept.plugin.install();
238
+ } catch (error) {
239
+ if (!AcceptError.is(error)) throw error;
240
+
241
+ if (error.code === 'PluginInstallPermissionRequired') {
242
+ await Linking.sendIntent('android.settings.MANAGE_UNKNOWN_APP_SOURCES', [
243
+ { key: 'android.provider.extra.APP_PACKAGE', value: 'com.yourcompany.yourapp' },
244
+ ]);
245
+ }
246
+ }
247
+ ```
248
+
249
+ `PluginDownloadNotPermitted` is the one that is not fixed in code: the merchant is not enabled
250
+ for the non-store distribution channel. Point them at their account manager or
251
+ developers@tapaya.com.
252
+
253
+ `Accept.plugin.updateInfo()` answers from the backend's release metadata, unauthenticated and
254
+ against the installed package, so it works during device setup, with no store, and before the
255
+ plugin is installed at all.
256
+
193
257
  ### Errors
194
258
 
195
259
  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.16.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.16.0'
72
+ }
43
73
  }
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,CAAC;QAIlC;;;;WAIG;0BACe,OAAO,CAAC,aAAa,EAAE,CAAC;;;QAS1C;;;;WAIG;gBACK,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;QAI3C;;;;WAIG;kBACO,OAAO,CAAC,cAAc,CAAC;QAIjC;;;;WAIG;4BACiB,OAAO,CAAC,gBAAgB,CAAC;QAI7C;;;;WAIG;+BACoB,OAAO,CAAC,MAAM,EAAE,CAAC;;;QASxC;;;;;;WAMG;4BACiB,cAAc,GAAG,IAAI;QAIzC;;;;;;;;;;;;;;;;WAgBG;qBAEQ,cAAc,YACb,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,GACtC,mBAAmB;QAqBtB;;;;;;;WAOG;0BACe,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC;QAUrD;;;;;WAKG;6BACkB,MAAM,GAAG,OAAO,CAAC,aA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AI,CAAC;QAIxB;;;;;;;WAOG;4BACiB,OAAO,CAAC,sBAAsB,CAAC;QAInD;;;;WAIG;kBACO,OAAO,CAAC,YAAY,CAAC;QAI/B;;;;;;;;;WASG;sBACW,OAAO,CAAC,gBAAgB,CAAC;QAIvC;;;;WAIG;kBACO,OAAO,CAAC,IAAI,CAAC;;;QAYvB,iEAAiE;eAC1D,aAAa,EAAE;QAItB;;;WAGG;0BACe,aAAa,GAAG,IAAI;QAItC,gEAAgE;+BAC5C,OAAO;;IAgC3B;;;;;OAKG;yBACiB,iBAAiB,GAAQ,IAAI;IAIjD,yCAAyC;oBAC5B,QAAQ;IAIrB;;;OAGG;+BACwB,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,kBAAkB;IAIzE;;;;;OAKG;aACM,OAAO,CAAC,IAAI,CAAC;IAItB;;;OAGG;oCAC6B,OAAO,GAAG,IAAI;IAI9C;;;OAGG;uBACgB,cAAc,GAAG,IAAI;IAIxC;;;OAGG;wBACiB,CAAC,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI;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
@@ -206,10 +206,25 @@ const plugin = {
206
206
  return mapErrorsSync(() => Native.isPluginInstalled());
207
207
  },
208
208
  /**
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.
209
+ * Installs the plugin app.
211
210
  *
212
- * @throws AcceptError `NotInitialized`, `Unknown`.
211
+ * On a device with an app store this opens the plugin's listing — branded when the authenticated
212
+ * organization configured one — and needs no session to do it.
213
+ *
214
+ * On a device with no store the SDK downloads the APK and installs it through the system
215
+ * installer. That path is opt-in: pass `{ selfInstall: true }` to this package's config plugin,
216
+ * or it fails with `PluginSelfInstallUnavailable`. It also needs an authenticated merchant
217
+ * (`PluginInstallAuthRequired`) and the user's "Install unknown apps" grant for the host app
218
+ * (`PluginInstallPermissionRequired` — send them to Android's
219
+ * `android.settings.MANAGE_UNKNOWN_APP_SOURCES` screen and call this again).
220
+ *
221
+ * `PluginDownloadNotPermitted` is an entitlement decision rather than anything retryable: the
222
+ * merchant is not enabled for the non-store distribution channel. Point them at their account
223
+ * manager or developers@tapaya.com.
224
+ *
225
+ * @throws AcceptError `NotInitialized`, `PluginStoreUnavailable`, `PluginSelfInstallUnavailable`,
226
+ * `PluginInstallAuthRequired`, `PluginInstallPermissionRequired`, `PluginDownloadNotPermitted`,
227
+ * `NoInternetConnection`, `Unknown`.
213
228
  */
214
229
  install() {
215
230
  return mapErrors(() => Native.installPlugin());
@@ -234,8 +249,12 @@ const plugin = {
234
249
  return mapErrors(() => Native.getPluginStatus());
235
250
  },
236
251
  /**
237
- * Whether a newer plugin build is available on Google Play. Call {@link install} to send the
238
- * merchant to its listing.
252
+ * Whether a newer plugin build is available. Call {@link install} on `updateAvailable`.
253
+ *
254
+ * Answered from the backend's release metadata against the installed package, unauthenticated,
255
+ * so it works during device setup, with no store, and with the plugin absent. A Play-installed
256
+ * plugin is still measured against Play, since a release reaches the backend while the same
257
+ * build can sit in review; the plugin's own check is the fallback.
239
258
  *
240
259
  * @throws AcceptError `NotInitialized`, `PluginUnavailable`, `PluginTimeout`, `Unknown`.
241
260
  */
@@ -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;AACH,IAAI,aAAa,GAAG,CAAC,CAAC;AACtB,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,OAAO,EAAE,aAA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ACH,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;AAElD;;;GAGG;AACH,IAAI,aAAa,GAAG,CAAC,CAAC;AACtB,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC;AAEpD,4CAA4C;AAC5C,MAAM,UAAU,GAA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,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 * 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(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. */
@@ -1 +1 @@
1
- {"version":3,"file":"Accept.types.d.ts","sourceRoot":"","sources":["../src/Accept.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,aAAa,GAAG,eAAe,CAAC;AAEhE,6CAA6C;AAC7C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,4EAA4E;IAC5E,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAIF,mFAAmF;AACnF,MAAM,MAAM,cAAc,GACxB,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAE3D,kGAAkG;AAClG,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,cAAc,CAAC;IACtB,mDAAmD;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAIF,0FAA0F;AAC1F,MAAM,MAAM,eAAe,GACvB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,mBAAmB,GACnB,sBAAsB,GACtB,4BAA4B,GAC5B,wBAAwB,GACxB,4BAA4B,GAC5B,8BAA8B,GAC9B,qBAAqB,GACrB,iCAAiC,GACjC,oBAAoB,GACpB,8BAA8B,GAC9B,2BAA2B,GAC3B,uBAAuB,GACvB,4BAA4B,GAC5B,qBAAqB,GACrB,iBAAiB,GACjB,sBAAsB,GACtB,gBAAgB,GAChB,iBAAiB,GACjB,eAAe,GACf,oBAAoB,GACpB,SAAS,CAAC;AAEd,mEAAmE;AACnE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,+EAA+E;IAC/E,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,sFAAsF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CAAC,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF,oCAAoC;AACpC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAEF,uGAAuG;AACvG,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,IAAI,CAAC,EAAE,kBAAkB,CAAC;CAC3B,CAAC;AAIF,kFAAkF;AAClF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Accept.types.js","sourceRoot":"","sources":["../src/Accept.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/**\n * Types mirroring the Accept SDK for Android.\n *\n * Every name here corresponds 1:1 to a type in `com.tapaya.accept`, so the Android reference\n * documentation applies unchanged. Kotlin sealed interfaces become tagged unions discriminated on\n * `type`; Kotlin enums become string-literal unions.\n */\n\n// ── Lifecycle ─────────────────────────────────────────────────────────────────\n\n/**\n * Lifecycle state of the SDK. Mirrors `SdkState`.\n *\n * - `idle` — {@link Accept.initialize} has not been called yet.\n * - `initialized` — ready for {@link AcceptAuth.authenticate}.\n * - `authenticated` — the merchant and payments surfaces are usable.\n */\nexport type SdkState = \"idle\" | \"initialized\" | \"authenticated\";\n\n/** Options for {@link Accept.initialize}. */\nexport type InitializeOptions = {\n /** `true` to target production, `false` (the default) to target sandbox. */\n isProduction?: boolean;\n};\n\n// ── Diagnostics ───────────────────────────────────────────────────────────────\n\n/** Verbosity threshold for the SDK's diagnostic logging, least to most verbose. */\nexport type AcceptLogLevel =\n \"NONE\" | \"ERROR\" | \"WARN\" | \"INFO\" | \"DEBUG\" | \"VERBOSE\";\n\n/** A single diagnostic log line, delivered to the listener passed to {@link Accept.setLogger}. */\nexport type AcceptLogEntry = {\n level: AcceptLogLevel;\n /** Stable Logcat-style tag identifying the SDK. */\n tag: string;\n /** Human-readable, already redacted message. */\n message: string;\n /** Message of the cause associated with this line, when there is one. */\n throwable: string | null;\n};\n\n// ── Errors ────────────────────────────────────────────────────────────────────\n\n/** Discriminator on {@link AcceptError}; mirrors the `AcceptException` subclass names. */\nexport type AcceptErrorCode =\n | \"NotInitialized\"\n | \"NotAuthenticated\"\n | \"PluginUnavailable\"\n | \"PaymentInProgress\"\n | \"ActivationInProgress\"\n | \"PluginAlreadyAuthenticated\"\n | \"PluginMerchantMismatch\"\n | \"NoTidsAvailableForMerchant\"\n | \"MerchantOnboardingIncomplete\"\n | \"UnsupportedCurrency\"\n | \"CurrencyNotAvailableForMerchant\"\n | \"AmountBelowMinimum\"\n | \"TransactionTimeoutOutOfRange\"\n | \"PluginNotReadyForPayments\"\n | \"PaymentCreationFailed\"\n | \"LocationPermissionRequired\"\n | \"LocationUnavailable\"\n | \"LocationTimeout\"\n | \"NoInternetConnection\"\n | \"SessionExpired\"\n | \"PaymentNotFound\"\n | \"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 | { 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"]}
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.16.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
  };