judokit-react-native 4.0.0 → 4.1.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/JudoPay.tsx CHANGED
@@ -1,5 +1,6 @@
1
1
  import { NativeModules } from 'react-native'
2
2
  import JudoPBBAButton from './components/JudoPBBAButton'
3
+ import { version as packageVersion } from './package.json'
3
4
 
4
5
  import {
5
6
  JudoConfiguration,
@@ -142,10 +143,10 @@ class JudoPay {
142
143
  type: JudoTransactionType,
143
144
  configuration: JudoConfiguration
144
145
  ): Promise<JudoResponse> {
145
- const params = this.generateTransactionTypeParameters(
146
- type,
147
- configuration
148
- )
146
+ const params = {
147
+ ...this.generateTransactionTypeParameters(type, configuration),
148
+ packageVersion
149
+ }
149
150
  return NativeModules.RNJudo.invokeTransaction(params)
150
151
  }
151
152
 
@@ -155,7 +156,8 @@ class JudoPay {
155
156
  const params = {
156
157
  authorization: this.generateAuthorizationParameters(),
157
158
  sandboxed: this.isSandboxed,
158
- receiptId
159
+ receiptId,
160
+ packageVersion
159
161
  }
160
162
 
161
163
  return NativeModules.RNJudo.fetchTransactionDetails(params)
@@ -188,7 +190,8 @@ class JudoPay {
188
190
  securityCode,
189
191
  cardholderName,
190
192
  cardScheme
191
- }
193
+ },
194
+ packageVersion
192
195
  }
193
196
  return NativeModules.RNJudo.performTokenTransaction(params)
194
197
  }
@@ -207,10 +210,10 @@ class JudoPay {
207
210
  mode: JudoTransactionMode,
208
211
  configuration: JudoConfiguration
209
212
  ): Promise<JudoResponse> {
210
- const params = this.generateTransactionModeParameters(
211
- mode,
212
- configuration
213
- )
213
+ const params = {
214
+ ...this.generateTransactionModeParameters(mode, configuration),
215
+ packageVersion
216
+ }
214
217
  return NativeModules.RNJudo.invokeApplePay(params)
215
218
  }
216
219
 
@@ -228,10 +231,10 @@ class JudoPay {
228
231
  mode: JudoTransactionMode,
229
232
  configuration: JudoConfiguration
230
233
  ): Promise<JudoResponse> {
231
- const params = this.generateTransactionModeParameters(
232
- mode,
233
- configuration
234
- )
234
+ const params = {
235
+ ...this.generateTransactionModeParameters(mode, configuration),
236
+ packageVersion
237
+ }
235
238
  return NativeModules.RNJudo.invokeGooglePay(params)
236
239
  }
237
240
 
