react-native-tpay 1.3.26 → 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 +12 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/tpay/model/TpayConfiguration.kt +3 -0
- package/android/src/main/java/com/tpay/util/TpayUtil.kt +1 -0
- package/ios/Source/Configuration/MerchantConfiguration.swift +4 -0
- package/ios/Source/Extension/TPay+Setup.swift +4 -1
- package/ios/Source/Model/Transportation/Transportation+MerchantConfiguration.swift +1 -0
- package/ios/Source/TpaySDK.swift +2 -1
- package/ios/Source/TpayVersion.generated.swift +1 -1
- package/lib/commonjs/model/tpay_configuration.js +3 -1
- package/lib/commonjs/model/tpay_configuration.js.map +1 -1
- package/lib/module/model/tpay_configuration.js +3 -1
- package/lib/module/model/tpay_configuration.js.map +1 -1
- package/lib/typescript/src/model/tpay_configuration.d.ts +3 -1
- package/lib/typescript/src/model/tpay_configuration.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native-tpay.podspec +1 -1
- package/src/model/tpay_configuration.ts +5 -1
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);
|
package/android/build.gradle
CHANGED
|
@@ -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.
|
|
98
|
+
implementation('com.tpay:sdk:1.2.9') {
|
|
99
99
|
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib'
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -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
|
|
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
|
}
|
package/ios/Source/TpaySDK.swift
CHANGED
|
@@ -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.
|
|
2
|
+
let reactNativeTpayVersion: String = "1.4.0"
|
|
@@ -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;
|
|
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":[]}
|
|
@@ -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;
|
|
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,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;
|
|
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
|
+
"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",
|
|
@@ -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
|
}
|