judokit-react-native 4.1.3 → 4.2.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/JudoKit-ReactNative.podspec +42 -0
- package/LICENSE +1 -2
- package/README.md +106 -119
- package/android/build.gradle +65 -202
- package/android/gradle.properties +6 -1
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/judopay/judokit/reactnative/Extensions.kt +382 -0
- package/android/src/main/java/com/judopay/judokit/reactnative/Helpers.kt +678 -0
- package/android/src/main/java/com/judopay/judokit/reactnative/JudoActivityEventListener.kt +50 -0
- package/android/src/main/java/com/judopay/judokit/reactnative/JudoKitReactNativeModule.kt +153 -0
- package/android/src/main/java/com/judopay/judokit/reactnative/JudoKitReactNativePackage.kt +16 -0
- package/ios/{Classes/Extensions → Extensions}/NSDictionary+JudoConvert.h +1 -1
- package/ios/{Classes/Extensions → Extensions}/NSDictionary+JudoConvert.m +2 -2
- package/ios/{Classes/Extensions → Extensions}/NSException+JudoValidationExceptions.h +1 -1
- package/ios/{Classes/Extensions → Extensions}/NSException+JudoValidationExceptions.m +1 -1
- package/ios/{Classes/Extensions → Extensions}/UIColor+RNAdditions.h +1 -1
- package/ios/{Classes/Extensions → Extensions}/UIColor+RNAdditions.m +3 -3
- package/ios/{Classes/RNJudo.h → JudoKitReactNative.h} +12 -6
- package/ios/{Classes/RNJudo.m → JudoKitReactNative.mm} +83 -81
- package/ios/{Classes/RNTypes.h → RNTypes.h} +8 -2
- package/ios/{Classes/Wrappers → Wrappers}/RNApplePayWrappers.h +1 -1
- package/ios/{Classes/Wrappers → Wrappers}/RNApplePayWrappers.m +105 -4
- package/ios/{Classes/Wrappers → Wrappers}/RNWrappers.h +14 -14
- package/ios/{Classes/Wrappers → Wrappers}/RNWrappers.m +46 -25
- package/lib/commonjs/index.js +274 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/judo-kit/index.js +212 -0
- package/lib/commonjs/judo-kit/index.js.map +1 -0
- package/lib/commonjs/types/index.js +273 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/types/judo-apple-pay-configuration.js +49 -0
- package/lib/commonjs/types/judo-apple-pay-configuration.js.map +1 -0
- package/lib/commonjs/types/judo-configuration.js +71 -0
- package/lib/commonjs/types/judo-configuration.js.map +1 -0
- package/lib/commonjs/types/judo-google-pay-configuration.js +28 -0
- package/lib/commonjs/types/judo-google-pay-configuration.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/judo-kit/index.js +205 -0
- package/lib/module/judo-kit/index.js.map +1 -0
- package/lib/module/types/index.js +8 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/judo-apple-pay-configuration.js +43 -0
- package/lib/module/types/judo-apple-pay-configuration.js.map +1 -0
- package/lib/module/types/judo-configuration.js +65 -0
- package/lib/module/types/judo-configuration.js.map +1 -0
- package/lib/module/types/judo-google-pay-configuration.js +22 -0
- package/lib/module/types/judo-google-pay-configuration.js.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/judo-kit/index.d.ts +86 -0
- package/lib/typescript/src/judo-kit/index.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +4 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/lib/typescript/src/types/judo-apple-pay-configuration.d.ts +75 -0
- package/lib/typescript/src/types/judo-apple-pay-configuration.d.ts.map +1 -0
- package/lib/typescript/src/types/judo-configuration.d.ts +236 -0
- package/lib/typescript/src/types/judo-configuration.d.ts.map +1 -0
- package/lib/typescript/src/types/judo-google-pay-configuration.d.ts +42 -0
- package/lib/typescript/src/types/judo-google-pay-configuration.d.ts.map +1 -0
- package/package.json +158 -79
- package/src/index.tsx +51 -0
- package/src/judo-kit/index.ts +262 -0
- package/src/types/index.ts +54 -0
- package/src/types/judo-apple-pay-configuration.ts +85 -0
- package/src/types/judo-configuration.ts +263 -0
- package/src/types/judo-google-pay-configuration.ts +47 -0
- package/JudoPay.tsx +0 -334
- package/RNJudopay.podspec +0 -24
- package/android/src/main/java/com/reactlibrary/Extensions.kt +0 -372
- package/android/src/main/java/com/reactlibrary/Helpers.kt +0 -606
- package/android/src/main/java/com/reactlibrary/JudoReactNativeActivityEventListener.kt +0 -48
- package/android/src/main/java/com/reactlibrary/JudoReactNativeModule.kt +0 -257
- package/android/src/main/java/com/reactlibrary/JudoReactNativePBBAManager.kt +0 -52
- package/android/src/main/java/com/reactlibrary/JudoReactNativePackage.kt +0 -14
- package/components/JudoPBBAButton.ts +0 -2
- package/ios/.xcode.env +0 -11
- package/ios/Classes/Views/RNPBBAButtonManager.m +0 -42
- package/ios/Classes/Wrappers/RNPBBAWrappers.h +0 -40
- package/ios/Classes/Wrappers/RNPBBAWrappers.m +0 -57
- package/ios/Podfile +0 -44
- package/ios/Podfile.lock +0 -572
- package/ios/RNJudo.xcodeproj/project.pbxproj +0 -703
- package/ios/RNJudo.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/RNJudo.xcodeproj/xcshareddata/xcschemes/RNJudo.xcscheme +0 -97
- package/ios/RNJudo.xcworkspace/contents.xcworkspacedata +0 -10
- package/ios/RNJudoTests/Info.plist +0 -22
- package/ios/RNJudoTests/MockConfiguration.json +0 -114
- package/ios/RNJudoTests/NSDictionaryConvertTests.m +0 -475
- package/ios/RNJudoTests/RNApplePayWrappersTests.m +0 -770
- package/ios/RNJudoTests/RNJudoTests.m +0 -37
- package/ios/RNJudoTests/RNMocks.h +0 -54
- package/ios/RNJudoTests/RNMocks.m +0 -55
- package/ios/RNJudoTests/RNPBBAWrappersTests.m +0 -121
- package/ios/RNJudoTests/RNThemeTests.m +0 -576
- package/ios/RNJudoTests/RNWrappersTests.m +0 -947
- package/types/JudoApplePayTypes.tsx +0 -59
- package/types/JudoGooglePayTypes.tsx +0 -47
- package/types/JudoPBBATypes.tsx +0 -7
- package/types/JudoTypes.tsx +0 -251
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
2
|
// RNApplePayWrappers.m
|
|
3
|
-
//
|
|
3
|
+
// JudoKitReactNative
|
|
4
4
|
//
|
|
5
5
|
// Copyright (c) 2020 Alternative Payments Ltd
|
|
6
6
|
//
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
// SOFTWARE.
|
|
24
24
|
|
|
25
25
|
#import "RNApplePayWrappers.h"
|
|
26
|
-
#import "RNWrappers.h"
|
|
27
|
-
#import "RNTypes.h"
|
|
28
26
|
#import "NSDictionary+JudoConvert.h"
|
|
27
|
+
#import "RNTypes.h"
|
|
28
|
+
#import "RNWrappers.h"
|
|
29
29
|
|
|
30
30
|
@implementation RNApplePayWrappers
|
|
31
31
|
|
|
@@ -62,6 +62,10 @@
|
|
|
62
62
|
appleConfiguration.requiredShippingContactFields = [RNApplePayWrappers contactFieldsFromContactFieldValue:shippingFieldNumber.intValue];
|
|
63
63
|
appleConfiguration.returnedContactInfo = [RNApplePayWrappers returnedInfoFromAppleConfiguration:dictionary];
|
|
64
64
|
|
|
65
|
+
if (@available(iOS 16.0, *)) {
|
|
66
|
+
appleConfiguration.recurringPaymentRequest = [RNApplePayWrappers recurringPaymentRequestFromDictionary:dictionary];
|
|
67
|
+
}
|
|
68
|
+
|
|
65
69
|
return appleConfiguration;
|
|
66
70
|
}
|
|
67
71
|
|
|
@@ -155,7 +159,7 @@
|
|
|
155
159
|
detail:detail
|
|
156
160
|
label:label
|
|
157
161
|
amount:[NSDecimalNumber decimalNumberWithString:amountString]
|
|
158
|
-
|
|
162
|
+
type:typeNumber.intValue];
|
|
159
163
|
}
|
|
160
164
|
|
|
161
165
|
+ (JPPaymentShippingType)shippingTypeFromDictionary:(NSDictionary *)dictionary {
|
|
@@ -230,4 +234,101 @@
|
|
|
230
234
|
return returnedInfo;
|
|
231
235
|
}
|
|
232
236
|
|
|
237
|
+
+ (JPRecurringPaymentRequest *)recurringPaymentRequestFromDictionary:(NSDictionary *)dictionary API_AVAILABLE(ios(16.0)) {
|
|
238
|
+
NSDictionary *recurringPaymentRequestDict = [dictionary optionalDictionaryForKey:@"recurringPaymentRequest"];
|
|
239
|
+
|
|
240
|
+
if (!recurringPaymentRequestDict) {
|
|
241
|
+
return nil;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Mandatory fields
|
|
245
|
+
NSString *paymentDescription = [recurringPaymentRequestDict stringForKey:@"paymentDescription"];
|
|
246
|
+
NSString *managementURLString = [recurringPaymentRequestDict stringForKey:@"managementURL"];
|
|
247
|
+
NSDictionary *regularBillingDict = [recurringPaymentRequestDict dictionaryForKey:@"regularBilling"];
|
|
248
|
+
|
|
249
|
+
// Optional fields
|
|
250
|
+
NSDictionary *trialBillingDict = [recurringPaymentRequestDict optionalDictionaryForKey:@"trialBilling"];
|
|
251
|
+
NSString *billingAgreement = [recurringPaymentRequestDict optionalStringForKey:@"billingAgreement"];
|
|
252
|
+
NSString *tokenNotificationURLString = [recurringPaymentRequestDict optionalStringForKey:@"tokenNotificationURL"];
|
|
253
|
+
|
|
254
|
+
NSURL *managementURL = [NSURL URLWithString:managementURLString];
|
|
255
|
+
|
|
256
|
+
JPRecurringPaymentSummaryItem *regularBilling = [RNApplePayWrappers recurringPaymentSummaryItemFromDictionary:regularBillingDict];
|
|
257
|
+
JPRecurringPaymentRequest *request = [JPRecurringPaymentRequest requestWithPaymentDescription:paymentDescription
|
|
258
|
+
regularBilling:regularBilling
|
|
259
|
+
andManagementURL:managementURL];
|
|
260
|
+
|
|
261
|
+
request.trialBilling = [RNApplePayWrappers recurringPaymentSummaryItemFromDictionary:trialBillingDict];
|
|
262
|
+
request.billingAgreement = billingAgreement;
|
|
263
|
+
|
|
264
|
+
if (tokenNotificationURLString) {
|
|
265
|
+
request.tokenNotificationURL = [NSURL URLWithString:tokenNotificationURLString];
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return request;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
+ (JPRecurringPaymentSummaryItem *)recurringPaymentSummaryItemFromDictionary:(NSDictionary *)dictionary API_AVAILABLE(ios(15.0)) {
|
|
272
|
+
if (!dictionary) {
|
|
273
|
+
return nil;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
NSString *label = [dictionary stringForKey:@"label"];
|
|
277
|
+
NSString *amountString = [dictionary stringForKey:@"amount"];
|
|
278
|
+
NSDecimalNumber *amount = [NSDecimalNumber decimalNumberWithString:amountString];
|
|
279
|
+
|
|
280
|
+
JPRecurringPaymentSummaryItem *item = [JPRecurringPaymentSummaryItem new];
|
|
281
|
+
item.label = label;
|
|
282
|
+
item.amount = amount;
|
|
283
|
+
|
|
284
|
+
NSString *startDateString = [dictionary optionalStringForKey:@"startDate"];
|
|
285
|
+
NSString *endDateString = [dictionary optionalStringForKey:@"endDate"];
|
|
286
|
+
NSNumber *intervalUnit = [dictionary optionalNumberForKey:@"intervalUnit"];
|
|
287
|
+
NSNumber *intervalCount = [dictionary optionalNumberForKey:@"intervalCount"];
|
|
288
|
+
|
|
289
|
+
NSISO8601DateFormatter *dateFormatter = [NSISO8601DateFormatter new];
|
|
290
|
+
dateFormatter.formatOptions = NSISO8601DateFormatWithFullDate | NSISO8601DateFormatWithFullTime | NSISO8601DateFormatWithFractionalSeconds;
|
|
291
|
+
|
|
292
|
+
if (startDateString) {
|
|
293
|
+
item.startDate = [dateFormatter dateFromString:startDateString];
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (endDateString) {
|
|
297
|
+
item.endDate = [dateFormatter dateFromString:endDateString];
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
switch (intervalUnit.integerValue) {
|
|
301
|
+
case IOSCalendarUnitYear:
|
|
302
|
+
item.intervalUnit = NSCalendarUnitYear;
|
|
303
|
+
break;
|
|
304
|
+
|
|
305
|
+
case IOSCalendarUnitMonth:
|
|
306
|
+
item.intervalUnit = NSCalendarUnitMonth;
|
|
307
|
+
break;
|
|
308
|
+
|
|
309
|
+
case IOSCalendarUnitDay:
|
|
310
|
+
item.intervalUnit = NSCalendarUnitDay;
|
|
311
|
+
break;
|
|
312
|
+
|
|
313
|
+
case IOSCalendarUnitHour:
|
|
314
|
+
item.intervalUnit = NSCalendarUnitHour;
|
|
315
|
+
break;
|
|
316
|
+
|
|
317
|
+
case IOSCalendarUnitMinute:
|
|
318
|
+
item.intervalUnit = NSCalendarUnitMinute;
|
|
319
|
+
break;
|
|
320
|
+
|
|
321
|
+
default:
|
|
322
|
+
// overriding defaults as a workround, remove as once JudoKit-iOS is fixed
|
|
323
|
+
item.intervalUnit = NSCalendarUnitMonth;
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// overriding defaults as a workround, remove as once JudoKit-iOS is fixed
|
|
328
|
+
NSUInteger count = intervalCount.integerValue;
|
|
329
|
+
item.intervalCount = count > 0 ? count : 1;
|
|
330
|
+
|
|
331
|
+
return item;
|
|
332
|
+
}
|
|
333
|
+
|
|
233
334
|
@end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
2
|
// RNWrappers.h
|
|
3
|
-
//
|
|
3
|
+
// JudoKitReactNative
|
|
4
4
|
//
|
|
5
5
|
// Copyright (c) 2020 Alternative Payments Ltd
|
|
6
6
|
//
|
|
@@ -91,13 +91,13 @@
|
|
|
91
91
|
+ (JPCardNetworkType)cardNetworksFromConfiguration:(NSDictionary *)configuration;
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
* A method that returns the card token obtained after the Save Card transaction from the dictionary parameters.
|
|
95
|
-
* The card token is used to complete a payment or pre-auth transaction with a stored card token
|
|
96
|
-
*
|
|
97
|
-
* @param properties - an NSDictionary that contains the complete configuration properties set by the merchant
|
|
98
|
-
*
|
|
99
|
-
* @returns an optional card token NSString instance
|
|
100
|
-
*/
|
|
94
|
+
* A method that returns the card token obtained after the Save Card transaction from the dictionary parameters.
|
|
95
|
+
* The card token is used to complete a payment or pre-auth transaction with a stored card token
|
|
96
|
+
*
|
|
97
|
+
* @param properties - an NSDictionary that contains the complete configuration properties set by the merchant
|
|
98
|
+
*
|
|
99
|
+
* @returns an optional card token NSString instance
|
|
100
|
+
*/
|
|
101
101
|
+ (NSString *)cardTokenFromProperties:(NSDictionary *)properties;
|
|
102
102
|
|
|
103
103
|
+ (NSString *)securityCodeFromProperties:(NSDictionary *)properties;
|
|
@@ -107,12 +107,12 @@
|
|
|
107
107
|
+ (JPCardNetworkType)cardTypeFromProperties:(NSDictionary *)properties;
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
|
-
* A method that returns the receipt ID contained in the properties dictionary
|
|
111
|
-
*
|
|
112
|
-
* @param properties - an NSDictionary that contains the complete configuration properties set by the merchant
|
|
113
|
-
*
|
|
114
|
-
* @returns an optional receipt ID NSString instance
|
|
115
|
-
*/
|
|
110
|
+
* A method that returns the receipt ID contained in the properties dictionary
|
|
111
|
+
*
|
|
112
|
+
* @param properties - an NSDictionary that contains the complete configuration properties set by the merchant
|
|
113
|
+
*
|
|
114
|
+
* @returns an optional receipt ID NSString instance
|
|
115
|
+
*/
|
|
116
116
|
+ (NSString *)receiptIdFromProperties:(NSDictionary *)properties;
|
|
117
117
|
|
|
118
118
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
2
|
// RNWrappers.m
|
|
3
|
-
//
|
|
3
|
+
// JudoKitReactNative
|
|
4
4
|
//
|
|
5
5
|
// Copyright (c) 2020 Alternative Payments Ltd
|
|
6
6
|
//
|
|
@@ -23,10 +23,9 @@
|
|
|
23
23
|
// SOFTWARE.
|
|
24
24
|
|
|
25
25
|
#import "RNWrappers.h"
|
|
26
|
+
#import "NSDictionary+JudoConvert.h"
|
|
26
27
|
#import "RNApplePayWrappers.h"
|
|
27
|
-
#import "RNPBBAWrappers.h"
|
|
28
28
|
#import "RNTypes.h"
|
|
29
|
-
#import "NSDictionary+JudoConvert.h"
|
|
30
29
|
#import "UIColor+RNAdditions.h"
|
|
31
30
|
#import <Judo3DS2_iOS/Judo3DS2_iOS.h>
|
|
32
31
|
|
|
@@ -62,7 +61,7 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
62
61
|
NSString *token = [authorizationDict stringForKey:@"token"];
|
|
63
62
|
NSString *secret = [authorizationDict optionalStringForKey:@"secret"];
|
|
64
63
|
NSString *paymentSession = [authorizationDict optionalStringForKey:@"paymentSession"];
|
|
65
|
-
|
|
64
|
+
|
|
66
65
|
if (secret) {
|
|
67
66
|
return [JPBasicAuthorization authorizationWithToken:token andSecret:secret];
|
|
68
67
|
}
|
|
@@ -76,7 +75,8 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
+ (JPSubProductInfo *)subProductInfoFromProperties:(NSDictionary *)properties {
|
|
79
|
-
NSString *version = [properties optionalStringForKey:@"packageVersion"]
|
|
78
|
+
NSString *version = [properties optionalStringForKey:@"packageVersion"];
|
|
79
|
+
;
|
|
80
80
|
return [[JPSubProductInfo alloc] initWithSubProductType:JPSubProductTypeReactNative andVersion:version];
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -165,9 +165,9 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
165
165
|
configuration.cardAddress = [RNWrappers cardAddressFromConfiguration:configurationDict];
|
|
166
166
|
configuration.paymentMethods = [RNWrappers paymentMethodsFromConfiguration:configurationDict];
|
|
167
167
|
configuration.applePayConfiguration = [RNApplePayWrappers applePayConfigurationFromConfiguration:configurationDict];
|
|
168
|
-
configuration.pbbaConfiguration = [RNPBBAWrappers pbbaConfigurationFromConfiguration:configurationDict];
|
|
169
168
|
configuration.networkTimeout = [RNWrappers networkTimeoutFromProperties:configurationDict];
|
|
170
|
-
|
|
169
|
+
configuration.recommendationConfiguration = [RNWrappers recommendationConfigurationFromConfiguration:configurationDict];
|
|
170
|
+
|
|
171
171
|
NSString *scaExemption = [configurationDict optionalStringForKey:@"scaExemption"];
|
|
172
172
|
NSString *challengeRequestIndicator = [configurationDict optionalStringForKey:@"challengeRequestIndicator"];
|
|
173
173
|
NSString *mobileNumber = [configurationDict optionalStringForKey:@"mobileNumber"];
|
|
@@ -187,7 +187,7 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
187
187
|
if (challengeRequestIndicator) {
|
|
188
188
|
configuration.challengeRequestIndicator = challengeRequestIndicator;
|
|
189
189
|
}
|
|
190
|
-
|
|
190
|
+
|
|
191
191
|
if (threeDSTwoMessageVersion) {
|
|
192
192
|
configuration.threeDSTwoMessageVersion = threeDSTwoMessageVersion;
|
|
193
193
|
}
|
|
@@ -195,7 +195,7 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
195
195
|
if (threeDSTwoMaxTimeout) {
|
|
196
196
|
configuration.threeDSTwoMaxTimeout = threeDSTwoMaxTimeout.intValue;
|
|
197
197
|
}
|
|
198
|
-
|
|
198
|
+
|
|
199
199
|
return configuration;
|
|
200
200
|
}
|
|
201
201
|
|
|
@@ -266,19 +266,19 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
266
266
|
|
|
267
267
|
+ (JPCardNetworkType)cardTypeFromProperties:(NSDictionary *)properties {
|
|
268
268
|
NSString *cardScheme = [properties optionalStringForKey:@"cardScheme"].lowercaseString;
|
|
269
|
-
|
|
269
|
+
|
|
270
270
|
if ([cardScheme containsString:kCardSchemeVISA]) {
|
|
271
271
|
return JPCardNetworkTypeVisa;
|
|
272
272
|
}
|
|
273
|
-
|
|
273
|
+
|
|
274
274
|
if ([cardScheme containsString:kCardSchemeMasterCard]) {
|
|
275
275
|
return JPCardNetworkTypeMasterCard;
|
|
276
276
|
}
|
|
277
|
-
|
|
277
|
+
|
|
278
278
|
if ([cardScheme containsString:kCardSchemeAMEX]) {
|
|
279
279
|
return JPCardNetworkTypeAMEX;
|
|
280
280
|
}
|
|
281
|
-
|
|
281
|
+
|
|
282
282
|
return JPCardNetworkTypeUnknown;
|
|
283
283
|
}
|
|
284
284
|
|
|
@@ -309,11 +309,11 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
309
309
|
NSNumber *bitmask = [configuration optionalNumberForKey:@"paymentMethods"];
|
|
310
310
|
|
|
311
311
|
if (!bitmask) {
|
|
312
|
-
return @[JPPaymentMethod.card, JPPaymentMethod.applePay, JPPaymentMethod.iDeal
|
|
312
|
+
return @[ JPPaymentMethod.card, JPPaymentMethod.applePay, JPPaymentMethod.iDeal ];
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
if (BitmaskContains(bitmask.intValue, IOSPaymentMethodAll)) {
|
|
316
|
-
return @[JPPaymentMethod.card, JPPaymentMethod.applePay, JPPaymentMethod.iDeal
|
|
316
|
+
return @[ JPPaymentMethod.card, JPPaymentMethod.applePay, JPPaymentMethod.iDeal ];
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
NSMutableArray<JPPaymentMethod *> *paymentMethods = [NSMutableArray new];
|
|
@@ -330,10 +330,6 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
330
330
|
[paymentMethods addObject:JPPaymentMethod.iDeal];
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
if (BitmaskContains(bitmask.intValue, IOSPaymentMethodPBBA)) {
|
|
334
|
-
[paymentMethods addObject:JPPaymentMethod.pbba];
|
|
335
|
-
}
|
|
336
|
-
|
|
337
333
|
return paymentMethods;
|
|
338
334
|
}
|
|
339
335
|
|
|
@@ -343,7 +339,7 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
343
339
|
if (!addressDictionary) {
|
|
344
340
|
return nil;
|
|
345
341
|
}
|
|
346
|
-
|
|
342
|
+
|
|
347
343
|
return [[JPAddress alloc] initWithAddress1:[addressDictionary optionalStringForKey:@"line1"]
|
|
348
344
|
address2:[addressDictionary optionalStringForKey:@"line2"]
|
|
349
345
|
address3:[addressDictionary optionalStringForKey:@"line3"]
|
|
@@ -368,7 +364,9 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
368
364
|
NSNumber *isPayButtonAmountVisible = [dictionary optionalBoolForKey:@"shouldPaymentButtonDisplayAmount"];
|
|
369
365
|
NSNumber *isSecureCodeCheckEnabled = [dictionary optionalBoolForKey:@"shouldPaymentMethodsVerifySecurityCode"];
|
|
370
366
|
NSNumber *shouldAskForBillingInformation = [dictionary optionalBoolForKey:@"shouldAskForBillingInformation"];
|
|
371
|
-
|
|
367
|
+
NSNumber *shouldAskForCSC = [dictionary optionalBoolForKey:@"shouldAskForCSC"];
|
|
368
|
+
NSNumber *shouldAskForCardholderName = [dictionary optionalBoolForKey:@"shouldAskForCardholderName"];
|
|
369
|
+
|
|
372
370
|
if (isAVSEnabled) {
|
|
373
371
|
uiConfiguration.isAVSEnabled = isAVSEnabled.boolValue;
|
|
374
372
|
}
|
|
@@ -384,17 +382,40 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
384
382
|
if (isSecureCodeCheckEnabled) {
|
|
385
383
|
uiConfiguration.shouldPaymentMethodsVerifySecurityCode = isSecureCodeCheckEnabled.boolValue;
|
|
386
384
|
}
|
|
387
|
-
|
|
385
|
+
|
|
388
386
|
if (shouldAskForBillingInformation) {
|
|
389
387
|
uiConfiguration.shouldAskForBillingInformation = shouldAskForBillingInformation.boolValue;
|
|
390
388
|
}
|
|
391
|
-
|
|
389
|
+
|
|
390
|
+
if (shouldAskForCSC) {
|
|
391
|
+
uiConfiguration.shouldAskForCSC = shouldAskForCSC.boolValue;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
if (shouldAskForCardholderName) {
|
|
395
|
+
uiConfiguration.shouldAskForCardholderName = shouldAskForCardholderName.boolValue;
|
|
396
|
+
}
|
|
397
|
+
|
|
392
398
|
uiConfiguration.theme = [self themeFromUIConfiguration:dictionary];
|
|
393
399
|
uiConfiguration.threeDSUICustomization = [self threeDSUICustomization:dictionary];
|
|
394
400
|
|
|
395
401
|
return uiConfiguration;
|
|
396
402
|
}
|
|
397
403
|
|
|
404
|
+
+ (JPRecommendationConfiguration *)recommendationConfigurationFromConfiguration:(NSDictionary *)configuration {
|
|
405
|
+
NSDictionary *dictionary = [configuration optionalDictionaryForKey:@"recommendationConfiguration"];
|
|
406
|
+
|
|
407
|
+
if (!dictionary) {
|
|
408
|
+
return nil;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
NSString *URLString = [dictionary stringForKey:@"url"];
|
|
412
|
+
NSURL *URL = [NSURL URLWithString:URLString];
|
|
413
|
+
NSString *RSAPublicKey = [dictionary stringForKey:@"rsaPublicKey"];
|
|
414
|
+
NSNumber *timeout = [dictionary optionalNumberForKey:@"timeout"];
|
|
415
|
+
|
|
416
|
+
return [JPRecommendationConfiguration configurationWithURL:URL RSAPublicKey:RSAPublicKey andTimeout:timeout];
|
|
417
|
+
}
|
|
418
|
+
|
|
398
419
|
+ (JP3DSUICustomization *)threeDSUICustomization:(NSDictionary *)uiCustomization {
|
|
399
420
|
NSDictionary *dictionary = [uiCustomization optionalDictionaryForKey:@"threeDSUIConfiguration"];
|
|
400
421
|
|
|
@@ -757,7 +778,7 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
757
778
|
+ (NSDictionary *)dictionaryFromResponse:(JPResponse *)response {
|
|
758
779
|
|
|
759
780
|
NSMutableDictionary *mappedResponse = [NSMutableDictionary new];
|
|
760
|
-
|
|
781
|
+
|
|
761
782
|
[mappedResponse setValue:response.receiptId forKey:@"receiptId"];
|
|
762
783
|
[mappedResponse setValue:response.paymentReference forKey:@"yourPaymentReference"];
|
|
763
784
|
[mappedResponse setValue:@(response.type) forKey:@"type"];
|
|
@@ -871,6 +892,6 @@ static NSString *const kCardSchemeAMEX = @"amex";
|
|
|
871
892
|
}
|
|
872
893
|
|
|
873
894
|
return [NSDictionary dictionaryWithDictionary:mappedResponse];
|
|
874
|
-
|
|
895
|
+
}
|
|
875
896
|
|
|
876
897
|
@end
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ChallengeRequestIndicator", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _types.ChallengeRequestIndicator;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "JudoAccountDetails", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _types.JudoAccountDetails;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "JudoAddress", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _types.JudoAddress;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "JudoAddressFormat", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _types.JudoAddressFormat;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "JudoAmount", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _types.JudoAmount;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "JudoApplePayConfiguration", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _types.JudoApplePayConfiguration;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "JudoApplePayRecurringPaymentRequest", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _types.JudoApplePayRecurringPaymentRequest;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "JudoAuthorization", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _types.JudoAuthorization;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "JudoBillingAddressParameters", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _types.JudoBillingAddressParameters;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "JudoCalendarUnit", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _types.JudoCalendarUnit;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "JudoCardDetails", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _types.JudoCardDetails;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "JudoCardNetwork", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _types.JudoCardNetwork;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "JudoCheckoutOption", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _types.JudoCheckoutOption;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "JudoConfiguration", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _types.JudoConfiguration;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "JudoConsumer", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _types.JudoConsumer;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "JudoContactField", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _types.JudoContactField;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "JudoGooglePayConfiguration", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _types.JudoGooglePayConfiguration;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "JudoGooglePayEnvironment", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _types.JudoGooglePayEnvironment;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "JudoGooglePayPriceStatus", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _types.JudoGooglePayPriceStatus;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "JudoMerchantCapability", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _types.JudoMerchantCapability;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "JudoPaymentMethod", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _types.JudoPaymentMethod;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "JudoPaymentSummaryItem", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _types.JudoPaymentSummaryItem;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "JudoPaymentSummaryItemType", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _types.JudoPaymentSummaryItemType;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "JudoRecommendationConfiguration", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () {
|
|
147
|
+
return _types.JudoRecommendationConfiguration;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "JudoRecurringPaymentSummaryItem", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return _types.JudoRecurringPaymentSummaryItem;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "JudoReference", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function () {
|
|
159
|
+
return _types.JudoReference;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "JudoResponse", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return _types.JudoResponse;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(exports, "JudoReturnedInfo", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return _types.JudoReturnedInfo;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "JudoShippingAddressParameters", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function () {
|
|
177
|
+
return _types.JudoShippingAddressParameters;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "JudoShippingMethod", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () {
|
|
183
|
+
return _types.JudoShippingMethod;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(exports, "JudoShippingType", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function () {
|
|
189
|
+
return _types.JudoShippingType;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "JudoTheme", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function () {
|
|
195
|
+
return _types.JudoTheme;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
Object.defineProperty(exports, "JudoThreeDSButtonCustomization", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function () {
|
|
201
|
+
return _types.JudoThreeDSButtonCustomization;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(exports, "JudoThreeDSButtonType", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function () {
|
|
207
|
+
return _types.JudoThreeDSButtonType;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
Object.defineProperty(exports, "JudoThreeDSLabelCustomization", {
|
|
211
|
+
enumerable: true,
|
|
212
|
+
get: function () {
|
|
213
|
+
return _types.JudoThreeDSLabelCustomization;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
Object.defineProperty(exports, "JudoThreeDSTextBoxCustomization", {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function () {
|
|
219
|
+
return _types.JudoThreeDSTextBoxCustomization;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
Object.defineProperty(exports, "JudoThreeDSToolbarCustomization", {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
get: function () {
|
|
225
|
+
return _types.JudoThreeDSToolbarCustomization;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
Object.defineProperty(exports, "JudoThreeDSUIConfiguration", {
|
|
229
|
+
enumerable: true,
|
|
230
|
+
get: function () {
|
|
231
|
+
return _types.JudoThreeDSUIConfiguration;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
Object.defineProperty(exports, "JudoTransactionMode", {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
get: function () {
|
|
237
|
+
return _types.JudoTransactionMode;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
Object.defineProperty(exports, "JudoTransactionResult", {
|
|
241
|
+
enumerable: true,
|
|
242
|
+
get: function () {
|
|
243
|
+
return _types.JudoTransactionResult;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
Object.defineProperty(exports, "JudoTransactionType", {
|
|
247
|
+
enumerable: true,
|
|
248
|
+
get: function () {
|
|
249
|
+
return _types.JudoTransactionType;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
Object.defineProperty(exports, "JudoUIConfiguration", {
|
|
253
|
+
enumerable: true,
|
|
254
|
+
get: function () {
|
|
255
|
+
return _types.JudoUIConfiguration;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
Object.defineProperty(exports, "NetworkTimeout", {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
get: function () {
|
|
261
|
+
return _types.NetworkTimeout;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
Object.defineProperty(exports, "ScaExemption", {
|
|
265
|
+
enumerable: true,
|
|
266
|
+
get: function () {
|
|
267
|
+
return _types.ScaExemption;
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
exports.default = void 0;
|
|
271
|
+
var _judoKit = require("./judo-kit");
|
|
272
|
+
var _types = require("./types");
|
|
273
|
+
var _default = exports.default = _judoKit.JudoPay;
|
|
274
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_judoKit","require","_types","_default","exports","default","JudoPay"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AA8CiB,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEFC,gBAAO"}
|