@@ -245,7 +248,10 @@ class JudoPay {
245
248
  public async invokePayByBankApp(
246
249
  configuration: JudoConfiguration
247
250
  ): Promise<JudoResponse> {
248
- const params = this.generateJudoParameters(configuration)
251
+ const params = {
252
+ ...this.generateJudoParameters(configuration),
253
+ packageVersion
254
+ }
249
255
  return NativeModules.RNJudo.invokePayByBankApp(params)
250
256
  }
251
257
 
@@ -262,10 +268,10 @@ class JudoPay {
262
268
  mode: JudoTransactionMode,
263
269
  configuration: JudoConfiguration
264
270
  ): Promise<JudoResponse> {
265
- const params = this.generateTransactionModeParameters(
266
- mode,
267
- configuration
268
- )
271
+ const params = {
272
+ ...this.generateTransactionModeParameters(mode, configuration),
273
+ packageVersion
274
+ }
269
275
  return NativeModules.RNJudo.invokePaymentMethodScreen(params)
270
276
  }
271
277
 
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.11"
18
+ s.dependency "JudoKit-iOS", "3.2.4"
19
19
 
20
20
  s.test_spec 'RNJudoTests' do |test_spec|
21
21
  test_spec.source_files = 'ios/RNJudoTests/**/*.{h,m}'
@@ -153,7 +153,7 @@ dependencies {
153
153
  implementation 'androidx.core:core-ktx:1.9.0'
154
154
  implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
155
155
 
156
- implementation 'com.judopay:judokit-android:4.0.1'
156
+ implementation 'com.judopay:judokit-android:4.1.1'
157
157
 
158
158
  //JUnit 5
159
159
  testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5_version"
@@ -13,43 +13,67 @@ const val CARD_SCHEME_VISA = "visa"
13
13
  const val CARD_SCHEME_MASTERCARD = "mastercard"
14
14
  const val CARD_SCHEME_AMEX = "amex"
15
15
 
16
- internal fun ReadableMap?.hasKey(key: String): Boolean {
17
- if (this != null) {
18
- return this.hasKey(key)
19
- }
20
- return false
16
+ internal fun ReadableMap?.hasKey(key: String): Boolean = this?.hasKey(key) ?: false
17
+
18
+ internal fun ReadableMap?.getOptionalString(key: String): String? = if (hasKey(key)) {
19
+ this?.getString(key)
20
+ } else {
21
+ null
22
+ }
23
+
24
+ internal fun ReadableMap?.getOptionalBoolean(key: String): Boolean? = if (hasKey(key)) {
25
+ this?.getBoolean(key)
26
+ } else {
27
+ null
28
+ }
29
+
30
+ internal fun ReadableMap?.getOptionalInt(key: String): Int? = if (hasKey(key)) {
31
+ this?.getInt(key)
32
+ } else {
33
+ null
34
+ }
35
+
36
+ internal fun ReadableMap?.getOptionalDouble(key: String): Double? = if (hasKey(key)) {
37
+ this?.getDouble(key)
38
+ } else {
39
+ null
40
+ }
41
+
42
+ internal fun ReadableMap?.getOptionalMap(key: String): ReadableMap? = if (hasKey(key)) {
43
+ this?.getMap(key)
44
+ } else {
45
+ null
46
+ }
47
+
48
+ internal fun ReadableMap?.getOptionalArray(key: String): ReadableArray? = if (hasKey(key)) {
49
+ this?.getArray(key)
50
+ } else {
51
+ null
21
52
  }
22
53
 
23
54
  internal val ReadableMap.configuration: ReadableMap?
24
- get() = getMap("configuration")
55
+ get() = getOptionalMap("configuration")
25
56
 
26
57
  internal val ReadableMap.transactionMode: Int?
27
- get() = getInt("transactionMode")
58
+ get() = getOptionalInt("transactionMode")
28
59
 
29
60
  internal val ReadableMap.authorization: ReadableMap?
30
- get() = getMap("authorization")
61
+ get() = getOptionalMap("authorization")
31
62
 
32
63
  internal val ReadableMap.isSandboxed: Boolean?
33
- get() = getBoolean("sandboxed")
64
+ get() = getOptionalBoolean("sandboxed")
65
+
66
+ internal val ReadableMap.packageVersion: String?
67
+ get() = getOptionalString("packageVersion")
34
68
 
35
69
  internal val ReadableMap.cardToken: String?
36
- get() = getString("cardToken")
70
+ get() = getOptionalString("cardToken")
37
71
 
38
72
  internal val ReadableMap.securityCode: String?
39
- get() {
40
- if (hasKey("securityCode")) {
41
- return getString("securityCode")
42
- }
43
- return null
44
- }
73
+ get() = getOptionalString("securityCode")
45
74
 
46
75
  internal val ReadableMap.cardholderName: String?
47
- get() {
48
- if (hasKey("cardholderName")) {
49
- return getString("cardholderName")
50
- }
51
- return null
52
- }
76
+ get() = getOptionalString("cardholderName")
53
77
 
54
78
  internal val ReadableMap.cardType: CardNetwork
55
79
  get() {
@@ -60,7 +84,7 @@ internal val ReadableMap.cardType: CardNetwork
60
84
  }
61
85
 
62
86
  return when {
63
- cardScheme.contains(CARD_SCHEME_VISA) -> CardNetwork.VISA
87
+ cardScheme.contains(CARD_SCHEME_VISA) -> CardNetwork.VISA
64
88
  cardScheme.contains(CARD_SCHEME_MASTERCARD) -> CardNetwork.MASTERCARD
65
89
  cardScheme.contains(CARD_SCHEME_AMEX) -> CardNetwork.AMEX
66
90
  else -> CardNetwork.OTHER
@@ -68,537 +92,280 @@ internal val ReadableMap.cardType: CardNetwork
68
92
  }
69
93
 
70
94
  internal val ReadableMap.judoId: String?
71
- get() = configuration?.getString("judoId")
95
+ get() = configuration?.getOptionalString("judoId")
72
96
 
73
97
  internal val ReadableMap.receiptId: String?
74
- get() = getString("receiptId")
98
+ get() = getOptionalString("receiptId")
75
99
 
76
100
  internal val ReadableMap.token: String?
77
- get() = authorization?.getString("token")
101
+ get() = authorization?.getOptionalString("token")
78
102
 
79
103
  internal val ReadableMap.secret: String?
80
- get() = authorization?.getString("secret")
104
+ get() = authorization?.getOptionalString("secret")
81
105
 
82
106
  internal val ReadableMap.paymentSession: String?
83
- get() = authorization?.getString("paymentSession")
107
+ get() = authorization?.getOptionalString("paymentSession")
84
108
 
85
109
  internal val ReadableMap.amount: ReadableMap?
86
- get() = configuration?.getMap("amount")
110
+ get() = configuration?.getOptionalMap("amount")
87
111
 
88
112
  internal val ReadableMap.amountValue: String?
89
- get() = amount?.getString("value")
113
+ get() = amount?.getOptionalString("value")
90
114
 
91
115
  internal val ReadableMap.currencyValue: String?
92
- get() = amount?.getString("currency")
116
+ get() = amount?.getOptionalString("currency")
93
117
 
94
118
  internal val ReadableMap.reference: ReadableMap?
95
- get() = configuration?.getMap("reference")
119
+ get() = configuration?.getOptionalMap("reference")
96
120
 
97
121
  internal val ReadableMap.consumerReference: String?
98
- get() = reference?.getString("consumerReference")
122
+ get() = reference?.getOptionalString("consumerReference")
99
123
 
100
124
  internal val ReadableMap.paymentReference: String?
101
- get() = reference?.getString("paymentReference")
125
+ get() = reference?.getOptionalString("paymentReference")
102
126
 
103
127
  internal val ReadableMap.isInitialRecurringPayment: Boolean?
104
- get() = configuration?.getBoolean("isInitialRecurringPayment")
128
+ get() = configuration?.getOptionalBoolean("isInitialRecurringPayment")
105
129
 
106
130
  internal val ReadableMap.isDelayedAuthorisation: Boolean?
107
- get() = configuration?.getBoolean("isDelayedAuthorisation")
131
+ get() = configuration?.getOptionalBoolean("isDelayedAuthorisation")
108
132
 
109
133
  internal val ReadableMap.networkTimeout: ReadableMap?
110
- get() {
111
- if (configuration.hasKey("networkTimeout")) {
112
- return configuration?.getMap("networkTimeout")
113
- }
114
- return null
115
- }
134
+ get() = configuration?.getOptionalMap("networkTimeout")
116
135
 
117
136
  internal val ReadableMap.cardAddress: ReadableMap?
118
- get() {
119
- if (configuration.hasKey("cardAddress")) {
120
- return configuration?.getMap("cardAddress")
121
- }
122
- return null
123
- }
137
+ get() = configuration?.getOptionalMap("cardAddress")
124
138
 
125
139
  internal val ReadableMap.cardAddressLine1: String?
126
- get() {
127
- if (cardAddress.hasKey("line1")) {
128
- return cardAddress?.getString("line1")
129
- }
130
-
131
- return null
132
- }
140
+ get() = cardAddress?.getOptionalString("line1")
133
141
 
134
142
  internal val ReadableMap.cardAddressLine2: String?
135
- get() {
136
- if (cardAddress.hasKey("line2")) {
137
- return cardAddress?.getString("line2")
138
- }
139
-
140
- return null
141
- }
143
+ get() = cardAddress?.getOptionalString("line2")
142
144
 
143
145
  internal val ReadableMap.cardAddressLine3: String?
144
- get() {
145
- if (cardAddress.hasKey("line3")) {
146
- return cardAddress?.getString("line3")
147
- }
148
-
149
- return null
150
- }
146
+ get() = cardAddress?.getOptionalString("line3")
151
147
 
152
148
  internal val ReadableMap.cardAddressPostCode: String?
153
- get() {
154
- if (cardAddress.hasKey("postCode")) {
155
- return cardAddress?.getString("postCode")
156
- }
157
-
158
- return null
159
- }
149
+ get() = cardAddress?.getOptionalString("postCode")
160
150
 
161
151
  internal val ReadableMap.cardAddressTown: String?
162
- get() {
163
- if (cardAddress.hasKey("town")) {
164
- return cardAddress?.getString("town")
165
- }
166
-
167
- return null
168
- }
152
+ get() = cardAddress?.getOptionalString("town")
169
153
 
170
154
  internal val ReadableMap.cardAddressCountryCode: Int?
171
- get() {
172
- if (cardAddress.hasKey("countryCode")) {
173
- return cardAddress?.getInt("countryCode")
174
- }
175
-
176
- return null
177
- }
155
+ get() = cardAddress?.getOptionalInt("countryCode")
178
156
 
179
157
  internal val ReadableMap.cardAddressState: String?
180
- get() {
181
- if (cardAddress.hasKey("state")) {
182
- return cardAddress?.getString("state")
183
- }
184
-
185
- return null
186
- }
158
+ get() = cardAddress?.getOptionalString("state")
187
159
 
188
160
  internal val ReadableMap.networkConnectTimeout: Long?
189
- get() = networkTimeout?.getDouble("connectTimeout")?.toLong()
161
+ get() = networkTimeout?.getOptionalDouble("connectTimeout")?.toLong()
190
162
 
191
163
  internal val ReadableMap.networkReadTimeout: Long?
192
- get() = networkTimeout?.getDouble("readTimeout")?.toLong()
164
+ get() = networkTimeout?.getOptionalDouble("readTimeout")?.toLong()
193
165
 
194
166
  internal val ReadableMap.networkWriteTimeout: Long?
195
- get() = networkTimeout?.getDouble("writeTimeout")?.toLong()
167
+ get() = networkTimeout?.getOptionalDouble("writeTimeout")?.toLong()
196
168
 
197
169
  internal val ReadableMap.challengeRequestIndicator: String?
198
- get() {
199
- if (configuration.hasKey("challengeRequestIndicator")) {
200
- return configuration?.getString("challengeRequestIndicator")
201
- }
202
- return null
203
- }
170
+ get() = configuration?.getOptionalString("challengeRequestIndicator")
204
171
 
205
172
  internal val ReadableMap.scaExemption: String?
206
- get() {
207
- if (configuration.hasKey("scaExemption")) {
208
- return configuration?.getString("scaExemption")
209
- }
210
- return null
211
- }
173
+ get() = configuration?.getOptionalString("scaExemption")
212
174
 
213
175
  internal val ReadableMap.mobileNumber: String?
214
- get() {
215
- if (configuration.hasKey("mobileNumber")) {
216
- return configuration?.getString("mobileNumber")
217
- }
218
- return null
219
- }
176
+ get() = configuration?.getOptionalString("mobileNumber")
220
177
 
221
178
  internal val ReadableMap.phoneCountryCode: String?
222
- get() {
223
- if (configuration.hasKey("phoneCountryCode")) {
224
- return configuration?.getString("phoneCountryCode")
225
- }
226
- return null
227
- }
179
+ get() = configuration?.getOptionalString("phoneCountryCode")
228
180
 
229
181
  internal val ReadableMap.emailAddress: String?
230
- get() {
231
- if (configuration.hasKey("emailAddress")) {
232
- return configuration?.getString("emailAddress")
233
- }
234
- return null
235
- }
182
+ get() = configuration?.getOptionalString("emailAddress")
236
183
 
237
184
  internal val ReadableMap.threeDSTwoMaxTimeout: Int?
238
- get() {
239
- if (configuration.hasKey("threeDSTwoMaxTimeout")) {
240
- return configuration?.getInt("threeDSTwoMaxTimeout")
241
- }
242
- return null
243
- }
185
+ get() = configuration?.getOptionalInt("threeDSTwoMaxTimeout")
244
186
 
245
187
  internal val ReadableMap.threeDSTwoMessageVersion: String?
246
- get() {
247
- if (configuration.hasKey("threeDSTwoMessageVersion")) {
248
- return configuration?.getString("threeDSTwoMessageVersion")
249
- }
250
- return null
251
- }
188
+ get() = configuration?.getOptionalString("threeDSTwoMessageVersion")
252
189
 
253
190
  internal val ReadableMap.metadata: ReadableMap?
254
- get() {
255
- if (reference.hasKey("metadata")) {
256
- return reference?.getMap("metadata")
257
- }
258
- return null
259
- }
191
+ get() = reference?.getOptionalMap("metadata")
260
192
 
261
193
  internal val ReadableMap.cardNetworkValue: Int?
262
- get() {
263
- if (configuration.hasKey("supportedCardNetworks")) {
264
- return configuration?.getInt("supportedCardNetworks")
265
- }
266
- return null
267
- }
194
+ get() = configuration?.getOptionalInt("supportedCardNetworks")
268
195
 
269
196
  internal val ReadableMap.paymentMethodValue: Int?
270
- get() {
271
- if (configuration.hasKey("paymentMethods")) {
272
- return configuration?.getInt("paymentMethods")
273
- }
274
- return null
275
- }
197
+ get() = configuration?.getOptionalInt("paymentMethods")
276
198
 
277
199
  internal val ReadableMap.uiConfiguration: ReadableMap?
278
- get() {
279
- if (configuration.hasKey("uiConfiguration")) {
280
- return configuration?.getMap("uiConfiguration")
281
- }
282
- return null
283
- }
200
+ get() = configuration?.getOptionalMap("uiConfiguration")
284
201
 
285
202
  internal val ReadableMap.threeDSUIConfiguration: ReadableMap?
286
- get() {
287
- if (uiConfiguration.hasKey("threeDSUIConfiguration")) {
288
- return uiConfiguration?.getMap("threeDSUIConfiguration")
289
- }
290
- return null
291
- }
203
+ get() = uiConfiguration?.getOptionalMap("threeDSUIConfiguration")
292
204
 
293
205
  internal val ReadableMap.threeDSUITextBoxCustomization: ReadableMap?
294
- get() {
295
- if (threeDSUIConfiguration.hasKey("textBoxCustomization")) {
296
- return threeDSUIConfiguration?.getMap("textBoxCustomization")
297
- }
298
- return null
299
- }
206
+ get() = threeDSUIConfiguration?.getOptionalMap("textBoxCustomization")
300
207
 
301
208
  internal val ReadableMap.threeDSUIButtonCustomizations: ReadableMap?
302
- get() {
303
- if (threeDSUIConfiguration.hasKey("buttonCustomizations")) {
304
- return threeDSUIConfiguration?.getMap("buttonCustomizations")
305
- }
306
- return null
307
- }
209
+ get() = threeDSUIConfiguration?.getOptionalMap("buttonCustomizations")
308
210
 
309
211
  internal val ReadableMap.threeDSUISubmitButtonCustomization: ReadableMap?
310
- get() {
311
- if (threeDSUIButtonCustomizations.hasKey("SUBMIT")) {
312
- return threeDSUIButtonCustomizations?.getMap("SUBMIT")
313
- }
314
- return null
315
- }
212
+ get() = threeDSUIButtonCustomizations?.getOptionalMap("SUBMIT")
316
213
 
317
214
  internal val ReadableMap.threeDSUIContinueButtonCustomization: ReadableMap?
318
- get() {
319
- if (threeDSUIButtonCustomizations.hasKey("CONTINUE")) {
320
- return threeDSUIButtonCustomizations?.getMap("CONTINUE")
321
- }
322
- return null
323
- }
215
+ get() = threeDSUIButtonCustomizations?.getOptionalMap("CONTINUE")
324
216
 
325
217
  internal val ReadableMap.threeDSUINextButtonCustomization: ReadableMap?
326
- get() {
327
- if (threeDSUIButtonCustomizations.hasKey("NEXT")) {
328
- return threeDSUIButtonCustomizations?.getMap("NEXT")
329
- }
330
- return null
331
- }
218
+ get() = threeDSUIButtonCustomizations?.getOptionalMap("NEXT")
332
219
 
333
220
  internal val ReadableMap.threeDSUICancelButtonCustomization: ReadableMap?
334
- get() {
335
- if (threeDSUIButtonCustomizations.hasKey("CANCEL")) {
336
- return threeDSUIButtonCustomizations?.getMap("CANCEL")
337
- }
338
- return null
339
- }
221
+ get() = threeDSUIButtonCustomizations?.getOptionalMap("CANCEL")
340
222
 
341
223
  internal val ReadableMap.threeDSUIResendButtonCustomization: ReadableMap?
342
- get() {
343
- if (threeDSUIButtonCustomizations.hasKey("RESEND")) {
344
- return threeDSUIButtonCustomizations?.getMap("RESEND")
345
- }
346
- return null
347
- }
224
+ get() = threeDSUIButtonCustomizations?.getOptionalMap("RESEND")
348
225
 
349
226
  internal val ReadableMap.threeDSUIToolbarCustomization: ReadableMap?
350
- get() {
351
- if (threeDSUIConfiguration.hasKey("toolbarCustomization")) {
352
- return threeDSUIConfiguration?.getMap("toolbarCustomization")
353
- }
354
- return null
355
- }
227
+ get() = threeDSUIConfiguration?.getOptionalMap("toolbarCustomization")
356
228
 
357
229
  internal val ReadableMap.threeDSUILabelCustomization: ReadableMap?
358
- get() {
359
- if (threeDSUIConfiguration.hasKey("labelCustomization")) {
360
- return threeDSUIConfiguration?.getMap("labelCustomization")
361
- }
362
- return null
363
- }
230
+ get() = threeDSUIConfiguration?.getOptionalMap("labelCustomization")
364
231
 
365
232
  internal val ReadableMap.textFontName: String?
366
- get() {
367
- if (hasKey("textFontName")) {
368
- return getString("textFontName")
369
- }
370
- return null
371
- }
233
+ get() = getOptionalString("textFontName")
372
234
 
373
235
  internal val ReadableMap.textColor: String?
374
- get() {
375
- if (hasKey("textColor")) {
376
- return getString("textColor")
377
- }
378
- return null
379
- }
236
+ get() = getOptionalString("textColor")
380
237
 
381
238
  internal val ReadableMap.backgroundColor: String?
382
- get() {
383
- if (hasKey("backgroundColor")) {
384
- return getString("backgroundColor")
385
- }
386
- return null
387
- }
239
+ get() = getOptionalString("backgroundColor")
388
240
 
389
241
  internal val ReadableMap.headerText: String?
390
- get() {
391
- if (hasKey("headerText")) {
392
- return getString("headerText")
393
- }
394
- return null
395
- }
242
+ get() = getOptionalString("headerText")
396
243
 
397
244
  internal val ReadableMap.buttonText: String?
398
- get() {
399
- if (hasKey("buttonText")) {
400
- return getString("buttonText")
401
- }
402
- return null
403
- }
245
+ get() = getOptionalString("buttonText")
404
246
 
405
247
  internal val ReadableMap.headingTextFontName: String?
406
- get() {
407
- if (hasKey("headingTextFontName")) {
408
- return getString("headingTextFontName")
409
- }
410
- return null
411
- }
248
+ get() = getOptionalString("headingTextFontName")
412
249
 
413
250
  internal val ReadableMap.headingTextColor: String?
414
- get() {
415
- if (hasKey("headingTextColor")) {
416
- return getString("headingTextColor")
417
- }
418
- return null
419
- }
251
+ get() = getOptionalString("headingTextColor")
420
252
 
421
253
  internal val ReadableMap.borderColor: String?
422
- get() {
423
- if (hasKey("borderColor")) {
424
- return getString("borderColor")
425
- }
426
- return null
427
- }
254
+ get() = getOptionalString("borderColor")
428
255
 
429
256
  internal val ReadableMap.textFontSize: Int?
430
- get() {
431
- if (hasKey("textFontSize")) {
432
- return getInt("textFontSize")
433
- }
434
- return null
435
- }
257
+ get() = getOptionalInt("textFontSize")
436
258
 
437
259
  internal val ReadableMap.cornerRadius: Int?
438
- get() {
439
- if (hasKey("cornerRadius")) {
440
- return getInt("cornerRadius")
441
- }
442
- return null
443
- }
260
+ get() = getOptionalInt("cornerRadius")
444
261
 
445
262
  internal val ReadableMap.headingTextFontSize: Int?
446
- get() {
447
- if (hasKey("headingTextFontSize")) {
448
- return getInt("headingTextFontSize")
449
- }
450
- return null
451
- }
263
+ get() = getOptionalInt("headingTextFontSize")
452
264
 
453
265
  internal val ReadableMap.borderWidth: Int?
454
- get() {
455
- if (hasKey("borderWidth")) {
456
- return getInt("borderWidth")
457
- }
458
- return null
459
- }
266
+ get() = getOptionalInt("borderWidth")
460
267
 
461
268
  internal val ReadableMap.isAVSEnabled: Boolean?
462
- get() = uiConfiguration?.getBoolean("isAVSEnabled")
269
+ get() = uiConfiguration?.getOptionalBoolean("isAVSEnabled")
463
270
 
464
271
  internal val ReadableMap.shouldPaymentMethodsDisplayAmount: Boolean?
465
- get() = uiConfiguration?.getBoolean("shouldPaymentMethodsDisplayAmount")
272
+ get() = uiConfiguration?.getOptionalBoolean("shouldPaymentMethodsDisplayAmount")
466
273
 
467
274
  internal val ReadableMap.shouldPaymentButtonDisplayAmount: Boolean?
468
- get() = uiConfiguration?.getBoolean("shouldPaymentButtonDisplayAmount")
275
+ get() = uiConfiguration?.getOptionalBoolean("shouldPaymentButtonDisplayAmount")
469
276
 
470
277
  internal val ReadableMap.shouldPaymentMethodsVerifySecurityCode: Boolean?
471
- get() = uiConfiguration?.getBoolean("shouldPaymentMethodsVerifySecurityCode")
278
+ get() = uiConfiguration?.getOptionalBoolean("shouldPaymentMethodsVerifySecurityCode")
472
279
 
473
280
  internal val ReadableMap.shouldAskForBillingInformation: Boolean
474
- get() {
475
- if (uiConfiguration.hasKey("shouldAskForBillingInformation")) {
476
- return uiConfiguration?.getBoolean("shouldAskForBillingInformation") ?: true
477
- }
478
- return true
479
- }
281
+ get() = uiConfiguration?.getOptionalBoolean("shouldAskForBillingInformation") ?: true
480
282
 
481
283
  internal val ReadableMap.primaryAccountDetails: ReadableMap?
482
- get() {
483
- if (configuration.hasKey("primaryAccountDetails")) {
484
- return configuration?.getMap("primaryAccountDetails")
485
- }
486
- return null
487
- }
284
+ get() = configuration?.getOptionalMap("primaryAccountDetails")
488
285
 
489
286
  internal val ReadableMap.name: String?
490
- get() {
491
- if (primaryAccountDetails.hasKey("name")) {
492
- return primaryAccountDetails?.getString("name")
493
- }
494
- return null
495
- }
287
+ get() = primaryAccountDetails?.getOptionalString("name")
496
288
 
497
289
  internal val ReadableMap.accountNumber: String?
498
- get() {
499
- if (primaryAccountDetails.hasKey("accountNumber")) {
500
- return primaryAccountDetails?.getString("accountNumber")
501
- }
502
- return null
503
- }
290
+ get() = primaryAccountDetails?.getOptionalString("accountNumber")
504
291
 
505
292
  internal val ReadableMap.dateOfBirth: String?
506
- get() {
507
- if (primaryAccountDetails.hasKey("dateOfBirth")) {
508
- return primaryAccountDetails?.getString("dateOfBirth")
509
- }
510
- return null
511
- }
293
+ get() = primaryAccountDetails?.getOptionalString("dateOfBirth")
512
294
 
513
295
  internal val ReadableMap.postCode: String?
514
- get() {
515
- if (primaryAccountDetails.hasKey("postCode")) {
516
- return primaryAccountDetails?.getString("postCode")
517
- }
518
- return null
519
- }
296
+ get() = primaryAccountDetails?.getOptionalString("postCode")
520
297
 
521
298
  internal val ReadableMap.googlePayConfiguration: ReadableMap?
522
- get() {
523
- if (configuration.hasKey("googlePayConfiguration")) {
524
- return configuration?.getMap("googlePayConfiguration")
525
- }
526
- return null
527
- }
299
+ get() = configuration?.getOptionalMap("googlePayConfiguration")
528
300
 
529
301
  internal val ReadableMap.countryCode: String?
530
- get() = googlePayConfiguration?.getString("countryCode")
302
+ get() = googlePayConfiguration?.getOptionalString("countryCode")
531
303
 
532
304
  internal val ReadableMap.environmentValue: Int?
533
- get() = googlePayConfiguration?.getInt("environment")
305
+ get() = googlePayConfiguration?.getOptionalInt("environment")
306
+
307
+ internal val ReadableMap.merchantName: String?
308
+ get() = googlePayConfiguration?.getOptionalString("merchantName")
309
+
310
+ internal val ReadableMap.transactionId: String?
311
+ get() = googlePayConfiguration?.getOptionalString("transactionId")
312
+
313
+ internal val ReadableMap.totalPriceStatus: Int?
314
+ get() = googlePayConfiguration?.getOptionalInt("totalPriceStatus")
315
+
316
+ internal val ReadableMap.totalPriceLabel: String?
317
+ get() = googlePayConfiguration?.getOptionalString("totalPriceLabel")
318
+
319
+ internal val ReadableMap.checkoutOption: Int?
320
+ get() = googlePayConfiguration?.getOptionalInt("checkoutOption")
534
321
 
535
322
  internal val ReadableMap.isEmailRequired: Boolean?
536
- get() = googlePayConfiguration?.getBoolean("isEmailRequired")
323
+ get() = googlePayConfiguration?.getOptionalBoolean("isEmailRequired")
537
324
 
538
325
  internal val ReadableMap.isBillingAddressRequired: Boolean?
539
- get() = googlePayConfiguration?.getBoolean("isBillingAddressRequired")
326
+ get() = googlePayConfiguration?.getOptionalBoolean("isBillingAddressRequired")
540
327
 
541
328
  internal val ReadableMap.isShippingAddressRequired: Boolean?
542
- get() = googlePayConfiguration?.getBoolean("isShippingAddressRequired")
329
+ get() = googlePayConfiguration?.getOptionalBoolean("isShippingAddressRequired")
543
330
 
544
331
  internal val ReadableMap.billingAddressParameters: ReadableMap?
545
- get() {
546
- if (googlePayConfiguration.hasKey("billingAddressParameters")) {
547
- return googlePayConfiguration?.getMap("billingAddressParameters")
548
- }
549
- return null
550
- }
332
+ get() = googlePayConfiguration?.getOptionalMap("billingAddressParameters")
551
333
 
552
334
  internal val ReadableMap.shippingAddressParameters: ReadableMap?
553
- get() {
554
- if (googlePayConfiguration.hasKey("shippingAddressParameters")) {
555
- return googlePayConfiguration?.getMap("shippingAddressParameters")
556
- }
557
- return null
558
- }
335
+ get() = googlePayConfiguration?.getOptionalMap("shippingAddressParameters")
559
336
 
560
337
  internal val ReadableMap.isBillingPhoneNumberRequired: Boolean?
561
- get() = billingAddressParameters?.getBoolean("isPhoneNumberRequired")
338
+ get() = billingAddressParameters?.getOptionalBoolean("isPhoneNumberRequired")
562
339
 
563
340
  internal val ReadableMap.addressFormat: Int?
564
- get() = billingAddressParameters?.getInt("addressFormat")
341
+ get() = billingAddressParameters?.getOptionalInt("addressFormat")
565
342
 
566
343
  internal val ReadableMap.isShippingPhoneNumberRequired: Boolean?
567
- get() = shippingAddressParameters?.getBoolean("isPhoneNumberRequired")
344
+ get() = shippingAddressParameters?.getOptionalBoolean("isPhoneNumberRequired")
568
345
 
569
346
  internal val ReadableMap.allowedCountryCodeList: ReadableArray?
570
- get() {
571
- if (shippingAddressParameters.hasKey("allowedCountryCodes")) {
572
- return shippingAddressParameters?.getArray("allowedCountryCodes")
573
- }
574
- return null
575
- }
347
+ get() = shippingAddressParameters?.getOptionalArray("allowedCountryCodes")
348
+
349
+ internal val ReadableMap.allowPrepaidCards: Boolean?
350
+ get() = googlePayConfiguration?.getOptionalBoolean("allowPrepaidCards")
351
+
352
+ internal val ReadableMap.allowCreditCards: Boolean?
353
+ get() = googlePayConfiguration?.getOptionalBoolean("allowCreditCards")
576
354
 
577
355
  internal val ReadableMap.pbbaConfiguration: ReadableMap?
578
- get() {
579
- if (configuration.hasKey("pbbaConfiguration")) {
580
- return configuration?.getMap("pbbaConfiguration")
581
- }
582
- return null
583
- }
356
+ get() = configuration?.getOptionalMap("pbbaConfiguration")
584
357
 
585
358
  internal val ReadableMap.pbbaMobileNumber: String?
586
- get() = pbbaConfiguration?.getString("mobileNumber")
359
+ get() = pbbaConfiguration?.getOptionalString("mobileNumber")
587
360
 
588
361
  internal val ReadableMap.pbbaEmailAddress: String?
589
- get() = pbbaConfiguration?.getString("emailAddress")
362
+ get() = pbbaConfiguration?.getOptionalString("emailAddress")
590
363
 
591
364
  internal val ReadableMap.deeplinkScheme: String?
592
- get() = pbbaConfiguration?.getString("deeplinkScheme")
365
+ get() = pbbaConfiguration?.getOptionalString("deeplinkScheme")
593
366
 
594
367
  internal val ReadableMap.deeplinkURL: String?
595
- get() {
596
- return if (pbbaConfiguration.hasKey("deeplinkURL")) {
597
- pbbaConfiguration?.getString("deeplinkURL")
598
- } else {
599
- null
600
- }
601
- }
368
+ get() = pbbaConfiguration?.getOptionalString("deeplinkURL")
602
369
 
603
370
  fun Judo.toJudoActivityIntent(packageContext: Context): Intent =
604
371
  Intent(packageContext, JudoActivity::class.java)
@@ -16,10 +16,7 @@ import com.judopay.judokit.android.api.model.BasicAuthorization
16
16
  import com.judopay.judokit.android.api.model.PaymentSessionAuthorization
17
17
  import com.judopay.judokit.android.api.model.request.Address
18
18
  import com.judopay.judokit.android.model.*
19
- import com.judopay.judokit.android.model.googlepay.GooglePayAddressFormat
20
- import com.judopay.judokit.android.model.googlepay.GooglePayBillingAddressParameters
21
- import com.judopay.judokit.android.model.googlepay.GooglePayEnvironment
22
- import com.judopay.judokit.android.model.googlepay.GooglePayShippingAddressParameters
19
+ import com.judopay.judokit.android.model.googlepay.*
23
20
 
24
21
  // For consistency with:
25
22
  // https://github.com/Judopay/JudoKit-iOS/blob/master/Source/Models/Response/JPResponse.m#L36
@@ -157,6 +154,7 @@ internal fun getJudoConfigurationForApiService(options: ReadableMap): Judo {
157
154
  .setAuthorization(authorization)
158
155
  .setAmount(amount)
159
156
  .setReference(reference)
157
+ .setSubProductInfo(getSubProductInfo(options))
160
158
  .build()
161
159
  }
162
160
 
@@ -198,6 +196,7 @@ internal fun getJudoConfiguration(type: PaymentWidgetType, options: ReadableMap)
198
196
  .setThreeDSTwoMessageVersion(options.threeDSTwoMessageVersion)
199
197
  .setPhoneCountryCode(options.phoneCountryCode)
200
198
  .setAddress(address)
199
+ .setSubProductInfo(getSubProductInfo(options))
201
200
  .build()
202
201
  }
203
202
 
@@ -277,6 +276,11 @@ internal fun getAmount(options: ReadableMap): Amount {
277
276
  .build()
278
277
  }
279
278
 
279
+ internal fun getSubProductInfo(options: ReadableMap): SubProductInfo {
280
+ val version = options.packageVersion ?: ""
281
+ return SubProductInfo.ReactNative(version)
282
+ }
283
+
280
284
  internal fun getReference(options: ReadableMap): Reference? {
281
285
 
282
286
  var builder = Reference.Builder()
@@ -517,19 +521,38 @@ internal fun getGooglePayConfiguration(options: ReadableMap): GooglePayConfigura
517
521
  0 -> GooglePayEnvironment.TEST
518
522
  else -> GooglePayEnvironment.PRODUCTION
519
523
  }
524
+ val totalPriceStatus = when (options.totalPriceStatus) {
525
+ 0 -> GooglePayPriceStatus.FINAL
526
+ 1 -> GooglePayPriceStatus.ESTIMATED
527
+ 2 -> GooglePayPriceStatus.NOT_CURRENTLY_KNOWN
528
+ else -> null
529
+ }
530
+
531
+ val checkoutOption = when (options.checkoutOption) {
532
+ 0 -> GooglePayCheckoutOption.DEFAULT
533
+ 1 -> GooglePayCheckoutOption.COMPLETE_IMMEDIATE_PURCHASE
534
+ else -> null
535
+ }
520
536
 
521
537
  val billingParameters = getBillingParameters(options)
522
538
  val shippingParameters = getShippingParameters(options)
523
539
 
524
540
  return if (options.googlePayConfiguration != null) {
525
541
  GooglePayConfiguration.Builder()
526
- .setTransactionCountryCode(options.countryCode)
527
542
  .setEnvironment(environment)
543
+ .setMerchantName(options.merchantName)
544
+ .setTransactionCountryCode(options.countryCode)
545
+ .setTransactionId(options.transactionId)
546
+ .setTotalPriceStatus(totalPriceStatus)
547
+ .setTotalPriceLabel(options.totalPriceLabel)
548
+ .setCheckoutOption(checkoutOption)
528
549
  .setIsEmailRequired(options.isEmailRequired)
529
550
  .setIsBillingAddressRequired(options.isBillingAddressRequired)
530
551
  .setBillingAddressParameters(billingParameters)
531
552
  .setIsShippingAddressRequired(options.isShippingAddressRequired)
532
553
  .setShippingAddressParameters(shippingParameters)
554
+ .setAllowPrepaidCards(options.allowPrepaidCards)
555
+ .setAllowCreditCards(options.allowCreditCards)
533
556
  .build()
534
557
  } else {
535
558
  null
@@ -8,21 +8,13 @@ import androidx.fragment.app.FragmentActivity
8
8
  import androidx.localbroadcastmanager.content.LocalBroadcastManager
9
9
  import com.facebook.react.bridge.*
10
10
  import com.judopay.judokit.android.Judo
11
- import com.judopay.judokit.android.api.JudoApiService
12
- import com.judopay.judokit.android.api.error.toJudoError
13
11
  import com.judopay.judokit.android.api.factory.JudoApiServiceFactory
14
12
  import com.judopay.judokit.android.api.model.response.JudoApiCallResult
15
13
  import com.judopay.judokit.android.api.model.response.Receipt
16
- import com.judopay.judokit.android.api.model.response.toCardVerificationModel
17
- import com.judopay.judokit.android.api.model.response.toJudoPaymentResult
18
14
  import com.judopay.judokit.android.api.model.response.toJudoResult
19
15
  import com.judopay.judokit.android.model.*
20
16
  import com.judopay.judokit.android.service.CardTransactionManager
21
17
  import com.judopay.judokit.android.service.CardTransactionManagerResultListener
22
- import com.judopay.judokit.android.toTokenRequest
23
- import com.judopay.judokit.android.ui.cardverification.THREE_DS_ONE_DIALOG_FRAGMENT_TAG
24
- import com.judopay.judokit.android.ui.cardverification.ThreeDSOneCardVerificationDialogFragment
25
- import com.judopay.judokit.android.ui.cardverification.ThreeDSOneCompletionCallback
26
18
  import com.judopay.judokit.android.ui.common.BR_PBBA_RESULT
27
19
  import com.judopay.judokit.android.ui.common.PBBA_RESULT
28
20
  import com.judopay.judokit.android.ui.common.isBankingAppAvailable
@@ -112,7 +112,7 @@ RCT_REMAP_METHOD(performTokenTransaction,
112
112
 
113
113
  JPCardTransactionDetails *details = [[JPCardTransactionDetails new] initWithConfiguration:configuration];
114
114
  details.cardToken = [RNWrappers cardTokenFromProperties:properties];
115
- details.secureCode = [RNWrappers securityCodeFromProperties:properties];
115
+ details.securityCode = [RNWrappers securityCodeFromProperties:properties];
116
116
  details.cardholderName = [RNWrappers cardholderNameFromProperties:properties];
117
117
  details.cardType = [RNWrappers cardTypeFromProperties:properties];
118
118
 
@@ -44,6 +44,8 @@ static NSString *const kCardSchemeAMEX = @"amex";
44
44
  id<JPAuthorization> authorization = [RNWrappers authorizationFromProperties:properties];
45
45
  JudoKit *judoKit = [[JudoKit alloc] initWithAuthorization:authorization];
46
46
  judoKit.isSandboxed = [RNWrappers isSandboxedFromProperties:properties];
47
+ judoKit.subProductInfo = [RNWrappers subProductInfoFromProperties:properties];
48
+
47
49
  return judoKit;
48
50
  }
49
51
 
@@ -73,6 +75,11 @@ static NSString *const kCardSchemeAMEX = @"amex";
73
75
  return isSandboxed.boolValue;
74
76
  }
75
77
 
78
+ + (JPSubProductInfo *)subProductInfoFromProperties:(NSDictionary *)properties {
79
+ NSString *version = [properties optionalStringForKey:@"packageVersion"];;
80
+ return [[JPSubProductInfo alloc] initWithSubProductType:JPSubProductTypeReactNative andVersion:version];
81
+ }
82
+
76
83
  + (JPCardTransactionService *)cardTransactionServiceFromProperties:(NSDictionary *)properties {
77
84
  BOOL isSandboxed = [RNWrappers isSandboxedFromProperties:properties];
78
85
  id<JPAuthorization> authorization = [RNWrappers authorizationFromProperties:properties];
package/ios/Podfile CHANGED
@@ -24,7 +24,7 @@ target 'RNJudo' do
24
24
  )
25
25
 
26
26
  # Pods for RNJudo
27
- pod "JudoKit-iOS", "3.1.11"
27
+ pod "JudoKit-iOS", "3.2.4"
28
28
 
29
29
  target 'RNJudoTests' do
30
30
  inherit! :complete
package/ios/Podfile.lock CHANGED
@@ -76,7 +76,7 @@ PODS:
76
76
  - fmt (6.2.1)
77
77
  - glog (0.3.5)
78
78
  - Judo3DS2_iOS (1.1.3)
79
- - JudoKit-iOS (3.1.11):
79
+ - JudoKit-iOS (3.2.1):
80
80
  - DeviceDNA (~> 2.0.0)
81
81
  - Judo3DS2_iOS (~> 1.1.3)
82
82
  - TrustKit
@@ -359,7 +359,7 @@ PODS:
359
359
  - React-logger (= 0.69.7)
360
360
  - React-perflogger (= 0.69.7)
361
361
  - SocketRocket (0.6.0)
362
- - TrustKit (2.0.1)
362
+ - TrustKit (3.0.2)
363
363
  - Yoga (1.14.0)
364
364
  - YogaKit (1.18.1):
365
365
  - Yoga (~> 1.14)
@@ -392,7 +392,7 @@ DEPENDENCIES:
392
392
  - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.125.0)
393
393
  - FlipperKit/SKIOSNetworkPlugin (= 0.125.0)
394
394
  - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
395
- - JudoKit-iOS (= 3.1.11)
395
+ - JudoKit-iOS (= 3.2.1)
396
396
  - OpenSSL-Universal (= 1.1.1100)
397
397
  - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
398
398
  - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
@@ -532,7 +532,7 @@ SPEC CHECKSUMS:
532
532
  fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
533
533
  glog: 3d02b25ca00c2d456734d0bcff864cbc62f6ae1a
534
534
  Judo3DS2_iOS: b2396a1f0aa3e8d428fdd887c8b6eae5d3aa4f79
535
- JudoKit-iOS: 850a11112da024ee77be5f7a1ca61ef28cbd97d3
535
+ JudoKit-iOS: 6d12dc10d1d84fe020ecbfcca1ca986bf563f7e9
536
536
  libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
537
537
  OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
538
538
  RCT-Folly: b9d9fe1fc70114b751c076104e52f3b1b5e5a95a
@@ -562,11 +562,11 @@ SPEC CHECKSUMS:
562
562
  React-runtimeexecutor: 65cd2782a57e1d59a68aa5d504edf94278578e41
563
563
  ReactCommon: 1e783348b9aa73ae68236271df972ba898560a95
564
564
  SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
565
- TrustKit: dad4c3a08248c21fcb9a3b5be3c2e2b9d4f9b973
565
+ TrustKit: 55804401e9a95db0bbfff9a08373bfd91953071f
566
566
  Yoga: 0b84a956f7393ef1f37f3bb213c516184e4a689d
567
567
  YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
568
568
  ZappMerchantLib: b14bc5814840426d351190309250347ca9b0983d
569
569
 
570
- PODFILE CHECKSUM: d320f26e9bc98ca902072b017dbfb26b64342d48
570
+ PODFILE CHECKSUM: 5cbefa13df8faa29c30e02942d14115a357c82dc
571
571
 
572
- COCOAPODS: 1.11.3
572
+ COCOAPODS: 1.12.1
@@ -384,18 +384,12 @@
384
384
  );
