judokit-react-native 3.4.6 → 3.4.8
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/RNJudopay.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/reactlibrary/Extensions.kt +9 -0
- package/android/src/main/java/com/reactlibrary/Helpers.kt +1 -0
- package/android/src/main/java/com/reactlibrary/JudoReactNativeModule.kt +25 -6
- package/ios/Classes/Wrappers/RNWrappers.m +19 -2
- package/ios/Podfile +1 -1
- package/ios/Podfile.lock +9 -9
- package/package.json +1 -1
- package/types/JudoTypes.tsx +1 -0
package/RNJudopay.podspec
CHANGED
|
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.source_files = "ios/Classes/**/*.{h,m}"
|
|
16
16
|
s.requires_arc = true
|
|
17
17
|
s.dependency "React"
|
|
18
|
-
s.dependency "JudoKit-iOS", "3.1.
|
|
18
|
+
s.dependency "JudoKit-iOS", "3.1.8"
|
|
19
19
|
|
|
20
20
|
s.test_spec 'RNJudoTests' do |test_spec|
|
|
21
21
|
test_spec.source_files = 'ios/RNJudoTests/**/*.{h,m}'
|
package/android/build.gradle
CHANGED
|
@@ -9,7 +9,7 @@ import groovy.json.JsonSlurper
|
|
|
9
9
|
|
|
10
10
|
def DEFAULT_COMPILE_SDK_VERSION = 31
|
|
11
11
|
def DEFAULT_BUILD_TOOLS_VERSION = "30.0.3"
|
|
12
|
-
def DEFAULT_MIN_SDK_VERSION =
|
|
12
|
+
def DEFAULT_MIN_SDK_VERSION = 21
|
|
13
13
|
def DEFAULT_TARGET_SDK_VERSION = 31
|
|
14
14
|
|
|
15
15
|
def safeExtGet(prop, fallback) {
|
|
@@ -101,7 +101,7 @@ dependencies {
|
|
|
101
101
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
102
102
|
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
|
|
103
103
|
|
|
104
|
-
implementation 'com.judopay:judokit-android:3.0.
|
|
104
|
+
implementation 'com.judopay:judokit-android:3.0.11'
|
|
105
105
|
|
|
106
106
|
//JUnit 5
|
|
107
107
|
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5_version"
|
|
@@ -170,6 +170,15 @@ internal val ReadableMap.cardAddressCountryCode: Int?
|
|
|
170
170
|
return null
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
internal val ReadableMap.cardAddressState: String?
|
|
174
|
+
get() {
|
|
175
|
+
if (cardAddress.hasKey("state")) {
|
|
176
|
+
return cardAddress?.getString("state")
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return null
|
|
180
|
+
}
|
|
181
|
+
|
|
173
182
|
internal val ReadableMap.networkConnectTimeout: Long?
|
|
174
183
|
get() = networkTimeout?.getDouble("connectTimeout")?.toLong()
|
|
175
184
|
|
|
@@ -148,6 +148,7 @@ internal fun getAddress(options: ReadableMap): Address? {
|
|
|
148
148
|
.setTown(options.cardAddressTown)
|
|
149
149
|
.setPostCode(options.cardAddressPostCode)
|
|
150
150
|
.setCountryCode(options.cardAddressCountryCode)
|
|
151
|
+
.setState(options.cardAddressState)
|
|
151
152
|
.build()
|
|
152
153
|
}
|
|
153
154
|
return null
|
|
@@ -37,6 +37,7 @@ class JudoReactNativeModule internal constructor(val context: ReactApplicationCo
|
|
|
37
37
|
|
|
38
38
|
private val listener = JudoReactNativeActivityEventListener()
|
|
39
39
|
internal var transactionPromise: Promise? = null
|
|
40
|
+
private var isSubscribedToCardTransactionResults = false
|
|
40
41
|
|
|
41
42
|
/**
|
|
42
43
|
* A broadcast receiver to catch Pay by Bank app /order/bank/sale response event.
|
|
@@ -107,6 +108,8 @@ class JudoReactNativeModule internal constructor(val context: ReactApplicationCo
|
|
|
107
108
|
@ReactMethod
|
|
108
109
|
fun performTokenTransaction(options: ReadableMap, promise: Promise) {
|
|
109
110
|
try {
|
|
111
|
+
ensureIsSubscribedToCardTransactionResults()
|
|
112
|
+
|
|
110
113
|
val activity = context.currentActivity as FragmentActivity
|
|
111
114
|
val manager = CardTransactionManager.getInstance(activity)
|
|
112
115
|
|
|
@@ -147,18 +150,34 @@ class JudoReactNativeModule internal constructor(val context: ReactApplicationCo
|
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
|
|
153
|
+
private fun ensureIsSubscribedToCardTransactionResults() {
|
|
154
|
+
if (isSubscribedToCardTransactionResults) {
|
|
155
|
+
return
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
val activity = context.currentActivity
|
|
159
|
+
activity?.let {
|
|
160
|
+
isSubscribedToCardTransactionResults = true
|
|
161
|
+
CardTransactionManager.getInstance(activity as FragmentActivity).registerResultListener(this)
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
private fun unsubscribeFromCardTransactionResults() {
|
|
166
|
+
val activity = context.currentActivity
|
|
167
|
+
activity?.let {
|
|
168
|
+
isSubscribedToCardTransactionResults = false
|
|
169
|
+
CardTransactionManager.getInstance(activity as FragmentActivity).unRegisterResultListener(this)
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
150
173
|
override fun initialize() {
|
|
151
174
|
super.initialize()
|
|
152
|
-
|
|
153
|
-
val activity = context.currentActivity as FragmentActivity
|
|
154
|
-
CardTransactionManager.getInstance(activity).registerResultListener(this)
|
|
175
|
+
ensureIsSubscribedToCardTransactionResults()
|
|
155
176
|
}
|
|
156
177
|
|
|
157
178
|
override fun invalidate() {
|
|
158
179
|
super.invalidate()
|
|
159
|
-
|
|
160
|
-
val activity = context.currentActivity as FragmentActivity
|
|
161
|
-
CardTransactionManager.getInstance(activity).unRegisterResultListener(this)
|
|
180
|
+
unsubscribeFromCardTransactionResults()
|
|
162
181
|
}
|
|
163
182
|
|
|
164
183
|
override fun onCardTransactionResult(result: JudoPaymentResult) {
|
|
@@ -328,7 +328,8 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
328
328
|
address3:[addressDictionary optionalStringForKey:@"line3"]
|
|
329
329
|
town:[addressDictionary optionalStringForKey:@"town"]
|
|
330
330
|
postCode:[addressDictionary optionalStringForKey:@"postCode"]
|
|
331
|
-
countryCode:[addressDictionary optionalNumberForKey:@"countryCode"]
|
|
331
|
+
countryCode:[addressDictionary optionalNumberForKey:@"countryCode"]
|
|
332
|
+
state:[addressDictionary optionalStringForKey:@"state"]];
|
|
332
333
|
}
|
|
333
334
|
|
|
334
335
|
+ (JPUIConfiguration *)uiConfigurationFromConfiguration:(NSDictionary *)configuration {
|
|
@@ -435,9 +436,25 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
435
436
|
result = @1;
|
|
436
437
|
}
|
|
437
438
|
|
|
439
|
+
NSNumber *type = @0;
|
|
440
|
+
|
|
441
|
+
switch (response.type) {
|
|
442
|
+
case JPTransactionTypePreAuth:
|
|
443
|
+
type = @1;
|
|
444
|
+
break;
|
|
445
|
+
case JPTransactionTypeCheckCard:
|
|
446
|
+
type = @3;
|
|
447
|
+
break;
|
|
448
|
+
case JPTransactionTypeSaveCard:
|
|
449
|
+
type = @4;
|
|
450
|
+
break;
|
|
451
|
+
default:
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
|
|
438
455
|
[mappedResponse setValue:response.receiptId forKey:@"receiptId"];
|
|
439
456
|
[mappedResponse setValue:response.paymentReference forKey:@"yourPaymentReference"];
|
|
440
|
-
[mappedResponse setValue
|
|
457
|
+
[mappedResponse setValue:type forKey:@"type"];
|
|
441
458
|
[mappedResponse setValue:response.createdAt forKey:@"createdAt"];
|
|
442
459
|
[mappedResponse setValue:result forKey:@"result"];
|
|
443
460
|
[mappedResponse setValue:response.message forKey:@"message"];
|
package/ios/Podfile
CHANGED
|
@@ -19,7 +19,7 @@ target 'RNJudo' do
|
|
|
19
19
|
# use_frameworks!
|
|
20
20
|
|
|
21
21
|
# Pods for RNJudo
|
|
22
|
-
pod "JudoKit-iOS", "3.1.
|
|
22
|
+
pod "JudoKit-iOS", "3.1.8"
|
|
23
23
|
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
|
|
24
24
|
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
|
|
25
25
|
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
|
package/ios/Podfile.lock
CHANGED
|
@@ -21,13 +21,13 @@ PODS:
|
|
|
21
21
|
- DoubleConversion
|
|
22
22
|
- glog
|
|
23
23
|
- glog (0.3.5)
|
|
24
|
-
- Judo3DS2_iOS (1.1.
|
|
25
|
-
- JudoKit-iOS (3.1.
|
|
24
|
+
- Judo3DS2_iOS (1.1.3)
|
|
25
|
+
- JudoKit-iOS (3.1.7):
|
|
26
26
|
- DeviceDNA (~> 2.0.0)
|
|
27
|
-
- Judo3DS2_iOS (~> 1.1.
|
|
27
|
+
- Judo3DS2_iOS (~> 1.1.3)
|
|
28
28
|
- TrustKit
|
|
29
29
|
- ZappMerchantLib
|
|
30
|
-
- OpenSSL-Universal (1.1.
|
|
30
|
+
- OpenSSL-Universal (1.1.1900)
|
|
31
31
|
- RCTRequired (0.61.5)
|
|
32
32
|
- RCTTypeSafety (0.61.5):
|
|
33
33
|
- FBLazyVector (= 0.61.5)
|
|
@@ -236,7 +236,7 @@ DEPENDENCIES:
|
|
|
236
236
|
- FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)
|
|
237
237
|
- Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
|
|
238
238
|
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
|
|
239
|
-
- JudoKit-iOS (= 3.1.
|
|
239
|
+
- JudoKit-iOS (= 3.1.7)
|
|
240
240
|
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
|
|
241
241
|
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
|
|
242
242
|
- React (from `../node_modules/react-native/`)
|
|
@@ -331,9 +331,9 @@ SPEC CHECKSUMS:
|
|
|
331
331
|
FBReactNativeSpec: 118d0d177724c2d67f08a59136eb29ef5943ec75
|
|
332
332
|
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
|
|
333
333
|
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
|
|
334
|
-
Judo3DS2_iOS:
|
|
335
|
-
JudoKit-iOS:
|
|
336
|
-
OpenSSL-Universal:
|
|
334
|
+
Judo3DS2_iOS: b2396a1f0aa3e8d428fdd887c8b6eae5d3aa4f79
|
|
335
|
+
JudoKit-iOS: 9bdb404617132df3a22ce0713b610258fbc9a817
|
|
336
|
+
OpenSSL-Universal: 84efb8a29841f2764ac5403e0c4119a28b713346
|
|
337
337
|
RCTRequired: b153add4da6e7dbc44aebf93f3cf4fcae392ddf1
|
|
338
338
|
RCTTypeSafety: 9aa1b91d7f9310fc6eadc3cf95126ffe818af320
|
|
339
339
|
React: b6a59ef847b2b40bb6e0180a97d0ca716969ac78
|
|
@@ -357,6 +357,6 @@ SPEC CHECKSUMS:
|
|
|
357
357
|
Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b
|
|
358
358
|
ZappMerchantLib: b14bc5814840426d351190309250347ca9b0983d
|
|
359
359
|
|
|
360
|
-
PODFILE CHECKSUM:
|
|
360
|
+
PODFILE CHECKSUM: b43fb77cd20fdc9f4c3ce03edc13aa92f131243b
|
|
361
361
|
|
|
362
362
|
COCOAPODS: 1.11.3
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "judokit-react-native",
|
|
3
3
|
"title": "Judopay React Native Module",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.8",
|
|
5
5
|
"description": "A React Native module for the Judopay native SDKs to take payments on iOS and Android.",
|
|
6
6
|
"main": "JudoPay.tsx",
|
|
7
7
|
"scripts": {
|