judokit-react-native 3.3.7 → 3.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/JudoPay.tsx +13 -3
- package/README.md +2 -2
- package/RNJudopay.podspec +1 -1
- package/android/build.gradle +21 -23
- package/android/src/main/java/com/reactlibrary/Extensions.kt +207 -34
- package/android/src/main/java/com/reactlibrary/Helpers.kt +98 -56
- package/android/src/main/java/com/reactlibrary/JudoReactNativeModule.kt +55 -74
- package/android/src/main/java/com/reactlibrary/JudoReactNativePBBAManager.kt +4 -4
- package/ios/Classes/RNJudo.m +32 -46
- package/ios/Classes/Wrappers/RNWrappers.h +10 -0
- package/ios/Classes/Wrappers/RNWrappers.m +116 -39
- package/ios/Podfile +2 -2
- package/ios/Podfile.lock +16 -8
- package/ios/RNJudo.xcodeproj/project.pbxproj +73 -92
- package/ios/RNJudo.xcodeproj/xcshareddata/xcschemes/RNJudo.xcscheme +1 -1
- package/package.json +1 -1
- package/types/JudoTypes.tsx +30 -0
package/JudoPay.tsx
CHANGED
|
@@ -144,20 +144,30 @@ class JudoPay {
|
|
|
144
144
|
*
|
|
145
145
|
* @param mode - a JudoTransactionMode value that defines if the transaction is either a payment or pre-auth.
|
|
146
146
|
* @param configuration - a JudoConfiguration object that is used to configure/customize the payment flow.
|
|
147
|
-
* @param
|
|
147
|
+
* @param cardToken - the saved card token string.
|
|
148
|
+
* @param securityCode - the saved card token security code.
|
|
149
|
+
* @param cardholderName - the saved card token cardholder name.
|
|
150
|
+
* @param cardScheme - the saved card token scheme name.
|
|
148
151
|
*
|
|
149
152
|
* @returns an asynchronous JudoResponse object, containing the transaction results.
|
|
150
153
|
*/
|
|
151
154
|
public async performTokenTransaction(
|
|
152
155
|
mode: JudoTransactionMode,
|
|
153
156
|
configuration: JudoConfiguration,
|
|
154
|
-
|
|
157
|
+
cardToken: string,
|
|
158
|
+
securityCode: string,
|
|
159
|
+
cardholderName: string,
|
|
160
|
+
cardScheme: string
|
|
155
161
|
): Promise<JudoResponse> {
|
|
156
162
|
const params = this.generateTransactionModeParameters(
|
|
157
163
|
mode,
|
|
158
164
|
configuration
|
|
159
165
|
)
|
|
160
|
-
params['cardToken'] =
|
|
166
|
+
params['cardToken'] = cardToken
|
|
167
|
+
params['securityCode'] = securityCode
|
|
168
|
+
params['cardholderName'] = cardholderName
|
|
169
|
+
params['cardScheme'] = cardScheme
|
|
170
|
+
|
|
161
171
|
return NativeModules.RNJudo.performTokenTransaction(params)
|
|
162
172
|
}
|
|
163
173
|
|
package/README.md
CHANGED
|
@@ -60,9 +60,9 @@ JudoPay's React Native module and sample app. This module is a wrapper around th
|
|
|
60
60
|
allprojects {
|
|
61
61
|
repositories {
|
|
62
62
|
mavenLocal()
|
|
63
|
+
|
|
64
|
+
mavenCentral()
|
|
63
65
|
google()
|
|
64
|
-
jcenter()
|
|
65
|
-
maven { url 'https://jitpack.io' }
|
|
66
66
|
maven {
|
|
67
67
|
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
|
|
68
68
|
url("$rootDir/../node_modules/react-native/android")
|
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", "
|
|
18
|
+
s.dependency "JudoKit-iOS", "3.0.2"
|
|
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
|
@@ -7,37 +7,32 @@ apply plugin: 'de.mannodermaus.android-junit5'
|
|
|
7
7
|
|
|
8
8
|
import groovy.json.JsonSlurper
|
|
9
9
|
|
|
10
|
-
def DEFAULT_COMPILE_SDK_VERSION =
|
|
11
|
-
def DEFAULT_BUILD_TOOLS_VERSION = "
|
|
10
|
+
def DEFAULT_COMPILE_SDK_VERSION = 31
|
|
11
|
+
def DEFAULT_BUILD_TOOLS_VERSION = "30.0.3"
|
|
12
12
|
def DEFAULT_MIN_SDK_VERSION = 19
|
|
13
|
-
def DEFAULT_TARGET_SDK_VERSION =
|
|
13
|
+
def DEFAULT_TARGET_SDK_VERSION = 31
|
|
14
14
|
|
|
15
15
|
def safeExtGet(prop, fallback) {
|
|
16
16
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
buildscript {
|
|
20
|
-
ext.kotlin_version = '1.
|
|
20
|
+
ext.kotlin_version = '1.6.10'
|
|
21
21
|
ext.junit5_version = '5.7.0'
|
|
22
22
|
|
|
23
23
|
repositories {
|
|
24
|
+
maven { url 'https://plugins.gradle.org/m2/' }
|
|
25
|
+
|
|
26
|
+
mavenCentral()
|
|
24
27
|
google()
|
|
25
|
-
jcenter()
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
dependencies {
|
|
29
|
-
classpath 'com.android.tools.build:gradle:3.5.
|
|
31
|
+
classpath 'com.android.tools.build:gradle:3.5.4'
|
|
30
32
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
31
33
|
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
|
|
32
|
-
classpath 'de.mannodermaus.gradle.plugins:android-junit5:1.7.
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
allprojects {
|
|
36
|
-
repositories {
|
|
37
|
-
maven { url "http://pay.cards/maven" }
|
|
38
|
-
}
|
|
34
|
+
classpath 'de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1'
|
|
39
35
|
}
|
|
40
|
-
|
|
41
36
|
}
|
|
42
37
|
|
|
43
38
|
android {
|
|
@@ -86,9 +81,12 @@ android {
|
|
|
86
81
|
}
|
|
87
82
|
|
|
88
83
|
repositories {
|
|
84
|
+
mavenLocal()
|
|
85
|
+
|
|
89
86
|
mavenCentral()
|
|
90
87
|
google()
|
|
91
|
-
|
|
88
|
+
|
|
89
|
+
maven { url 'https://vocalinkzapp.jfrog.io/artifactory/merchant-library-maven/' }
|
|
92
90
|
|
|
93
91
|
maven { url "$projectDir/../node_modules/react-native/android" }
|
|
94
92
|
}
|
|
@@ -96,14 +94,14 @@ repositories {
|
|
|
96
94
|
dependencies {
|
|
97
95
|
//noinspection GradleDynamicVersion
|
|
98
96
|
implementation 'com.facebook.react:react-native:+'
|
|
99
|
-
implementation 'androidx.appcompat:appcompat:1.1
|
|
100
|
-
implementation 'androidx.appcompat:appcompat-resources:1.1
|
|
97
|
+
implementation 'androidx.appcompat:appcompat:1.4.1'
|
|
98
|
+
implementation 'androidx.appcompat:appcompat-resources:1.4.1'
|
|
101
99
|
implementation 'com.google.android.gms:play-services-wallet:18.0.0'
|
|
102
|
-
implementation 'androidx.core:core-ktx:1.
|
|
100
|
+
implementation 'androidx.core:core-ktx:1.7.0'
|
|
103
101
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
104
|
-
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.
|
|
102
|
+
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
|
|
105
103
|
|
|
106
|
-
implementation 'com.judopay:judokit-android:
|
|
104
|
+
implementation 'com.judopay:judokit-android:3.0.3'
|
|
107
105
|
|
|
108
106
|
//JUnit 5
|
|
109
107
|
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5_version"
|
|
@@ -111,7 +109,7 @@ dependencies {
|
|
|
111
109
|
testImplementation "org.junit.jupiter:junit-jupiter-params:$junit5_version"
|
|
112
110
|
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:$junit5_version"
|
|
113
111
|
|
|
114
|
-
testImplementation 'androidx.test:core:1.
|
|
112
|
+
testImplementation 'androidx.test:core:1.4.0'
|
|
115
113
|
testImplementation 'io.mockk:mockk:1.10.0'
|
|
116
114
|
testImplementation 'android.arch.core:core-testing:1.1.1'
|
|
117
115
|
}
|
|
@@ -174,8 +172,8 @@ afterEvaluate { project ->
|
|
|
174
172
|
|
|
175
173
|
android.libraryVariants.all { variant ->
|
|
176
174
|
def name = variant.name.capitalize()
|
|
177
|
-
task "jar${name}"(type: Jar, dependsOn: variant.
|
|
178
|
-
from variant.
|
|
175
|
+
task "jar${name}"(type: Jar, dependsOn: variant.javaCompileProvider.get()) {
|
|
176
|
+
from variant.javaCompileProvider.get().destinationDir
|
|
179
177
|
}
|
|
180
178
|
}
|
|
181
179
|
|
|
@@ -7,6 +7,18 @@ import com.facebook.react.bridge.ReadableMap
|
|
|
7
7
|
import com.judopay.judokit.android.JUDO_OPTIONS
|
|
8
8
|
import com.judopay.judokit.android.Judo
|
|
9
9
|
import com.judopay.judokit.android.JudoActivity
|
|
10
|
+
import com.judopay.judokit.android.model.CardNetwork
|
|
11
|
+
|
|
12
|
+
const val CARD_SCHEME_VISA = "visa"
|
|
13
|
+
const val CARD_SCHEME_MASTERCARD = "mastercard"
|
|
14
|
+
const val CARD_SCHEME_AMEX = "amex"
|
|
15
|
+
|
|
16
|
+
internal fun ReadableMap?.hasKey(key: String): Boolean {
|
|
17
|
+
if (this != null) {
|
|
18
|
+
return this.hasKey(key)
|
|
19
|
+
}
|
|
20
|
+
return false
|
|
21
|
+
}
|
|
10
22
|
|
|
11
23
|
internal val ReadableMap.configuration: ReadableMap?
|
|
12
24
|
get() = getMap("configuration")
|
|
@@ -31,6 +43,30 @@ internal val ReadableMap.securityCode: String?
|
|
|
31
43
|
return null
|
|
32
44
|
}
|
|
33
45
|
|
|
46
|
+
internal val ReadableMap.cardholderName: String?
|
|
47
|
+
get() {
|
|
48
|
+
if (hasKey("cardholderName")) {
|
|
49
|
+
return getString("cardholderName")
|
|
50
|
+
}
|
|
51
|
+
return null
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
internal val ReadableMap.cardType: CardNetwork
|
|
55
|
+
get() {
|
|
56
|
+
val cardScheme = if (hasKey("cardScheme")) {
|
|
57
|
+
getString("cardScheme") ?: ""
|
|
58
|
+
} else {
|
|
59
|
+
""
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return when (cardScheme.lowercase()) {
|
|
63
|
+
CARD_SCHEME_VISA -> CardNetwork.VISA
|
|
64
|
+
CARD_SCHEME_MASTERCARD -> CardNetwork.MASTERCARD
|
|
65
|
+
CARD_SCHEME_AMEX -> CardNetwork.AMEX
|
|
66
|
+
else -> CardNetwork.OTHER
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
34
70
|
internal val ReadableMap.judoId: String?
|
|
35
71
|
get() = configuration?.getString("judoId")
|
|
36
72
|
|
|
@@ -64,10 +100,153 @@ internal val ReadableMap.paymentReference: String?
|
|
|
64
100
|
internal val ReadableMap.isInitialRecurringPayment: Boolean?
|
|
65
101
|
get() = configuration?.getBoolean("isInitialRecurringPayment")
|
|
66
102
|
|
|
103
|
+
internal val ReadableMap.networkTimeout: ReadableMap?
|
|
104
|
+
get() {
|
|
105
|
+
if (configuration.hasKey("networkTimeout")) {
|
|
106
|
+
return configuration?.getMap("networkTimeout")
|
|
107
|
+
}
|
|
108
|
+
return null
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
internal val ReadableMap.cardAddress: ReadableMap?
|
|
112
|
+
get() {
|
|
113
|
+
if (configuration.hasKey("cardAddress")) {
|
|
114
|
+
return configuration?.getMap("cardAddress")
|
|
115
|
+
}
|
|
116
|
+
return null
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
internal val ReadableMap.cardAddressLine1: String?
|
|
120
|
+
get() {
|
|
121
|
+
if (cardAddress.hasKey("line1")) {
|
|
122
|
+
return cardAddress?.getString("line1")
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return null
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
internal val ReadableMap.cardAddressLine2: String?
|
|
129
|
+
get() {
|
|
130
|
+
if (cardAddress.hasKey("line2")) {
|
|
131
|
+
return cardAddress?.getString("line2")
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return null
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
internal val ReadableMap.cardAddressLine3: String?
|
|
138
|
+
get() {
|
|
139
|
+
if (cardAddress.hasKey("line3")) {
|
|
140
|
+
return cardAddress?.getString("line3")
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return null
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
internal val ReadableMap.cardAddressPostCode: String?
|
|
147
|
+
get() {
|
|
148
|
+
if (cardAddress.hasKey("postCode")) {
|
|
149
|
+
return cardAddress?.getString("postCode")
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return null
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
internal val ReadableMap.cardAddressTown: String?
|
|
156
|
+
get() {
|
|
157
|
+
if (cardAddress.hasKey("town")) {
|
|
158
|
+
return cardAddress?.getString("town")
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return null
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
internal val ReadableMap.cardAddressCountryCode: Int?
|
|
165
|
+
get() {
|
|
166
|
+
if (cardAddress.hasKey("countryCode")) {
|
|
167
|
+
return cardAddress?.getString("countryCode")?.toInt()
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return null
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
internal val ReadableMap.cardAddressBillingCountry: String?
|
|
174
|
+
get() {
|
|
175
|
+
if (cardAddress.hasKey("billingCountry")) {
|
|
176
|
+
return cardAddress?.getString("billingCountry")
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return null
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
internal val ReadableMap.networkConnectTimeout: Long?
|
|
183
|
+
get() = networkTimeout?.getDouble("connectTimeout")?.toLong()
|
|
184
|
+
|
|
185
|
+
internal val ReadableMap.networkReadTimeout: Long?
|
|
186
|
+
get() = networkTimeout?.getDouble("readTimeout")?.toLong()
|
|
187
|
+
|
|
188
|
+
internal val ReadableMap.networkWriteTimeout: Long?
|
|
189
|
+
get() = networkTimeout?.getDouble("writeTimeout")?.toLong()
|
|
190
|
+
|
|
191
|
+
internal val ReadableMap.challengeRequestIndicator: String?
|
|
192
|
+
get() {
|
|
193
|
+
if (configuration.hasKey("challengeRequestIndicator")) {
|
|
194
|
+
return configuration?.getString("challengeRequestIndicator")
|
|
195
|
+
}
|
|
196
|
+
return null
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
internal val ReadableMap.scaExemption: String?
|
|
200
|
+
get() {
|
|
201
|
+
if (configuration.hasKey("scaExemption")) {
|
|
202
|
+
return configuration?.getString("scaExemption")
|
|
203
|
+
}
|
|
204
|
+
return null
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
internal val ReadableMap.mobileNumber: String?
|
|
208
|
+
get() {
|
|
209
|
+
if (configuration.hasKey("mobileNumber")) {
|
|
210
|
+
return configuration?.getString("mobileNumber")
|
|
211
|
+
}
|
|
212
|
+
return null
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
internal val ReadableMap.phoneCountryCode: String?
|
|
216
|
+
get() {
|
|
217
|
+
if (configuration.hasKey("phoneCountryCode")) {
|
|
218
|
+
return configuration?.getString("phoneCountryCode")
|
|
219
|
+
}
|
|
220
|
+
return null
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
internal val ReadableMap.emailAddress: String?
|
|
224
|
+
get() {
|
|
225
|
+
if (configuration.hasKey("emailAddress")) {
|
|
226
|
+
return configuration?.getString("emailAddress")
|
|
227
|
+
}
|
|
228
|
+
return null
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
internal val ReadableMap.threeDSTwoMaxTimeout: Int?
|
|
232
|
+
get() {
|
|
233
|
+
if (configuration.hasKey("threeDSTwoMaxTimeout")) {
|
|
234
|
+
return configuration?.getString("threeDSTwoMaxTimeout")?.toInt()
|
|
235
|
+
}
|
|
236
|
+
return null
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
internal val ReadableMap.threeDSTwoMessageVersion: String?
|
|
240
|
+
get() {
|
|
241
|
+
if (configuration.hasKey("threeDSTwoMessageVersion")) {
|
|
242
|
+
return configuration?.getString("threeDSTwoMessageVersion")
|
|
243
|
+
}
|
|
244
|
+
return null
|
|
245
|
+
}
|
|
246
|
+
|
|
67
247
|
internal val ReadableMap.metadata: ReadableMap?
|
|
68
248
|
get() {
|
|
69
|
-
|
|
70
|
-
if (hasKey) {
|
|
249
|
+
if (reference.hasKey("metadata")) {
|
|
71
250
|
return reference?.getMap("metadata")
|
|
72
251
|
}
|
|
73
252
|
return null
|
|
@@ -75,8 +254,7 @@ internal val ReadableMap.metadata: ReadableMap?
|
|
|
75
254
|
|
|
76
255
|
internal val ReadableMap.cardNetworkValue: Int?
|
|
77
256
|
get() {
|
|
78
|
-
|
|
79
|
-
if (hasKey) {
|
|
257
|
+
if (configuration.hasKey("supportedCardNetworks")) {
|
|
80
258
|
return configuration?.getInt("supportedCardNetworks")
|
|
81
259
|
}
|
|
82
260
|
return null
|
|
@@ -84,8 +262,7 @@ internal val ReadableMap.cardNetworkValue: Int?
|
|
|
84
262
|
|
|
85
263
|
internal val ReadableMap.paymentMethodValue: Int?
|
|
86
264
|
get() {
|
|
87
|
-
|
|
88
|
-
if (hasKey) {
|
|
265
|
+
if (configuration.hasKey("paymentMethods")) {
|
|
89
266
|
return configuration?.getInt("paymentMethods")
|
|
90
267
|
}
|
|
91
268
|
return null
|
|
@@ -93,8 +270,7 @@ internal val ReadableMap.paymentMethodValue: Int?
|
|
|
93
270
|
|
|
94
271
|
internal val ReadableMap.uiConfiguration: ReadableMap?
|
|
95
272
|
get() {
|
|
96
|
-
|
|
97
|
-
if (hasKey) {
|
|
273
|
+
if (configuration.hasKey("uiConfiguration")) {
|
|
98
274
|
return configuration?.getMap("uiConfiguration")
|
|
99
275
|
}
|
|
100
276
|
return null
|
|
@@ -112,10 +288,17 @@ internal val ReadableMap.shouldPaymentButtonDisplayAmount: Boolean?
|
|
|
112
288
|
internal val ReadableMap.shouldPaymentMethodsVerifySecurityCode: Boolean?
|
|
113
289
|
get() = uiConfiguration?.getBoolean("shouldPaymentMethodsVerifySecurityCode")
|
|
114
290
|
|
|
291
|
+
internal val ReadableMap.shouldAskForBillingInformation: Boolean
|
|
292
|
+
get() {
|
|
293
|
+
if (uiConfiguration.hasKey("shouldAskForBillingInformation")) {
|
|
294
|
+
return uiConfiguration?.getBoolean("shouldAskForBillingInformation") ?: true
|
|
295
|
+
}
|
|
296
|
+
return true
|
|
297
|
+
}
|
|
298
|
+
|
|
115
299
|
internal val ReadableMap.primaryAccountDetails: ReadableMap?
|
|
116
300
|
get() {
|
|
117
|
-
|
|
118
|
-
if (hasKey) {
|
|
301
|
+
if (configuration.hasKey("primaryAccountDetails")) {
|
|
119
302
|
return configuration?.getMap("primaryAccountDetails")
|
|
120
303
|
}
|
|
121
304
|
return null
|
|
@@ -123,8 +306,7 @@ internal val ReadableMap.primaryAccountDetails: ReadableMap?
|
|
|
123
306
|
|
|
124
307
|
internal val ReadableMap.name: String?
|
|
125
308
|
get() {
|
|
126
|
-
|
|
127
|
-
if (hasKey) {
|
|
309
|
+
if (primaryAccountDetails.hasKey("name")) {
|
|
128
310
|
return primaryAccountDetails?.getString("name")
|
|
129
311
|
}
|
|
130
312
|
return null
|
|
@@ -132,8 +314,7 @@ internal val ReadableMap.name: String?
|
|
|
132
314
|
|
|
133
315
|
internal val ReadableMap.accountNumber: String?
|
|
134
316
|
get() {
|
|
135
|
-
|
|
136
|
-
if (hasKey) {
|
|
317
|
+
if (primaryAccountDetails.hasKey("accountNumber")) {
|
|
137
318
|
return primaryAccountDetails?.getString("accountNumber")
|
|
138
319
|
}
|
|
139
320
|
return null
|
|
@@ -141,8 +322,7 @@ internal val ReadableMap.accountNumber: String?
|
|
|
141
322
|
|
|
142
323
|
internal val ReadableMap.dateOfBirth: String?
|
|
143
324
|
get() {
|
|
144
|
-
|
|
145
|
-
if (hasKey) {
|
|
325
|
+
if (primaryAccountDetails.hasKey("dateOfBirth")) {
|
|
146
326
|
return primaryAccountDetails?.getString("dateOfBirth")
|
|
147
327
|
}
|
|
148
328
|
return null
|
|
@@ -150,8 +330,7 @@ internal val ReadableMap.dateOfBirth: String?
|
|
|
150
330
|
|
|
151
331
|
internal val ReadableMap.postCode: String?
|
|
152
332
|
get() {
|
|
153
|
-
|
|
154
|
-
if (hasKey) {
|
|
333
|
+
if (primaryAccountDetails.hasKey("postCode")) {
|
|
155
334
|
return primaryAccountDetails?.getString("postCode")
|
|
156
335
|
}
|
|
157
336
|
return null
|
|
@@ -159,8 +338,7 @@ internal val ReadableMap.postCode: String?
|
|
|
159
338
|
|
|
160
339
|
internal val ReadableMap.googlePayConfiguration: ReadableMap?
|
|
161
340
|
get() {
|
|
162
|
-
|
|
163
|
-
if (hasKey) {
|
|
341
|
+
if (configuration.hasKey("googlePayConfiguration")) {
|
|
164
342
|
return configuration?.getMap("googlePayConfiguration")
|
|
165
343
|
}
|
|
166
344
|
return null
|
|
@@ -183,8 +361,7 @@ internal val ReadableMap.isShippingAddressRequired: Boolean?
|
|
|
183
361
|
|
|
184
362
|
internal val ReadableMap.billingAddressParameters: ReadableMap?
|
|
185
363
|
get() {
|
|
186
|
-
|
|
187
|
-
if (hasKey) {
|
|
364
|
+
if (googlePayConfiguration.hasKey("billingAddressParameters")) {
|
|
188
365
|
return googlePayConfiguration?.getMap("billingAddressParameters")
|
|
189
366
|
}
|
|
190
367
|
return null
|
|
@@ -192,8 +369,7 @@ internal val ReadableMap.billingAddressParameters: ReadableMap?
|
|
|
192
369
|
|
|
193
370
|
internal val ReadableMap.shippingAddressParameters: ReadableMap?
|
|
194
371
|
get() {
|
|
195
|
-
|
|
196
|
-
if (hasKey) {
|
|
372
|
+
if (googlePayConfiguration.hasKey("shippingAddressParameters")) {
|
|
197
373
|
return googlePayConfiguration?.getMap("shippingAddressParameters")
|
|
198
374
|
}
|
|
199
375
|
return null
|
|
@@ -210,8 +386,7 @@ internal val ReadableMap.isShippingPhoneNumberRequired: Boolean?
|
|
|
210
386
|
|
|
211
387
|
internal val ReadableMap.allowedCountryCodeList: ReadableArray?
|
|
212
388
|
get() {
|
|
213
|
-
|
|
214
|
-
if (hasKey) {
|
|
389
|
+
if (shippingAddressParameters.hasKey("allowedCountryCodes")) {
|
|
215
390
|
return shippingAddressParameters?.getArray("allowedCountryCodes")
|
|
216
391
|
}
|
|
217
392
|
return null
|
|
@@ -219,17 +394,16 @@ internal val ReadableMap.allowedCountryCodeList: ReadableArray?
|
|
|
219
394
|
|
|
220
395
|
internal val ReadableMap.pbbaConfiguration: ReadableMap?
|
|
221
396
|
get() {
|
|
222
|
-
|
|
223
|
-
if (hasKey) {
|
|
397
|
+
if (configuration.hasKey("pbbaConfiguration")) {
|
|
224
398
|
return configuration?.getMap("pbbaConfiguration")
|
|
225
399
|
}
|
|
226
400
|
return null
|
|
227
401
|
}
|
|
228
402
|
|
|
229
|
-
internal val ReadableMap.
|
|
403
|
+
internal val ReadableMap.pbbaMobileNumber: String?
|
|
230
404
|
get() = pbbaConfiguration?.getString("mobileNumber")
|
|
231
405
|
|
|
232
|
-
internal val ReadableMap.
|
|
406
|
+
internal val ReadableMap.pbbaEmailAddress: String?
|
|
233
407
|
get() = pbbaConfiguration?.getString("emailAddress")
|
|
234
408
|
|
|
235
409
|
internal val ReadableMap.deeplinkScheme: String?
|
|
@@ -237,8 +411,7 @@ internal val ReadableMap.deeplinkScheme: String?
|
|
|
237
411
|
|
|
238
412
|
internal val ReadableMap.deeplinkURL: String?
|
|
239
413
|
get() {
|
|
240
|
-
|
|
241
|
-
return if (hasKey) {
|
|
414
|
+
return if (pbbaConfiguration.hasKey("deeplinkURL")) {
|
|
242
415
|
pbbaConfiguration?.getString("deeplinkURL")
|
|
243
416
|
} else {
|
|
244
417
|
null
|
|
@@ -246,5 +419,5 @@ internal val ReadableMap.deeplinkURL: String?
|
|
|
246
419
|
}
|
|
247
420
|
|
|
248
421
|
fun Judo.toJudoActivityIntent(packageContext: Context): Intent =
|
|
249
|
-
|
|
250
|
-
|
|
422
|
+
Intent(packageContext, JudoActivity::class.java)
|
|
423
|
+
.also { it.putExtra(JUDO_OPTIONS, this) }
|