385
385
  inputPaths = (
386
386
  "${PODS_ROOT}/Target Support Files/Pods-RNJudo-RNJudoTests/Pods-RNJudo-RNJudoTests-resources.sh",
387
- "${PODS_ROOT}/JudoKit-iOS/Resources/judokit-icons.bundle",
388
- "${PODS_ROOT}/JudoKit-iOS/Resources/judokit-resources.bundle",
389
- "${PODS_ROOT}/JudoKit-iOS/Resources/judokit-countries-list.json",
390
387
  "${PODS_CONFIGURATION_BUILD_DIR}/JudoKit-iOS/JudoKit_iOS.bundle",
391
388
  "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
392
389
  "${PODS_CONFIGURATION_BUILD_DIR}/ZappMerchantLib/ZappMerchantLibResources.bundle",
393
390
  );
394
391
  name = "[CP] Copy Pods Resources";
395
392
  outputPaths = (
396
- "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/judokit-icons.bundle",
397
- "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/judokit-resources.bundle",
398
- "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/judokit-countries-list.json",
399
393
  "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/JudoKit_iOS.bundle",
400
394
  "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
401
395
  "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ZappMerchantLibResources.bundle",
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": "4.0.0",
4
+ "version": "4.1.1",
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": {
@@ -4,7 +4,7 @@ export enum JudoGooglePayEnvironment {
4
4
  }
5
5
 
6
6
  export enum JudoAddressFormat {
7
- MINIMAL,
7
+ MIN,
8
8
  FULL
9
9
  }
10
10
 
@@ -18,12 +18,30 @@ export interface JudoShippingAddressParameters {
18
18
  isPhoneNumberRequired: boolean
19
19
  }
20
20
 
21
+ export enum JudoGooglePayPriceStatus {
22
+ FINAL,
23
+ ESTIMATED,
24
+ NOT_CURRENTLY_KNOWN
25
+ }
26
+
27
+ export enum JudoCheckoutOption {
28
+ DEFAULT,
29
+ COMPLETE_IMMEDIATE_PURCHASE
30
+ }
31
+
21
32
  export interface JudoGooglePayConfiguration {
22
- countryCode: string
23
33
  environment: JudoGooglePayEnvironment
24
- isEmailRequired: boolean
34
+ merchantName?: string
35
+ countryCode: string
36
+ transactionId?: string
37
+ totalPriceStatus: JudoGooglePayPriceStatus
38
+ totalPriceLabel?: string
39
+ checkoutOption?: JudoCheckoutOption
40
+ isEmailRequired?: boolean
25
41
  isBillingAddressRequired: boolean
26
42
  billingAddressParameters?: JudoBillingAddressParameters
27
43
  isShippingAddressRequired: boolean
28
44
  shippingAddressParameters?: JudoShippingAddressParameters
45
+ allowPrepaidCards?: boolean
46
+ allowCreditCards?: boolean
29
47
  }
@@ -218,6 +218,7 @@ export interface JudoCardDetails {
218
218
  cardCountry?: string
219
219
  cardFunding?: string
220
220
  cardScheme?: string
221
+ cardHolderName?: string
221
222
  }
222
223
 
223
224
  export interface JudoConsumer {