react-native-tpay 1.3.24 → 1.4.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/README.md CHANGED
@@ -191,6 +191,14 @@ new MerchantDetails(
191
191
  > Every `LocalizedString` value **MUST NOT** be an empty string!
192
192
  > Otherwise this may cause an app crash.
193
193
 
194
+ ### Single transaction mode
195
+
196
+ When enabled, the Tpay UI module is restricted to completing a single transaction. Defaults to `false` (multiple transactions allowed) when omitted.
197
+
198
+ ```typescript
199
+ const singleTransaction = true;
200
+ ```
201
+
194
202
  ### Summary
195
203
  Beneath you will find how a complete configuration should look like.
196
204
 
@@ -232,11 +240,14 @@ const paymentMethods = new PaymentMethods(
232
240
  [InstallmentPayment.ratyPekao, InstallmentPayment.payPo]
233
241
  );
234
242
 
243
+ const singleTransaction = true;
244
+
235
245
  const configuration = new TpayConfiguration(
236
246
  merchant,
237
247
  merchantDetails,
238
248
  languages,
239
- paymentMethods
249
+ paymentMethods,
250
+ singleTransaction
240
251
  );
241
252
 
242
253
  await configure(configuration);
@@ -1181,6 +1192,77 @@ const screenlessResult = await screenlessApplePayPayment(applePayPayment);
1181
1192
  handleScreenlessResult(screenlessResult);
1182
1193
  ```
1183
1194
 
1195
+ ### Two-step Apple Pay flow (early `transactionId`)
1196
+
1197
+ > [!note]
1198
+ > Available since **react-native-tpay 1.3.24** (iOS SDK 1.3.18). **iOS only.**
1199
+
1200
+ The classic `screenlessApplePayPayment` above performs the whole operation in a
1201
+ single call and returns the `transactionId` only after the payment is finished.
1202
+ If you need the `transactionId` earlier (for example to start polling, log it, or
1203
+ correlate the order before the Apple Pay sheet is shown, the same way BLIK,
1204
+ transfer and PayPo already work), use the two-step flow instead.
1205
+
1206
+ `screenlessApplePayPayment` keeps working unchanged, so existing integrations are
1207
+ not affected. Switching is opt-in. A version bump alone does not change behaviour;
1208
+ you must call the new methods.
1209
+
1210
+ **Step 1: create the transaction (no token yet).**
1211
+ `initApplePayPayment` creates a pending transaction and returns its
1212
+ `transactionId` before you present the Apple Pay sheet. Note there is no
1213
+ `applePayToken` here.
1214
+
1215
+ ```typescript
1216
+ const initPayment = new ApplePayInitPayment(
1217
+ new PaymentDetails(
1218
+ 71.15,
1219
+ 'transaction description',
1220
+ 'hidden description',
1221
+ Language.pl,
1222
+ ),
1223
+ new Payer(
1224
+ 'John Doe',
1225
+ 'john.doe@example.com',
1226
+ '123456789',
1227
+ new Address('Test Street 1', 'Warsaw', 'PL', '00-007'),
1228
+ ),
1229
+ new Callbacks(
1230
+ new Redirects('https://success.url', 'https://error.url'),
1231
+ new Notifications('https://yourdomain.com/notifications', 'email@address'),
1232
+ ),
1233
+ );
1234
+
1235
+ const initResult = await initApplePayPayment(initPayment);
1236
+ // initResult is a ScreenlessPaymentCreated. Read the transactionId here,
1237
+ // before showing the Apple Pay sheet:
1238
+ const transactionId = initResult.transactionId;
1239
+ ```
1240
+
1241
+ **Step 2: acquire the Apple Pay token, then finalize.**
1242
+ Obtain the `apple_pay_token` yourself via Apple's PassKit framework (present the
1243
+ Apple Pay sheet). Then pass it together with the `transactionId` from step 1 to
1244
+ `finalizeApplePayPayment`. This call actually charges the transaction.
1245
+
1246
+ ```typescript
1247
+ const finalizePayment = new ApplePayFinalizePayment(
1248
+ transactionId, // from initApplePayPayment
1249
+ 'apple_pay_token', // from PassKit wallet authorization
1250
+ );
1251
+
1252
+ const screenlessResult = await finalizeApplePayPayment(finalizePayment);
1253
+
1254
+ // On success this resolves to ScreenlessPaymentCreated (the same result every
1255
+ // other screenless method returns, including one-step screenlessApplePayPayment).
1256
+ // The final "paid" confirmation arrives asynchronously on your notification URL.
1257
+ handleScreenlessResult(screenlessResult);
1258
+ ```
1259
+
1260
+ > [!warning]
1261
+ > The transaction is not paid until `finalizeApplePayPayment` completes
1262
+ > successfully. After `initApplePayPayment` the transaction exists but is still
1263
+ > unpaid. If you never call `finalizeApplePayPayment`, the transaction stays
1264
+ > unpaid.
1265
+
1184
1266
  ## License
1185
1267
 
1186
1268
  This library is released under the [MIT License](https://opensource.org/license/mit/).
@@ -95,7 +95,7 @@ dependencies {
95
95
  //noinspection GradleDynamicVersion
96
96
  implementation "com.facebook.react:react-native:+"
97
97
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
98
- implementation('com.tpay:sdk:1.2.8') {
98
+ implementation('com.tpay:sdk:1.2.9') {
99
99
  exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib'
100
100
  }
101
101
  }
@@ -119,6 +119,16 @@ class TpayModule(
119
119
  handleScreenlessResult(TpayScreenlessResult.MethodCallError(APPLE_PAY_NOT_AVAILABLE), promise)
120
120
  }
121
121
 
122
+ @ReactMethod
123
+ fun initApplePayPayment(json: String, promise: Promise) {
124
+ handleScreenlessResult(TpayScreenlessResult.MethodCallError(APPLE_PAY_NOT_AVAILABLE), promise)
125
+ }
126
+
127
+ @ReactMethod
128
+ fun finalizeApplePayPayment(json: String, promise: Promise) {
129
+ handleScreenlessResult(TpayScreenlessResult.MethodCallError(APPLE_PAY_NOT_AVAILABLE), promise)
130
+ }
131
+
122
132
  @ReactMethod
123
133
  fun screenlessAmbiguousBLIKPayment(json: String, promise: Promise) = catchAndHandleScreenlessException(promise) {
124
134
  val payment = AmbiguousBLIKPayment.fromJson(json)
@@ -12,6 +12,7 @@ data class TpayConfiguration(
12
12
  val merchantDetails: MerchantDetails,
13
13
  val languages: Languages,
14
14
  val paymentMethods: PaymentMethods,
15
+ val singleTransaction: Boolean = false,
15
16
  val sdkVersion: String = "",
16
17
  ) : Configuration {
17
18
  override fun validate() {
@@ -37,6 +38,7 @@ data class TpayConfiguration(
37
38
  private const val MERCHANT_DETAILS = "merchantDetails"
38
39
  private const val LANGUAGES = "languages"
39
40
  private const val PAYMENT_METHODS = "paymentMethods"
41
+ private const val SINGLE_TRANSACTION = "singleTransaction"
40
42
  private const val SDK_VERSION = "sdkVersion"
41
43
 
42
44
  fun fromJson(json: String): TpayConfiguration = JSONObject(json).run {
@@ -45,6 +47,7 @@ data class TpayConfiguration(
45
47
  merchantDetails = MerchantDetails.fromJson(getJSONObject(MERCHANT_DETAILS)),
46
48
  languages = Languages.fromJson(getJSONObject(LANGUAGES)),
47
49
  paymentMethods = PaymentMethods.fromJson(getJSONObject(PAYMENT_METHODS)),
50
+ singleTransaction = optBoolean(SINGLE_TRANSACTION, false),
48
51
  sdkVersion = optString(SDK_VERSION, ""),
49
52
  )
50
53
  }
@@ -33,6 +33,7 @@ object TpayUtil {
33
33
  })
34
34
  .configure(merchant.environment)
35
35
  .configure(paymentMethods.methods)
36
+ .configure(Option.SingleTransactionOnly(singleTransaction))
36
37
  .configure(languages.preferredLanguage, languages.supportedLanguages)
37
38
  .configure(Compatibility.REACT_NATIVE, sdkVersion)
38
39
  .configure(object : MerchantDetailsProvider {
@@ -86,6 +86,10 @@ final class MerchantConfiguration {
86
86
  return .init(merchantDisplayName: merchantDisplayName, merchantHeadquarters: merchantHeadquarters, regulationsLink: regulationsLink)
87
87
  }
88
88
 
89
+ func singleTransaction() -> Bool {
90
+ configuration.singleTransaction ?? false
91
+ }
92
+
89
93
  func sslCertificatesProvider() -> DefaultSSLCertificatesProvider? {
90
94
  guard let publicKeyHash = configuration.merchant.certificatePinningConfiguration?.publicKeyHash else { return nil }
91
95
  return .init(apiConfiguration: .init(publicKeyHashes: [publicKeyHash]))
@@ -9,7 +9,8 @@ extension TpayModule {
9
9
  preferredLanguage: Language?,
10
10
  supportedLanguages: [Language],
11
11
  sslCertificatesProvider: SSLCertificatesProvider?,
12
- detailsProvider: MerchantDetailsProvider) throws {
12
+ detailsProvider: MerchantDetailsProvider,
13
+ singleTransaction: Bool) throws {
13
14
  try TpayModule.configure(
14
15
  compatibility: .reactNative,
15
16
  sdkVersionName: reactNativeTpayVersion
@@ -30,6 +31,8 @@ extension TpayModule {
30
31
  TpayModule.configure(sslCertificatesProvider: sslCertificatesProvider)
31
32
  }
32
33
 
34
+ TpayModule.configure(singleTransaction: singleTransaction)
35
+
33
36
  if case let .invalid(error) = TpayModule.checkConfiguration() {
34
37
  throw error
35
38
  }
@@ -8,5 +8,6 @@ extension Transportation {
8
8
  let languages: Languages?
9
9
  let merchantDetails: MerchantDetails
10
10
  let paymentMethods: PaymentMethods?
11
+ let singleTransaction: Bool?
11
12
  }
12
13
  }
@@ -43,7 +43,8 @@ final class TpayRNModule: NSObject, RCTBridgeModule {
43
43
  preferredLanguage: preferredLanguage,
44
44
  supportedLanguages: supportedLanguages,
45
45
  sslCertificatesProvider: sslCertificatesProvider,
46
- detailsProvider: detailsProvider)
46
+ detailsProvider: detailsProvider,
47
+ singleTransaction: configuration.singleTransaction())
47
48
  resolve(ConfigurationResult.configurationValid().toJson())
48
49
  } catch {
49
50
  resolve(ConfigurationResult.configurationFailure(error: error).toJson())
@@ -1,2 +1,2 @@
1
1
  // Auto-generated from package.json — do not edit manually.
2
- let reactNativeTpayVersion: String = "1.3.24"
2
+ let reactNativeTpayVersion: String = "1.4.0"
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../src","sources":["NativeTpay.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GA+BpCC,gCAAmB,CAACC,GAAG,CAAO,cAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../src","sources":["NativeTpay.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAiCpCC,gCAAmB,CAACC,GAAG,CAAO,cAAc,CAAC","ignoreList":[]}
@@ -13,12 +13,14 @@ class TpayConfiguration {
13
13
  * @param merchantDetails - information about merchant in different languages
14
14
  * @param languages - languages that user will be able to use in Tpay UI module
15
15
  * @param paymentMethods - payment methods that user will be able to use in Tpay UI module
16
+ * @param singleTransaction - Enables single transaction mode in the Tpay UI module. Defaults to `false`. Supported on iOS and Android.
16
17
  */
17
- constructor(merchant, merchantDetails, languages, paymentMethods) {
18
+ constructor(merchant, merchantDetails, languages, paymentMethods, singleTransaction = false) {
18
19
  this.merchant = merchant;
19
20
  this.merchantDetails = merchantDetails;
20
21
  this.languages = languages;
21
22
  this.paymentMethods = paymentMethods;
23
+ this.singleTransaction = singleTransaction;
22
24
  }
23
25
  }
24
26
  exports.TpayConfiguration = TpayConfiguration;
@@ -1 +1 @@
1
- {"version":3,"names":["TpayConfiguration","constructor","merchant","merchantDetails","languages","paymentMethods","exports"],"sourceRoot":"../../../src","sources":["model/tpay_configuration.ts"],"mappings":";;;;;;AAKA;AACA;AACA;AACO,MAAMA,iBAAiB,CAAC;EAM7B;AACF;AACA;AACA;AACA;AACA;EACEC,WAAWA,CACTC,QAAkB,EAClBC,eAAgC,EAChCC,SAAoB,EACpBC,cAA8B,EAC9B;IACA,IAAI,CAACH,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,eAAe,GAAGA,eAAe;IACtC,IAAI,CAACC,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,cAAc,GAAGA,cAAc;EACtC;AACF;AAACC,OAAA,CAAAN,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["TpayConfiguration","constructor","merchant","merchantDetails","languages","paymentMethods","singleTransaction","exports"],"sourceRoot":"../../../src","sources":["model/tpay_configuration.ts"],"mappings":";;;;;;AAKA;AACA;AACA;AACO,MAAMA,iBAAiB,CAAC;EAO7B;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CACTC,QAAkB,EAClBC,eAAgC,EAChCC,SAAoB,EACpBC,cAA8B,EAC9BC,iBAA0B,GAAG,KAAK,EAClC;IACA,IAAI,CAACJ,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,eAAe,GAAGA,eAAe;IACtC,IAAI,CAACC,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,cAAc,GAAGA,cAAc;IACpC,IAAI,CAACC,iBAAiB,GAAGA,iBAAiB;EAC5C;AACF;AAACC,OAAA,CAAAP,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../src","sources":["NativeTpay.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AA+BlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,cAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../src","sources":["NativeTpay.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAiClD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,cAAc,CAAC","ignoreList":[]}
@@ -9,12 +9,14 @@ export class TpayConfiguration {
9
9
  * @param merchantDetails - information about merchant in different languages
10
10
  * @param languages - languages that user will be able to use in Tpay UI module
11
11
  * @param paymentMethods - payment methods that user will be able to use in Tpay UI module
12
+ * @param singleTransaction - Enables single transaction mode in the Tpay UI module. Defaults to `false`. Supported on iOS and Android.
12
13
  */
13
- constructor(merchant, merchantDetails, languages, paymentMethods) {
14
+ constructor(merchant, merchantDetails, languages, paymentMethods, singleTransaction = false) {
14
15
  this.merchant = merchant;
15
16
  this.merchantDetails = merchantDetails;
16
17
  this.languages = languages;
17
18
  this.paymentMethods = paymentMethods;
19
+ this.singleTransaction = singleTransaction;
18
20
  }
19
21
  }
20
22
  //# sourceMappingURL=tpay_configuration.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TpayConfiguration","constructor","merchant","merchantDetails","languages","paymentMethods"],"sourceRoot":"../../../src","sources":["model/tpay_configuration.ts"],"mappings":";;AAKA;AACA;AACA;AACA,OAAO,MAAMA,iBAAiB,CAAC;EAM7B;AACF;AACA;AACA;AACA;AACA;EACEC,WAAWA,CACTC,QAAkB,EAClBC,eAAgC,EAChCC,SAAoB,EACpBC,cAA8B,EAC9B;IACA,IAAI,CAACH,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,eAAe,GAAGA,eAAe;IACtC,IAAI,CAACC,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,cAAc,GAAGA,cAAc;EACtC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["TpayConfiguration","constructor","merchant","merchantDetails","languages","paymentMethods","singleTransaction"],"sourceRoot":"../../../src","sources":["model/tpay_configuration.ts"],"mappings":";;AAKA;AACA;AACA;AACA,OAAO,MAAMA,iBAAiB,CAAC;EAO7B;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CACTC,QAAkB,EAClBC,eAAgC,EAChCC,SAAoB,EACpBC,cAA8B,EAC9BC,iBAA0B,GAAG,KAAK,EAClC;IACA,IAAI,CAACJ,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,eAAe,GAAGA,eAAe;IACtC,IAAI,CAACC,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,cAAc,GAAGA,cAAc;IACpC,IAAI,CAACC,iBAAiB,GAAGA,iBAAiB;EAC5C;AACF","ignoreList":[]}
@@ -10,6 +10,8 @@ export interface Spec extends TurboModule {
10
10
  screenlessTransferPayment(transferPayment: string): Promise<string>;
11
11
  screenlessGooglePayPayment(googlePayPayment: string): Promise<string>;
12
12
  screenlessApplePayPayment(applePayPayment: string): Promise<string>;
13
+ initApplePayPayment(applePayInitPayment: string): Promise<string>;
14
+ finalizeApplePayPayment(applePayFinalizePayment: string): Promise<string>;
13
15
  screenlessRatyPekaoPayment(ratyPekaoPayment: string): Promise<string>;
14
16
  screenlessPayPoPayment(payPoPayment: string): Promise<string>;
15
17
  configureGooglePayUtils(configuration: string): Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeTpay.d.ts","sourceRoot":"","sources":["../../../src/NativeTpay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGh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G,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAGjC,2BAA2B,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAChD;;AAGD,wBAA6D"}
@@ -10,12 +10,14 @@ export declare class TpayConfiguration {
10
10
  merchantDetails: MerchantDetails;
11
11
  languages: Languages;
12
12
  paymentMethods: PaymentMethods;
13
+ singleTransaction: boolean;
13
14
  /**
14
15
  * @param merchant - configuration information about merchant
15
16
  * @param merchantDetails - information about merchant in different languages
16
17
  * @param languages - languages that user will be able to use in Tpay UI module
17
18
  * @param paymentMethods - payment methods that user will be able to use in Tpay UI module
19
+ * @param singleTransaction - Enables single transaction mode in the Tpay UI module. Defaults to `false`. Supported on iOS and Android.
18
20
  */
19
- constructor(merchant: Merchant, merchantDetails: MerchantDetails, languages: Languages, paymentMethods: PaymentMethods);
21
+ constructor(merchant: Merchant, merchantDetails: MerchantDetails, languages: Languages, paymentMethods: PaymentMethods, singleTransaction?: boolean);
20
22
  }
21
23
  //# sourceMappingURL=tpay_configuration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tpay_configuration.d.ts","sourceRoot":"","sources":["../../../../src/model/tpay_configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,cAAc,CAAC;IAE/B;;;;;OAKG;gBAED,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc;CAOjC"}
1
+ {"version":3,"file":"tpay_configuration.d.ts","sourceRoot":"","sources":["../../../../src/model/tpay_configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,EAAE,OAAO,CAAC;IAE3B;;;;;;OAMG;gBAED,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,iBAAiB,GAAE,OAAe;CAQrC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tpay",
3
- "version": "1.3.24",
3
+ "version": "1.4.0",
4
4
  "description": "The Tpay SDK empowers your app to seamlessly integrate Tpay’s payment functionalities, providing a comprehensive and developer-friendly solution for managing payments.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -38,5 +38,5 @@ Pod::Spec.new do |s|
38
38
  s.dependency "ReactCommon/turbomodule/core"
39
39
  end
40
40
  end
41
- s.dependency "Tpay-SDK", "1.3.18"
41
+ s.dependency "Tpay-SDK", "1.4.0"
42
42
  end
package/src/NativeTpay.ts CHANGED
@@ -17,6 +17,8 @@ export interface Spec extends TurboModule {
17
17
  screenlessTransferPayment(transferPayment: string): Promise<string>;
18
18
  screenlessGooglePayPayment(googlePayPayment: string): Promise<string>;
19
19
  screenlessApplePayPayment(applePayPayment: string): Promise<string>;
20
+ initApplePayPayment(applePayInitPayment: string): Promise<string>;
21
+ finalizeApplePayPayment(applePayFinalizePayment: string): Promise<string>;
20
22
  screenlessRatyPekaoPayment(ratyPekaoPayment: string): Promise<string>;
21
23
  screenlessPayPoPayment(payPoPayment: string): Promise<string>;
22
24
 
@@ -11,22 +11,26 @@ export class TpayConfiguration {
11
11
  merchantDetails: MerchantDetails;
12
12
  languages: Languages;
13
13
  paymentMethods: PaymentMethods;
14
+ singleTransaction: boolean;
14
15
 
15
16
  /**
16
17
  * @param merchant - configuration information about merchant
17
18
  * @param merchantDetails - information about merchant in different languages
18
19
  * @param languages - languages that user will be able to use in Tpay UI module
19
20
  * @param paymentMethods - payment methods that user will be able to use in Tpay UI module
21
+ * @param singleTransaction - Enables single transaction mode in the Tpay UI module. Defaults to `false`. Supported on iOS and Android.
20
22
  */
21
23
  constructor(
22
24
  merchant: Merchant,
23
25
  merchantDetails: MerchantDetails,
24
26
  languages: Languages,
25
- paymentMethods: PaymentMethods
27
+ paymentMethods: PaymentMethods,
28
+ singleTransaction: boolean = false
26
29
  ) {
27
30
  this.merchant = merchant;
28
31
  this.merchantDetails = merchantDetails;
29
32
  this.languages = languages;
30
33
  this.paymentMethods = paymentMethods;
34
+ this.singleTransaction = singleTransaction;
31
35
  }
32
36
  }
@@ -1,23 +0,0 @@
1
- package com.tpay.util
2
-
3
- import com.tpay.sdk.api.models.Presentable
4
- import java.util.ArrayDeque
5
-
6
- object TpayBackpressUtil {
7
- private var sheet: Presentable? = null
8
-
9
- val isModuleVisible: Boolean
10
- get() = sheet != null
11
-
12
- fun set(sheet: Presentable) {
13
- this.sheet = sheet
14
- }
15
-
16
- fun remove() {
17
- sheet = null
18
- }
19
-
20
- fun onBackPressed() {
21
- sheet?.onBackPressed()
22
- }
23
- }