@tapayadot/accept-react-native 1.2.7 → 1.3.1
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/README.md +37 -8
- package/android/build.gradle +7 -3
- package/android/src/main/java/com/tapaya/acceptsdkreactnative/AcceptSdkReactNativeModule.kt +23 -5
- package/build/AcceptSdkReactNativeModule.d.ts +0 -3
- package/build/AcceptSdkReactNativeModule.d.ts.map +1 -1
- package/build/AcceptSdkReactNativeModule.js.map +1 -1
- package/build/index.d.ts +6 -5
- package/build/index.d.ts.map +1 -1
- package/build/index.js +6 -5
- package/build/index.js.map +1 -1
- package/package.json +36 -2
- package/plugin/withCustomRepoModule.js +26 -3
package/README.md
CHANGED
|
@@ -28,9 +28,38 @@ Then run:
|
|
|
28
28
|
npx expo prebuild
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
#### Plugin options
|
|
32
|
+
|
|
33
|
+
The plugin accepts options to toggle optional native features. Pass them as the second element of the plugin entry in `app.json`:
|
|
34
|
+
|
|
35
|
+
| Option | Type | Default | Description |
|
|
36
|
+
|---|---|---|---|
|
|
37
|
+
| `enableStripe` | `boolean` | `false` | Android only. Bundle the optional `com.tapaya:accept-stripe` dependency. Enable this only if your merchant account uses Stripe-backed payment processing. |
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"expo": {
|
|
42
|
+
"plugins": [
|
|
43
|
+
[
|
|
44
|
+
"@tapayadot/accept-react-native",
|
|
45
|
+
{ "enableStripe": true }
|
|
46
|
+
]
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
When `enableStripe` is `true`, the plugin writes `com.tapaya.accept.enableStripe=true` into your app's `android/gradle.properties` during prebuild, which adds `com.tapaya:accept-stripe` to the Android build. iOS payment processing is bundled in the Swift Package and requires no flag.
|
|
53
|
+
|
|
54
|
+
Re-run prebuild after changing plugin options so the native projects pick up the change:
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
npx expo prebuild --clean
|
|
58
|
+
```
|
|
59
|
+
|
|
31
60
|
### Android
|
|
32
61
|
|
|
33
|
-
The Android SDK is distributed via
|
|
62
|
+
The Android SDK is distributed via Maven Central, which is a default repository in every Android project — no additional repository configuration is required.
|
|
34
63
|
|
|
35
64
|
### iOS
|
|
36
65
|
|
|
@@ -248,18 +277,18 @@ await Accept.setUiBehavior({
|
|
|
248
277
|
});
|
|
249
278
|
```
|
|
250
279
|
|
|
251
|
-
### Companion App
|
|
280
|
+
### Companion App
|
|
252
281
|
|
|
253
|
-
The Tapaya companion app is required for card payments on iOS:
|
|
282
|
+
The Tapaya companion app is required for card payments. Supported on both iOS and Android:
|
|
254
283
|
|
|
255
284
|
```ts
|
|
256
285
|
const installed = await Accept.isCompanionAppInstalled();
|
|
257
286
|
|
|
258
287
|
if (!installed) {
|
|
259
|
-
// Prompt user to install via App Store
|
|
288
|
+
// Prompt user to install via the store product sheet (App Store on iOS, Play Store on Android)
|
|
260
289
|
await Accept.presentCompanionAppSheet();
|
|
261
290
|
} else {
|
|
262
|
-
// Pair with the companion app
|
|
291
|
+
// Pair with the companion app (rejects if it is not installed or not ready)
|
|
263
292
|
await Accept.pairWithCompanionApp();
|
|
264
293
|
}
|
|
265
294
|
```
|
|
@@ -278,9 +307,9 @@ if (!installed) {
|
|
|
278
307
|
| `getPaymentStatus(paymentIntentId)` | Retrieve the result of a previous payment. |
|
|
279
308
|
| `logOut()` | End the current merchant session. |
|
|
280
309
|
| `requestLocationPermission()` | Request location permission (required for card payments). |
|
|
281
|
-
| `isCompanionAppInstalled()` |
|
|
282
|
-
| `presentCompanionAppSheet()` |
|
|
283
|
-
| `pairWithCompanionApp()` |
|
|
310
|
+
| `isCompanionAppInstalled()` | Check if the Tapaya companion app is installed. |
|
|
311
|
+
| `presentCompanionAppSheet()` | Show the store product sheet for the companion app (App Store on iOS, Play Store on Android). |
|
|
312
|
+
| `pairWithCompanionApp()` | Pair with the installed companion app. |
|
|
284
313
|
|
|
285
314
|
### `Accept.payments`
|
|
286
315
|
|
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
|
|
3
3
|
group = 'com.tapaya.acceptsdkreactnative'
|
|
4
|
-
version = '1.
|
|
4
|
+
version = '1.3.0'
|
|
5
5
|
|
|
6
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
7
7
|
apply from: expoModulesCorePlugin
|
|
@@ -35,7 +35,7 @@ android {
|
|
|
35
35
|
namespace "com.tapaya.acceptsdkreactnative"
|
|
36
36
|
defaultConfig {
|
|
37
37
|
versionCode 1
|
|
38
|
-
versionName "1.
|
|
38
|
+
versionName "1.3.0"
|
|
39
39
|
}
|
|
40
40
|
lintOptions {
|
|
41
41
|
abortOnError false
|
|
@@ -43,8 +43,12 @@ android {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
dependencies {
|
|
46
|
-
implementation 'com.tapaya:accept:1.
|
|
46
|
+
implementation 'com.tapaya:accept:1.3.0'
|
|
47
47
|
implementation 'com.google.code.gson:gson:2.13.2'
|
|
48
48
|
implementation 'androidx.appcompat:appcompat:1.7.1'
|
|
49
49
|
implementation 'androidx.compose.ui:ui:1.8.2'
|
|
50
|
+
|
|
51
|
+
if ((project.findProperty("com.tapaya.accept.enableStripe") ?: "false").toString().toBoolean()) {
|
|
52
|
+
implementation 'com.tapaya:accept-stripe:1.3.0'
|
|
53
|
+
}
|
|
50
54
|
}
|
|
@@ -703,16 +703,34 @@ class AcceptSdkReactNativeModule : Module() {
|
|
|
703
703
|
Accept.isDemoMode()
|
|
704
704
|
}
|
|
705
705
|
|
|
706
|
-
AsyncFunction("
|
|
707
|
-
|
|
706
|
+
AsyncFunction("isCompanionAppInstalled") { ->
|
|
707
|
+
return@AsyncFunction Accept.isCompanionAppInstalled()
|
|
708
708
|
}
|
|
709
709
|
|
|
710
|
-
AsyncFunction("
|
|
711
|
-
return@
|
|
710
|
+
AsyncFunction("pairWithCompanionApp") Coroutine { ->
|
|
711
|
+
return@Coroutine suspendCancellableCoroutine<Unit> { continuation ->
|
|
712
|
+
try {
|
|
713
|
+
Accept.pairWithCompanionApp(
|
|
714
|
+
onSuccess = { continuation.resume(Unit) },
|
|
715
|
+
onError = { error -> continuation.resumeWithException(error as Throwable) }
|
|
716
|
+
)
|
|
717
|
+
} catch (e: Exception) {
|
|
718
|
+
continuation.resumeWithException(e)
|
|
719
|
+
}
|
|
720
|
+
}
|
|
712
721
|
}
|
|
713
722
|
|
|
714
723
|
AsyncFunction("presentCompanionAppSheet") Coroutine { ->
|
|
715
|
-
|
|
724
|
+
return@Coroutine suspendCancellableCoroutine<Unit> { continuation ->
|
|
725
|
+
try {
|
|
726
|
+
Accept.presentCompanionAppSheet(
|
|
727
|
+
onSuccess = { continuation.resume(Unit) },
|
|
728
|
+
onError = { error -> continuation.resumeWithException(error as Throwable) }
|
|
729
|
+
)
|
|
730
|
+
} catch (e: Exception) {
|
|
731
|
+
continuation.resumeWithException(e)
|
|
732
|
+
}
|
|
733
|
+
}
|
|
716
734
|
}
|
|
717
735
|
|
|
718
736
|
}
|
|
@@ -22,11 +22,8 @@ declare class AcceptSdkReactNativeModule extends NativeModule<AcceptSdkReactNati
|
|
|
22
22
|
isDemoMode(): Promise<boolean>;
|
|
23
23
|
getOnboardingStatus(): Promise<AcceptOnboardingStatus>;
|
|
24
24
|
getPaymentMethodStatus(method: PaymentMethod): Promise<PaymentMethodStatus>;
|
|
25
|
-
/** @platform ios */
|
|
26
25
|
pairWithCompanionApp(): Promise<void>;
|
|
27
|
-
/** @platform ios */
|
|
28
26
|
isCompanionAppInstalled(): Promise<boolean>;
|
|
29
|
-
/** @platform ios */
|
|
30
27
|
presentCompanionAppSheet(): Promise<void>;
|
|
31
28
|
}
|
|
32
29
|
declare const _default: AcceptSdkReactNativeMod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../src/AcceptSdkReactNativeModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"AcceptSdkReactNativeModule.js","sourceRoot":"","sources":["../src/AcceptSdkReactNativeModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AA+BzD,yDAAyD;AACzD,eAAe,mBAAmB,CAA6B,sBAAsB,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo';\n\nimport { AcceptThemeConfiguration, AcceptUiBehavior, CardPaymentIntent, CardPaymentResult, SepaPaymentIntent, SepaPaymentResult, CertisPaymentIntent, CertisPaymentResult, KybPrefillData, AcceptSdkReactNativeModuleEvents, AcceptOnboardingStatus, PaymentMethod, PaymentMethodStatus, RefundIntent, RefundResult } from './AcceptSdkReactNative.types';\n\ndeclare class AcceptSdkReactNativeModule extends NativeModule<AcceptSdkReactNativeModuleEvents> {\n initialize(demo: boolean, theme?: AcceptThemeConfiguration): Promise<void>;\n setTheme(theme: AcceptThemeConfiguration): Promise<void>;\n /** @platform android */\n setUiBehavior(behavior: AcceptUiBehavior): Promise<void>;\n authenticate(token: string): Promise<boolean>;\n getStatus(): Promise<'IDLE' | 'INITIALIZED' | 'LOGGED_IN'>;\n getPaymentStatus(paymentIntentId: string): Promise<string>;\n logOut(): Promise<boolean>;\n requestLocationPermission(): Promise<boolean>;\n presentKyb(prefilling?: KybPrefillData): Promise<void>;\n isPaymentPending(): Promise<boolean>;\n startCardPayment(paymentIntent: CardPaymentIntent): Promise<CardPaymentResult>;\n startSepaPayment(paymentIntent: SepaPaymentIntent): Promise<SepaPaymentResult>;\n startCertisPayment(paymentIntent: CertisPaymentIntent): Promise<CertisPaymentResult>;\n refund(intent: RefundIntent): Promise<RefundResult>;\n cancelActivePayment(): Promise<void>;\n enableDemoMode(): Promise<void>;\n disableDemoMode(): Promise<void>;\n isDemoMode(): Promise<boolean>;\n getOnboardingStatus(): Promise<AcceptOnboardingStatus>;\n getPaymentMethodStatus(method: PaymentMethod): Promise<PaymentMethodStatus>;\n pairWithCompanionApp(): Promise<void>;\n isCompanionAppInstalled(): Promise<boolean>;\n presentCompanionAppSheet(): Promise<void>;\n}\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<AcceptSdkReactNativeModule>('AcceptSdkReactNative');\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -50,19 +50,20 @@ export declare const logOut: () => Promise<void>;
|
|
|
50
50
|
*/
|
|
51
51
|
export declare const requestLocationPermission: () => Promise<boolean>;
|
|
52
52
|
/**
|
|
53
|
-
* Pairs the merchant app with the Tapaya companion app
|
|
54
|
-
*
|
|
53
|
+
* Pairs the merchant app with the Tapaya companion app.
|
|
54
|
+
*
|
|
55
|
+
* On iOS this hands over via deep link; on Android it binds the companion app and runs a
|
|
56
|
+
* readiness handshake. Rejects if the companion app is not installed or not ready to pair.
|
|
55
57
|
*/
|
|
56
58
|
export declare const pairWithCompanionApp: () => Promise<void>;
|
|
57
59
|
/**
|
|
58
60
|
* Returns whether the Tapaya companion app is installed on the device.
|
|
59
|
-
* @platform ios
|
|
60
61
|
*/
|
|
61
62
|
export declare const isCompanionAppInstalled: () => Promise<boolean>;
|
|
62
63
|
/**
|
|
63
|
-
* Presents the
|
|
64
|
+
* Presents the store product page for the Tapaya companion app (App Store sheet on iOS,
|
|
65
|
+
* Play Store on Android).
|
|
64
66
|
* Use this to prompt the user to install the companion app when {@link isCompanionAppInstalled} returns `false`.
|
|
65
|
-
* @platform ios
|
|
66
67
|
*/
|
|
67
68
|
export declare const presentCompanionAppSheet: () => Promise<void>;
|
|
68
69
|
/** Identity and onboarding methods. */
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,gB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AAO,CAAC,IAAI,CAAC;QAIzB,6DAA6D;uBAChD,OAAO,CAAC,IAAI,CAAC;QAI1B,sDAAsD;yBACvC,OAAO,CAAC,OAAO,CAAC;;CAoBhC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -78,23 +78,24 @@ export const requestLocationPermission = () => {
|
|
|
78
78
|
return AcceptSdkReactNative.requestLocationPermission();
|
|
79
79
|
};
|
|
80
80
|
/**
|
|
81
|
-
* Pairs the merchant app with the Tapaya companion app
|
|
82
|
-
*
|
|
81
|
+
* Pairs the merchant app with the Tapaya companion app.
|
|
82
|
+
*
|
|
83
|
+
* On iOS this hands over via deep link; on Android it binds the companion app and runs a
|
|
84
|
+
* readiness handshake. Rejects if the companion app is not installed or not ready to pair.
|
|
83
85
|
*/
|
|
84
86
|
export const pairWithCompanionApp = () => {
|
|
85
87
|
return AcceptSdkReactNative.pairWithCompanionApp();
|
|
86
88
|
};
|
|
87
89
|
/**
|
|
88
90
|
* Returns whether the Tapaya companion app is installed on the device.
|
|
89
|
-
* @platform ios
|
|
90
91
|
*/
|
|
91
92
|
export const isCompanionAppInstalled = () => {
|
|
92
93
|
return AcceptSdkReactNative.isCompanionAppInstalled();
|
|
93
94
|
};
|
|
94
95
|
/**
|
|
95
|
-
* Presents the
|
|
96
|
+
* Presents the store product page for the Tapaya companion app (App Store sheet on iOS,
|
|
97
|
+
* Play Store on Android).
|
|
96
98
|
* Use this to prompt the user to install the companion app when {@link isCompanionAppInstalled} returns `false`.
|
|
97
|
-
* @platform ios
|
|
98
99
|
*/
|
|
99
100
|
export const presentCompanionAppSheet = () => {
|
|
100
101
|
return AcceptSdkReactNative.presentCompanionAppSheet();
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA6BA,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAgChE;;;;GAIG;AACH,M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;;OASG;IACH,MAAM,EAAE,CAAC,MAAoB,EAAyB,EAAE;QACtD,OAAO,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;;;OAOG;IACH,mBAAmB,EAAE,GAAkB,EAAE;QACvC,OAAO,oBAAoB,CAAC,mBAAmB,EAAE,CAAC;IACpD,CAAC;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,gEAAgE;IAChE,MAAM,EAAE,GAAkB,EAAE;QAC1B,OAAO,oBAAoB,CAAC,cAAc,EAAE,CAAC;IAC/C,CAAC;IAED,6DAA6D;IAC7D,OAAO,EAAE,GAAkB,EAAE;QAC3B,OAAO,oBAAoB,CAAC,eAAe,EAAE,CAAC;IAChD,CAAC;IAED,sDAAsD;IACtD,SAAS,EAAE,GAAqB,EAAE;QAChC,OAAO,oBAAoB,CAAC,UAAU,EAAE,CAAC;IAC3C,CAAC;CACF,CAAC;AAEF,MAAM,MAAM,GAAG;IACb,UAAU;IACV,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,SAAS;IACT,gBAAgB;IAChB,MAAM;IACN,yBAAyB;IACzB,oBAAoB;IACpB,uBAAuB;IACvB,wBAAwB;IACxB,QAAQ;IACR,QAAQ;IACR,IAAI;CACL,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {\n type AcceptThemeConfiguration,\n type AcceptColorTheme,\n type AcceptImageTheme,\n type AcceptUiBehavior,\n type NfcIndicator,\n type NfcPosition,\n type NfcZone,\n type GradientColors,\n type CardPaymentResult,\n type SepaPaymentResult,\n type CertisPaymentResult,\n type CardPaymentIntent,\n type CertisPaymentIntent,\n type SepaPaymentIntent,\n type KybPrefillData,\n type SdkStatus,\n type AcceptOnboardingStatus,\n type AcceptPaymentMethodStatus,\n type PaymentMethod,\n type PaymentMethodStatus,\n type RefundIntent,\n type RefundResult,\n type RefundReason,\n type TransactionStatus,\n CardPaymentStatus,\n SepaInstantPaymentStatus,\n CertisInstantPaymentStatus,\n} from './AcceptSdkReactNative.types';\nimport AcceptSdkReactNative from './AcceptSdkReactNativeModule';\n\nexport type {\n AcceptThemeConfiguration,\n AcceptColorTheme,\n AcceptImageTheme,\n AcceptUiBehavior,\n NfcIndicator,\n NfcPosition,\n NfcZone,\n GradientColors,\n CardPaymentResult,\n SepaPaymentResult,\n CertisPaymentResult,\n CardPaymentIntent,\n SepaPaymentIntent,\n CertisPaymentIntent,\n CardPaymentStatus,\n SepaInstantPaymentStatus,\n CertisInstantPaymentStatus,\n SdkStatus,\n KybPrefillData,\n AcceptOnboardingStatus,\n AcceptPaymentMethodStatus,\n PaymentMethod,\n PaymentMethodStatus,\n RefundIntent,\n RefundResult,\n RefundReason,\n TransactionStatus,\n};\n\n/**\n * Initializes the SDK. Must be called before any other method.\n * @param demo - If `true`, connects to the sandbox environment. Defaults to `false` (production).\n * @param theme - Optional UI theme overrides applied at startup.\n */\nexport const initialize = (demo: boolean = false, theme?: AcceptThemeConfiguration): Promise<void> => {\n return AcceptSdkReactNative.initialize(demo, theme);\n};\n\n/**\n * Applies a UI theme after initialization. Can be called any time after {@link initialize}.\n * @param theme - UI theme overrides. Omit `colors` or `images` to keep SDK defaults for those slots.\n */\nexport const setTheme = (theme: AcceptThemeConfiguration): Promise<void> => {\n return AcceptSdkReactNative.setTheme(theme);\n};\n\n/**\n * Configures SDK-owned UI behavior around a transaction —\n * result-screen visibility/duration and Tap-to-Pay NFC zone overrides.\n * No-op on iOS.\n * @platform android\n */\nexport const setUiBehavior = (behavior: AcceptUiBehavior): Promise<void> => {\n return AcceptSdkReactNative.setUiBehavior(behavior);\n};\n\n/**\n * Authenticates a merchant session using a token obtained from your backend.\n * Call after {@link initialize}.\n * @param token - Merchant authentication token.\n * @throws If authentication fails (invalid token, network error, etc.).\n */\nexport const authenticate = (token: string): Promise<void> => {\n return AcceptSdkReactNative.authenticate(token).then(() => Promise.resolve(undefined));\n};\n\n/**\n * Returns the current SDK status.\n * - `IDLE` — not initialized\n * - `INITIALIZED` — initialized, not authenticated\n * - `LOGGED_IN` — authenticated and ready\n */\nexport const getStatus = (): Promise<SdkStatus> => {\n return AcceptSdkReactNative.getStatus();\n};\n\n/**\n * Fetches the current status and details of a payment by its intent ID.\n * @param paymentIntentId - The payment intent identifier.\n * @returns The payment result typed to the appropriate payment method.\n * @throws If the payment intent is not found or the request fails.\n */\nexport const getPaymentStatus = (paymentIntentId: string): Promise<CardPaymentResult | SepaPaymentResult | CertisPaymentResult> => {\n let obj = AcceptSdkReactNative.getPaymentStatus(paymentIntentId);\n\n return obj.then((o) => {\n let r = JSON.parse(o);\n\n switch (r.type) {\n case \"card\":\n return r as CardPaymentResult;\n case \"certis\":\n return r as CertisPaymentResult;\n case \"sepa\":\n return r as SepaPaymentResult;\n default:\n throw new Error(\"Unknown payment result\");\n }\n });\n};\n\n/**\n * Logs out the current merchant session.\n * The SDK remains initialized — call {@link authenticate} again to sign in a different merchant.\n */\nexport const logOut = (): Promise<void> => {\n return AcceptSdkReactNative.logOut().then(() => Promise.resolve(undefined));\n};\n\n/**\n * Requests fine and coarse location permissions required for card (tap-to-pay) payments.\n * @returns `true` if all location permissions were granted.\n */\nexport const requestLocationPermission = (): Promise<boolean> => {\n return AcceptSdkReactNative.requestLocationPermission();\n};\n\n/**\n * Pairs the merchant app with the Tapaya companion app via deep link.\n * @platform ios\n */\nexport const pairWithCompanionApp = (): Promise<void> => {\n return AcceptSdkReactNative.pairWithCompanionApp();\n};\n\n/**\n * Returns whether the Tapaya companion app is installed on the device.\n * @platform ios\n */\nexport const isCompanionAppInstalled = (): Promise<boolean> => {\n return AcceptSdkReactNative.isCompanionAppInstalled();\n};\n\n/**\n * Presents the App Store product page sheet for the Tapaya companion app.\n * Use this to prompt the user to install the companion app when {@link isCompanionAppInstalled} returns `false`.\n * @platform ios\n */\nexport const presentCompanionAppSheet = (): Promise<void> => {\n return AcceptSdkReactNative.presentCompanionAppSheet();\n};\n\n/** Identity and onboarding methods. */\nexport const identity = {\n /**\n * Presents the KYB (Know Your Business) onboarding flow.\n * Fire-and-forget — resolves as soon as the flow is presented.\n * @param prefilling - Optional data to pre-populate the onboarding form.\n */\n presentKyb: (prefilling?: KybPrefillData): Promise<void> => {\n return AcceptSdkReactNative.presentKyb(prefilling);\n },\n\n /**\n * Returns the merchant's aggregate onboarding status and per-method statuses.\n * Requires an authenticated session.\n */\n getOnboardingStatus: (): Promise<AcceptOnboardingStatus> => {\n return AcceptSdkReactNative.getOnboardingStatus();\n },\n\n /**\n * Returns the onboarding status for a single payment method.\n * Requires an authenticated session.\n * @param method - The payment method to query.\n */\n getPaymentMethodStatus: (method: PaymentMethod): Promise<PaymentMethodStatus> => {\n return AcceptSdkReactNative.getPaymentMethodStatus(method);\n },\n};\n\n/** Payment methods for card and bank transfer terminals. */\nexport const payments = {\n /**\n * Starts a card (tap-to-pay) payment flow.\n * Resolves with the final result when the payment completes or fails.\n * @param paymentIntent - Payment details.\n * @param statusCallback - Called with intermediate status updates during the payment flow.\n * @param errorCallback - Called with error details if the terminal encounters an exception.\n * @throws If a payment is already in progress, or if the payment flow fails critically.\n */\n startCardPayment: async (\n paymentIntent: CardPaymentIntent,\n statusCallback: (status: CardPaymentStatus) => void,\n errorCallback: (message: string, exception: string) => void,\n ): Promise<CardPaymentResult> => {\n let isPaymentPending = await AcceptSdkReactNative.isPaymentPending();\n\n if (isPaymentPending) {\n throw Error(\"Payment is already pending, cancel payment first.\")\n }\n\n let eventStatus = AcceptSdkReactNative.addListener('onCardPaymentStatusChange', (status: any) => {\n statusCallback(status.data as CardPaymentStatus)})\n\n AcceptSdkReactNative.addListener('onCardPaymentException', (map: any) => {\n errorCallback(map.message, map.exception)})\n\n let result = AcceptSdkReactNative.startCardPayment(paymentIntent);\n\n result.then(() => {\n eventStatus.remove();\n });\n\n return result\n },\n\n /**\n * Starts a SEPA Instant bank transfer payment flow.\n * Resolves with the final result when the payment completes or fails.\n * @param paymentIntent - Payment details.\n * @param statusCallback - Called with intermediate status updates during the payment flow.\n * @param errorCallback - Called with error details if the terminal encounters an exception.\n * @throws If a payment is already in progress, or if the payment flow fails critically.\n */\n startSepaPayment: async (\n paymentIntent: SepaPaymentIntent,\n statusCallback: (status: SepaInstantPaymentStatus) => void,\n errorCallback: (message: string, exception: string) => void,\n ): Promise<SepaPaymentResult> => {\n let isPaymentPending = await AcceptSdkReactNative.isPaymentPending();\n\n if (isPaymentPending) {\n throw Error(\"Payment is already pending, cancel payment first.\")\n }\n\n let eventStatus = AcceptSdkReactNative.addListener('onSepaPaymentStatusChange', (status: any) =>\n statusCallback(status.data as SepaInstantPaymentStatus))\n\n AcceptSdkReactNative.addListener('onSepaPaymentException', (map: any) =>\n errorCallback(map.message, map.exception))\n\n let result = AcceptSdkReactNative.startSepaPayment(paymentIntent);\n\n result.then(() => {\n eventStatus.remove();\n });\n\n return result\n },\n\n /**\n * Starts a Certis Instant bank transfer payment flow.\n * Resolves with the final result when the payment completes or fails.\n * @param paymentIntent - Payment details.\n * @param statusCallback - Called with intermediate status updates during the payment flow.\n * @param errorCallback - Called with error details if the terminal encounters an exception.\n * @throws If a payment is already in progress, or if the payment flow fails critically.\n */\n startCertisPayment: async (\n paymentIntent: CertisPaymentIntent,\n statusCallback: (status: CertisInstantPaymentStatus) => void,\n errorCallback: (message: string, exception: string) => void,\n ): Promise<CertisPaymentResult> => {\n let isPaymentPending = await AcceptSdkReactNative.isPaymentPending();\n\n if (isPaymentPending) {\n throw Error(\"Payment is already pending, cancel payment first.\")\n }\n\n let eventStatus = AcceptSdkReactNative.addListener('onCertisPaymentStatusChange', (status: any) =>\n statusCallback(status.data as CertisInstantPaymentStatus))\n\n AcceptSdkReactNative.addListener('onCertisPaymentException', (map: any) =>\n errorCallback(map.message, map.exception))\n\n let result = AcceptSdkReactNative.startCertisPayment(paymentIntent);\n\n result.then(() => {\n eventStatus.remove();\n });\n\n return result\n },\n\n /**\n * Refunds a previously completed card payment.\n *\n * Runs headlessly — no UI is shown.\n * @param intent - Refund details.\n * @returns The refund result. On iOS, fully populated. On Android, only `status` and `refundReason` are guaranteed —\n * call {@link getPaymentStatus} on the source payment for richer state.\n * @throws If the source payment is not found, the refund is in conflict (already refunded, wrong state),\n * or the SDK is not initialized / authenticated.\n */\n refund: (intent: RefundIntent): Promise<RefundResult> => {\n return AcceptSdkReactNative.refund(intent);\n },\n\n /**\n * Cancels the currently active payment flow.\n *\n * Dismisses any payment UI and — if still pending — cancels the transaction server-side.\n * The in-flight `startCardPayment` / `startSepaPayment` / `startCertisPayment` promise resolves\n * to an aborted result.\n * @throws If no payment flow is currently in progress.\n */\n cancelActivePayment: (): Promise<void> => {\n return AcceptSdkReactNative.cancelActivePayment();\n },\n};\n\n/**\n * Demo mode toggles. When enabled, payment flows bypass real terminals and return\n * synthetic results — useful for development and screenshots.\n */\nexport const demo = {\n /** Enables demo mode. Subsequent payments will be simulated. */\n enable: (): Promise<void> => {\n return AcceptSdkReactNative.enableDemoMode();\n },\n\n /** Disables demo mode and returns to real terminal flows. */\n disable: (): Promise<void> => {\n return AcceptSdkReactNative.disableDemoMode();\n },\n\n /** Returns whether demo mode is currently enabled. */\n isEnabled: (): Promise<boolean> => {\n return AcceptSdkReactNative.isDemoMode();\n },\n};\n\nconst Accept = {\n initialize,\n setTheme,\n setUiBehavior,\n authenticate,\n getStatus,\n getPaymentStatus,\n logOut,\n requestLocationPermission,\n pairWithCompanionApp,\n isCompanionAppInstalled,\n presentCompanionAppSheet,\n identity,\n payments,\n demo,\n};\n\nexport default Accept;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA6BA,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAgChE;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAgB,KAAK,EAAE,KAAgC,EAAiB,EAAE;IACnG,OAAO,oBAAoB,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACtD,C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B,EAAE,GAAkB,EAAE;QACvC,OAAO,oBAAoB,CAAC,mBAAmB,EAAE,CAAC;IACpD,CAAC;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,gEAAgE;IAChE,MAAM,EAAE,GAAkB,EAAE;QAC1B,OAAO,oBAAoB,CAAC,cAAc,EAAE,CAAC;IAC/C,CAAC;IAED,6DAA6D;IAC7D,OAAO,EAAE,GAAkB,EAAE;QAC3B,OAAO,oBAAoB,CAAC,eAAe,EAAE,CAAC;IAChD,CAAC;IAED,sDAAsD;IACtD,SAAS,EAAE,GAAqB,EAAE;QAChC,OAAO,oBAAoB,CAAC,UAAU,EAAE,CAAC;IAC3C,CAAC;CACF,CAAC;AAEF,MAAM,MAAM,GAAG;IACb,UAAU;IACV,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,SAAS;IACT,gBAAgB;IAChB,MAAM;IACN,yBAAyB;IACzB,oBAAoB;IACpB,uBAAuB;IACvB,wBAAwB;IACxB,QAAQ;IACR,QAAQ;IACR,IAAI;CACL,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {\n type AcceptThemeConfiguration,\n type AcceptColorTheme,\n type AcceptImageTheme,\n type AcceptUiBehavior,\n type NfcIndicator,\n type NfcPosition,\n type NfcZone,\n type GradientColors,\n type CardPaymentResult,\n type SepaPaymentResult,\n type CertisPaymentResult,\n type CardPaymentIntent,\n type CertisPaymentIntent,\n type SepaPaymentIntent,\n type KybPrefillData,\n type SdkStatus,\n type AcceptOnboardingStatus,\n type AcceptPaymentMethodStatus,\n type PaymentMethod,\n type PaymentMethodStatus,\n type RefundIntent,\n type RefundResult,\n type RefundReason,\n type TransactionStatus,\n CardPaymentStatus,\n SepaInstantPaymentStatus,\n CertisInstantPaymentStatus,\n} from './AcceptSdkReactNative.types';\nimport AcceptSdkReactNative from './AcceptSdkReactNativeModule';\n\nexport type {\n AcceptThemeConfiguration,\n AcceptColorTheme,\n AcceptImageTheme,\n AcceptUiBehavior,\n NfcIndicator,\n NfcPosition,\n NfcZone,\n GradientColors,\n CardPaymentResult,\n SepaPaymentResult,\n CertisPaymentResult,\n CardPaymentIntent,\n SepaPaymentIntent,\n CertisPaymentIntent,\n CardPaymentStatus,\n SepaInstantPaymentStatus,\n CertisInstantPaymentStatus,\n SdkStatus,\n KybPrefillData,\n AcceptOnboardingStatus,\n AcceptPaymentMethodStatus,\n PaymentMethod,\n PaymentMethodStatus,\n RefundIntent,\n RefundResult,\n RefundReason,\n TransactionStatus,\n};\n\n/**\n * Initializes the SDK. Must be called before any other method.\n * @param demo - If `true`, connects to the sandbox environment. Defaults to `false` (production).\n * @param theme - Optional UI theme overrides applied at startup.\n */\nexport const initialize = (demo: boolean = false, theme?: AcceptThemeConfiguration): Promise<void> => {\n return AcceptSdkReactNative.initialize(demo, theme);\n};\n\n/**\n * Applies a UI theme after initialization. Can be called any time after {@link initialize}.\n * @param theme - UI theme overrides. Omit `colors` or `images` to keep SDK defaults for those slots.\n */\nexport const setTheme = (theme: AcceptThemeConfiguration): Promise<void> => {\n return AcceptSdkReactNative.setTheme(theme);\n};\n\n/**\n * Configures SDK-owned UI behavior around a transaction —\n * result-screen visibility/duration and Tap-to-Pay NFC zone overrides.\n * No-op on iOS.\n * @platform android\n */\nexport const setUiBehavior = (behavior: AcceptUiBehavior): Promise<void> => {\n return AcceptSdkReactNative.setUiBehavior(behavior);\n};\n\n/**\n * Authenticates a merchant session using a token obtained from your backend.\n * Call after {@link initialize}.\n * @param token - Merchant authentication token.\n * @throws If authentication fails (invalid token, network error, etc.).\n */\nexport const authenticate = (token: string): Promise<void> => {\n return AcceptSdkReactNative.authenticate(token).then(() => Promise.resolve(undefined));\n};\n\n/**\n * Returns the current SDK status.\n * - `IDLE` — not initialized\n * - `INITIALIZED` — initialized, not authenticated\n * - `LOGGED_IN` — authenticated and ready\n */\nexport const getStatus = (): Promise<SdkStatus> => {\n return AcceptSdkReactNative.getStatus();\n};\n\n/**\n * Fetches the current status and details of a payment by its intent ID.\n * @param paymentIntentId - The payment intent identifier.\n * @returns The payment result typed to the appropriate payment method.\n * @throws If the payment intent is not found or the request fails.\n */\nexport const getPaymentStatus = (paymentIntentId: string): Promise<CardPaymentResult | SepaPaymentResult | CertisPaymentResult> => {\n let obj = AcceptSdkReactNative.getPaymentStatus(paymentIntentId);\n\n return obj.then((o) => {\n let r = JSON.parse(o);\n\n switch (r.type) {\n case \"card\":\n return r as CardPaymentResult;\n case \"certis\":\n return r as CertisPaymentResult;\n case \"sepa\":\n return r as SepaPaymentResult;\n default:\n throw new Error(\"Unknown payment result\");\n }\n });\n};\n\n/**\n * Logs out the current merchant session.\n * The SDK remains initialized — call {@link authenticate} again to sign in a different merchant.\n */\nexport const logOut = (): Promise<void> => {\n return AcceptSdkReactNative.logOut().then(() => Promise.resolve(undefined));\n};\n\n/**\n * Requests fine and coarse location permissions required for card (tap-to-pay) payments.\n * @returns `true` if all location permissions were granted.\n */\nexport const requestLocationPermission = (): Promise<boolean> => {\n return AcceptSdkReactNative.requestLocationPermission();\n};\n\n/**\n * Pairs the merchant app with the Tapaya companion app.\n *\n * On iOS this hands over via deep link; on Android it binds the companion app and runs a\n * readiness handshake. Rejects if the companion app is not installed or not ready to pair.\n */\nexport const pairWithCompanionApp = (): Promise<void> => {\n return AcceptSdkReactNative.pairWithCompanionApp();\n};\n\n/**\n * Returns whether the Tapaya companion app is installed on the device.\n */\nexport const isCompanionAppInstalled = (): Promise<boolean> => {\n return AcceptSdkReactNative.isCompanionAppInstalled();\n};\n\n/**\n * Presents the store product page for the Tapaya companion app (App Store sheet on iOS,\n * Play Store on Android).\n * Use this to prompt the user to install the companion app when {@link isCompanionAppInstalled} returns `false`.\n */\nexport const presentCompanionAppSheet = (): Promise<void> => {\n return AcceptSdkReactNative.presentCompanionAppSheet();\n};\n\n/** Identity and onboarding methods. */\nexport const identity = {\n /**\n * Presents the KYB (Know Your Business) onboarding flow.\n * Fire-and-forget — resolves as soon as the flow is presented.\n * @param prefilling - Optional data to pre-populate the onboarding form.\n */\n presentKyb: (prefilling?: KybPrefillData): Promise<void> => {\n return AcceptSdkReactNative.presentKyb(prefilling);\n },\n\n /**\n * Returns the merchant's aggregate onboarding status and per-method statuses.\n * Requires an authenticated session.\n */\n getOnboardingStatus: (): Promise<AcceptOnboardingStatus> => {\n return AcceptSdkReactNative.getOnboardingStatus();\n },\n\n /**\n * Returns the onboarding status for a single payment method.\n * Requires an authenticated session.\n * @param method - The payment method to query.\n */\n getPaymentMethodStatus: (method: PaymentMethod): Promise<PaymentMethodStatus> => {\n return AcceptSdkReactNative.getPaymentMethodStatus(method);\n },\n};\n\n/** Payment methods for card and bank transfer terminals. */\nexport const payments = {\n /**\n * Starts a card (tap-to-pay) payment flow.\n * Resolves with the final result when the payment completes or fails.\n * @param paymentIntent - Payment details.\n * @param statusCallback - Called with intermediate status updates during the payment flow.\n * @param errorCallback - Called with error details if the terminal encounters an exception.\n * @throws If a payment is already in progress, or if the payment flow fails critically.\n */\n startCardPayment: async (\n paymentIntent: CardPaymentIntent,\n statusCallback: (status: CardPaymentStatus) => void,\n errorCallback: (message: string, exception: string) => void,\n ): Promise<CardPaymentResult> => {\n let isPaymentPending = await AcceptSdkReactNative.isPaymentPending();\n\n if (isPaymentPending) {\n throw Error(\"Payment is already pending, cancel payment first.\")\n }\n\n let eventStatus = AcceptSdkReactNative.addListener('onCardPaymentStatusChange', (status: any) => {\n statusCallback(status.data as CardPaymentStatus)})\n\n AcceptSdkReactNative.addListener('onCardPaymentException', (map: any) => {\n errorCallback(map.message, map.exception)})\n\n let result = AcceptSdkReactNative.startCardPayment(paymentIntent);\n\n result.then(() => {\n eventStatus.remove();\n });\n\n return result\n },\n\n /**\n * Starts a SEPA Instant bank transfer payment flow.\n * Resolves with the final result when the payment completes or fails.\n * @param paymentIntent - Payment details.\n * @param statusCallback - Called with intermediate status updates during the payment flow.\n * @param errorCallback - Called with error details if the terminal encounters an exception.\n * @throws If a payment is already in progress, or if the payment flow fails critically.\n */\n startSepaPayment: async (\n paymentIntent: SepaPaymentIntent,\n statusCallback: (status: SepaInstantPaymentStatus) => void,\n errorCallback: (message: string, exception: string) => void,\n ): Promise<SepaPaymentResult> => {\n let isPaymentPending = await AcceptSdkReactNative.isPaymentPending();\n\n if (isPaymentPending) {\n throw Error(\"Payment is already pending, cancel payment first.\")\n }\n\n let eventStatus = AcceptSdkReactNative.addListener('onSepaPaymentStatusChange', (status: any) =>\n statusCallback(status.data as SepaInstantPaymentStatus))\n\n AcceptSdkReactNative.addListener('onSepaPaymentException', (map: any) =>\n errorCallback(map.message, map.exception))\n\n let result = AcceptSdkReactNative.startSepaPayment(paymentIntent);\n\n result.then(() => {\n eventStatus.remove();\n });\n\n return result\n },\n\n /**\n * Starts a Certis Instant bank transfer payment flow.\n * Resolves with the final result when the payment completes or fails.\n * @param paymentIntent - Payment details.\n * @param statusCallback - Called with intermediate status updates during the payment flow.\n * @param errorCallback - Called with error details if the terminal encounters an exception.\n * @throws If a payment is already in progress, or if the payment flow fails critically.\n */\n startCertisPayment: async (\n paymentIntent: CertisPaymentIntent,\n statusCallback: (status: CertisInstantPaymentStatus) => void,\n errorCallback: (message: string, exception: string) => void,\n ): Promise<CertisPaymentResult> => {\n let isPaymentPending = await AcceptSdkReactNative.isPaymentPending();\n\n if (isPaymentPending) {\n throw Error(\"Payment is already pending, cancel payment first.\")\n }\n\n let eventStatus = AcceptSdkReactNative.addListener('onCertisPaymentStatusChange', (status: any) =>\n statusCallback(status.data as CertisInstantPaymentStatus))\n\n AcceptSdkReactNative.addListener('onCertisPaymentException', (map: any) =>\n errorCallback(map.message, map.exception))\n\n let result = AcceptSdkReactNative.startCertisPayment(paymentIntent);\n\n result.then(() => {\n eventStatus.remove();\n });\n\n return result\n },\n\n /**\n * Refunds a previously completed card payment.\n *\n * Runs headlessly — no UI is shown.\n * @param intent - Refund details.\n * @returns The refund result. On iOS, fully populated. On Android, only `status` and `refundReason` are guaranteed —\n * call {@link getPaymentStatus} on the source payment for richer state.\n * @throws If the source payment is not found, the refund is in conflict (already refunded, wrong state),\n * or the SDK is not initialized / authenticated.\n */\n refund: (intent: RefundIntent): Promise<RefundResult> => {\n return AcceptSdkReactNative.refund(intent);\n },\n\n /**\n * Cancels the currently active payment flow.\n *\n * Dismisses any payment UI and — if still pending — cancels the transaction server-side.\n * The in-flight `startCardPayment` / `startSepaPayment` / `startCertisPayment` promise resolves\n * to an aborted result.\n * @throws If no payment flow is currently in progress.\n */\n cancelActivePayment: (): Promise<void> => {\n return AcceptSdkReactNative.cancelActivePayment();\n },\n};\n\n/**\n * Demo mode toggles. When enabled, payment flows bypass real terminals and return\n * synthetic results — useful for development and screenshots.\n */\nexport const demo = {\n /** Enables demo mode. Subsequent payments will be simulated. */\n enable: (): Promise<void> => {\n return AcceptSdkReactNative.enableDemoMode();\n },\n\n /** Disables demo mode and returns to real terminal flows. */\n disable: (): Promise<void> => {\n return AcceptSdkReactNative.disableDemoMode();\n },\n\n /** Returns whether demo mode is currently enabled. */\n isEnabled: (): Promise<boolean> => {\n return AcceptSdkReactNative.isDemoMode();\n },\n};\n\nconst Accept = {\n initialize,\n setTheme,\n setUiBehavior,\n authenticate,\n getStatus,\n getPaymentStatus,\n logOut,\n requestLocationPermission,\n pairWithCompanionApp,\n isCompanionAppInstalled,\n presentCompanionAppSheet,\n identity,\n payments,\n demo,\n};\n\nexport default Accept;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tapayadot/accept-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Accept SDK for React Native/Expo",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -96,5 +96,39 @@
|
|
|
96
96
|
},
|
|
97
97
|
"workspaces": [
|
|
98
98
|
"example"
|
|
99
|
-
]
|
|
99
|
+
],
|
|
100
|
+
"overrides": {
|
|
101
|
+
"shell-quote": "1.8.4",
|
|
102
|
+
"fast-xml-parser": "5.7.0",
|
|
103
|
+
"fast-xml-builder": "1.1.7",
|
|
104
|
+
"flatted": "3.4.2",
|
|
105
|
+
"@babel/plugin-transform-modules-systemjs": "7.29.4",
|
|
106
|
+
"@tootallnate/once": "2.0.1",
|
|
107
|
+
"launch-editor": "2.14.1",
|
|
108
|
+
"postcss": "8.5.10",
|
|
109
|
+
"qs": "6.15.2",
|
|
110
|
+
"tar": "7.5.16",
|
|
111
|
+
"uuid": "11.1.1",
|
|
112
|
+
"yaml": "2.8.3",
|
|
113
|
+
"form-data": "4.0.6",
|
|
114
|
+
"undici": "6.27.0",
|
|
115
|
+
"@xmldom/xmldom": "0.8.13",
|
|
116
|
+
"@isaacs/brace-expansion": "5.0.1",
|
|
117
|
+
"ajv": "6.15.0",
|
|
118
|
+
"joi": "17.13.4",
|
|
119
|
+
"@babel/core": "7.29.7",
|
|
120
|
+
"js-yaml": "4.2.0",
|
|
121
|
+
"minimatch@3": "3.1.5",
|
|
122
|
+
"minimatch@9": "9.0.9",
|
|
123
|
+
"minimatch@10": "10.2.4",
|
|
124
|
+
"picomatch@2": "2.3.2",
|
|
125
|
+
"picomatch@3": "3.0.2",
|
|
126
|
+
"picomatch@4": "4.0.4",
|
|
127
|
+
"brace-expansion@1": "1.1.14",
|
|
128
|
+
"brace-expansion@2": "2.0.3",
|
|
129
|
+
"brace-expansion@5": "5.0.6",
|
|
130
|
+
"ws@6": "6.2.4",
|
|
131
|
+
"ws@7": "7.5.11",
|
|
132
|
+
"ws@8": "8.21.0"
|
|
133
|
+
}
|
|
100
134
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {
|
|
2
|
+
withPlugins,
|
|
3
|
+
withXcodeProject,
|
|
4
|
+
withGradleProperties,
|
|
5
|
+
} = require("@expo/config-plugins");
|
|
2
6
|
const { withBuildProperties } = require("expo-build-properties");
|
|
3
7
|
|
|
4
8
|
const ACCEPT_SDK_IOS_REPO = "https://github.com/tapayadot/accept-ios";
|
|
5
9
|
const ACCEPT_SDK_IOS_PRODUCTS = ["AcceptSDK"];
|
|
6
10
|
|
|
11
|
+
const STRIPE_GRADLE_PROPERTY = "com.tapaya.accept.enableStripe";
|
|
12
|
+
|
|
7
13
|
function withAcceptSdkIos(config) {
|
|
8
14
|
return withXcodeProject(config, (config) => {
|
|
9
15
|
const project = config.modResults;
|
|
@@ -24,7 +30,7 @@ function withAcceptSdkIos(config) {
|
|
|
24
30
|
repositoryURL: `"${ACCEPT_SDK_IOS_REPO}"`,
|
|
25
31
|
requirement: {
|
|
26
32
|
kind: "exactVersion",
|
|
27
|
-
version: "1.2.
|
|
33
|
+
version: "1.2.4",
|
|
28
34
|
},
|
|
29
35
|
};
|
|
30
36
|
|
|
@@ -58,7 +64,23 @@ function withAcceptSdkIos(config) {
|
|
|
58
64
|
});
|
|
59
65
|
}
|
|
60
66
|
|
|
61
|
-
|
|
67
|
+
function withAcceptStripeAndroid(config, enableStripe) {
|
|
68
|
+
return withGradleProperties(config, (config) => {
|
|
69
|
+
config.modResults = config.modResults.filter(
|
|
70
|
+
(item) =>
|
|
71
|
+
!(item.type === "property" && item.key === STRIPE_GRADLE_PROPERTY)
|
|
72
|
+
);
|
|
73
|
+
config.modResults.push({
|
|
74
|
+
type: "property",
|
|
75
|
+
key: STRIPE_GRADLE_PROPERTY,
|
|
76
|
+
value: String(Boolean(enableStripe)),
|
|
77
|
+
});
|
|
78
|
+
return config;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
module.exports = function withAcceptSdk(config, props = {}) {
|
|
83
|
+
const enableStripe = (props && props.enableStripe) || false;
|
|
62
84
|
return withPlugins(config, [
|
|
63
85
|
[
|
|
64
86
|
withBuildProperties,
|
|
@@ -68,6 +90,7 @@ module.exports = function withMyModule(config) {
|
|
|
68
90
|
},
|
|
69
91
|
},
|
|
70
92
|
],
|
|
93
|
+
(config) => withAcceptStripeAndroid(config, enableStripe),
|
|
71
94
|
withAcceptSdkIos,
|
|
72
95
|
]);
|
|
73
96
|
};
|