From e987254b310fe5af635e736e4c3e9602fa3606ba Mon Sep 17 00:00:00 2001 From: Stefan Date: Wed, 2 Nov 2022 14:58:13 +0200 Subject: [PATCH] UI customization for 3DS SDK (#165) * UI customization for 3DS SDK * 3DS SDK version bump * Addresses PR comments * Temporary disable tests that fail (DeviceDNA related) * CI/CD fixes --- Cartfile | 2 +- Cartfile.resolved | 2 +- .../project.pbxproj | 8 +- .../ObjectiveCExampleApp/AppDelegate.m | 11 +- .../Controllers/Main/MainViewController.m | 7 + .../ObjectiveCExampleApp/Models/Settings.h | 57 +- .../ObjectiveCExampleApp/Models/Settings.m | 84 ++- .../Settings.bundle/Root.plist | 8 + .../ThreeDSSDKUICustomisation.plist | 499 ++++++++++++++++++ Examples/ObjectiveCExampleApp/Podfile | 4 +- Examples/ObjectiveCExampleApp/Podfile.lock | 14 +- Examples/SwiftExampleApp/Podfile | 2 +- JudoKit-iOS.podspec | 4 +- .../xcschemes/JudoKit_iOS.xcscheme | 32 ++ Package.resolved | 4 +- Package.swift | 2 +- Source/JudoKit.h | 2 +- .../UIConfiguration/JPUIConfiguration.h | 4 +- .../Presenter/JPTransactionPresenter.m | 2 +- .../JPCardTransactionService.m | 7 +- Source/View/CardInputView/JPCardInputView.m | 2 +- 21 files changed, 724 insertions(+), 33 deletions(-) create mode 100644 Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Settings.bundle/ThreeDSSDKUICustomisation.plist diff --git a/Cartfile b/Cartfile index 51b32f116..1a6a51793 100644 --- a/Cartfile +++ b/Cartfile @@ -1,5 +1,5 @@ github "datatheorem/TrustKit" == 1.7.0 binary "https://raw.githubusercontent.com/Judopay/DeviceDNA-iOS/master/DeviceDNA.json" == 2.0.0 -binary "https://raw.githubusercontent.com/Judopay/Judo3DS2-iOS/master/Judo3DS2_iOS.json" == 1.1.2 +binary "https://raw.githubusercontent.com/Judopay/Judo3DS2-iOS/master/Judo3DS2_iOS.json" == 1.1.3 github "krzyzanowskim/OpenSSL" ~> 1.1.180 github "Judopay/pbba-merchant-button-library-ios" == 3.1.3 diff --git a/Cartfile.resolved b/Cartfile.resolved index 4863d0b36..ded92b43b 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,5 +1,5 @@ binary "https://raw.githubusercontent.com/Judopay/DeviceDNA-iOS/master/DeviceDNA.json" "2.0.0" -binary "https://raw.githubusercontent.com/Judopay/Judo3DS2-iOS/master/Judo3DS2_iOS.json" "1.1.2" +binary "https://raw.githubusercontent.com/Judopay/Judo3DS2-iOS/master/Judo3DS2_iOS.json" "1.1.3" github "AliSoftware/OHHTTPStubs" "9.1.0" github "Judopay/pbba-merchant-button-library-ios" "3.1.3" github "datatheorem/TrustKit" "1.7.0" diff --git a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp.xcodeproj/project.pbxproj b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp.xcodeproj/project.pbxproj index de8c1bebf..b31a691bb 100644 --- a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp.xcodeproj/project.pbxproj +++ b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp.xcodeproj/project.pbxproj @@ -1084,14 +1084,14 @@ CODE_SIGN_ENTITLEMENTS = ObjectiveCExampleApp/ObjectiveCExampleApp.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = 95V535S6TQ; INFOPLIST_FILE = ObjectiveCExampleApp/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.1.6; + MARKETING_VERSION = 3.1.7; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.judo.JudoPayDemoObjC; PRODUCT_NAME = "Judopay demo"; @@ -1109,14 +1109,14 @@ CODE_SIGN_ENTITLEMENTS = ObjectiveCExampleApp/ObjectiveCExampleApp.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = 95V535S6TQ; INFOPLIST_FILE = ObjectiveCExampleApp/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.1.6; + MARKETING_VERSION = 3.1.7; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.judo.JudoPayDemoObjC; PRODUCT_NAME = "Judopay demo"; diff --git a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/AppDelegate.m b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/AppDelegate.m index 60423f946..bfc9394ee 100644 --- a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/AppDelegate.m +++ b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/AppDelegate.m @@ -71,9 +71,14 @@ - (void)registerDefaultsFromSettingsBundle { return; } - NSString *stringsPath = [settingsBundle stringByAppendingPathComponent:@"Root.plist"]; - NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:stringsPath]; - NSArray *preferences = settings[@"PreferenceSpecifiers"]; + NSArray *settingFiles = @[@"Root.plist", @"ThreeDSSDKUICustomisation.plist"]; + NSMutableArray *preferences = [NSMutableArray new]; + + for (NSString *fileName in settingFiles) { + NSString *stringsPath = [settingsBundle stringByAppendingPathComponent:fileName]; + NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:stringsPath]; + [preferences addObjectsFromArray:settings[@"PreferenceSpecifiers"]]; + } NSMutableDictionary *defaultsToRegister = [[NSMutableDictionary alloc] initWithCapacity:preferences.count]; diff --git a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Controllers/Main/MainViewController.m b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Controllers/Main/MainViewController.m index a02d2290c..91b945532 100644 --- a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Controllers/Main/MainViewController.m +++ b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Controllers/Main/MainViewController.m @@ -323,6 +323,13 @@ - (JPConfiguration *)configuration { configuration.uiConfiguration.shouldPaymentButtonDisplayAmount = Settings.defaultSettings.shouldPaymentButtonDisplayAmount; configuration.uiConfiguration.shouldPaymentMethodsVerifySecurityCode = Settings.defaultSettings.shouldPaymentMethodsVerifySecurityCode; configuration.uiConfiguration.shouldAskForBillingInformation = Settings.defaultSettings.shouldAskForBillingInformation; + + @try { + configuration.uiConfiguration.threeDSUICustomization = Settings.defaultSettings.threeDSUICustomization; + } @catch(NSException *exception) { + [self displaySnackBarWith:[NSString stringWithFormat:@"Setting 3DS SDK UI configuration failed with reason: %@", exception.reason]]; + } + configuration.supportedCardNetworks = Settings.defaultSettings.supportedCardNetworks; configuration.applePayConfiguration = self.applePayConfiguration; diff --git a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Models/Settings.h b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Models/Settings.h index 18551dccf..7e64ebebf 100644 --- a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Models/Settings.h +++ b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Models/Settings.h @@ -49,6 +49,59 @@ static NSString *const kReadTimeoutKey = @"read_timeout"; static NSString *const kWriteTimeoutKey = @"write_timeout"; static NSString *const kThreeDSTwoMessageVersionKey = @"three_ds_two_message_version"; +static NSString *const kIsThreeDSUICustomisationEnabledKey = @"three_ds_is_ui_customisation_enabled"; + +static NSString *const kThreeDSToolbarTextFontNameKey = @"three_ds_toolbar_text_font_name"; +static NSString *const kThreeDSToolbarTextColorKey = @"three_ds_toolbar_text_color"; +static NSString *const kThreeDSToolbarTextFontSizeKey = @"three_ds_toolbar_text_font_size"; +static NSString *const kThreeDSToolbarBackgroundColorKey = @"three_ds_toolbar_background_color"; +static NSString *const kThreeDSToolbarHeaderTextKey = @"three_ds_toolbar_header_text"; +static NSString *const kThreeDSToolbarButtonTextKey = @"three_ds_toolbar_button_text"; + +static NSString *const kThreeDSLabelTextFontNameKey = @"three_ds_label_text_font_name"; +static NSString *const kThreeDSLabelTextColorKey = @"three_ds_label_text_color"; +static NSString *const kThreeDSLabelTextFontSizeKey = @"three_ds_label_text_font_size"; +static NSString *const kThreeDSLabelHeadingTextFontNameKey = @"three_ds_label_heading_text_font_name"; +static NSString *const kThreeDSLabelHeadingTextColorKey = @"three_ds_label_heading_text_color"; +static NSString *const kThreeDSLabelHeadingTextFontSizeKey = @"three_ds_label_heading_text_font_size"; + +static NSString *const kThreeDSTextBoxTextFontNameKey = @"three_ds_text_box_text_font_name"; +static NSString *const kThreeDSTextBoxTextColorKey = @"three_ds_text_box_text_color"; +static NSString *const kThreeDSTextBoxTextFontSizeKey = @"three_ds_text_box_text_font_size"; +static NSString *const kThreeDSTextBoxBorderWidthKey = @"three_ds_text_box_border_width"; +static NSString *const kThreeDSTextBoxBorderColorKey = @"three_ds_text_box_border_color"; +static NSString *const kThreeDSTextBoxCornerRadiusKey = @"three_ds_text_box_corner_radius"; + +static NSString *const kThreeDSSubmitButtonTextFontNameKey = @"three_ds_submit_button_text_font_name"; +static NSString *const kThreeDSSubmitButtonTextColorKey = @"three_ds_submit_button_text_color"; +static NSString *const kThreeDSSubmitButtonTextFontSizeKey = @"three_ds_submit_button_text_font_size"; +static NSString *const kThreeDSSubmitButtonBackgroundColorKey = @"three_ds_submit_button_background_color"; +static NSString *const kThreeDSSubmitButtonCornerRadiusKey = @"three_ds_submit_button_corner_radius"; + +static NSString *const kThreeDSNextButtonTextFontNameKey = @"three_ds_next_button_text_font_name"; +static NSString *const kThreeDSNextButtonTextColorKey = @"three_ds_next_button_text_color"; +static NSString *const kThreeDSNextButtonTextFontSizeKey = @"three_ds_next_button_text_font_size"; +static NSString *const kThreeDSNextButtonBackgroundColorKey = @"three_ds_next_button_background_color"; +static NSString *const kThreeDSNextButtonCornerRadiusKey = @"three_ds_next_button_corner_radius"; + +static NSString *const kThreeDSContinueButtonTextFontNameKey = @"three_ds_continue_button_text_font_name"; +static NSString *const kThreeDSContinueButtonTextColorKey = @"three_ds_continue_button_text_color"; +static NSString *const kThreeDSContinueButtonTextFontSizeKey = @"three_ds_continue_button_text_font_size"; +static NSString *const kThreeDSContinueButtonBackgroundColorKey = @"three_ds_continue_button_background_color"; +static NSString *const kThreeDSContinueButtonCornerRadiusKey = @"three_ds_continue_button_corner_radius"; + +static NSString *const kThreeDSCancelButtonTextFontNameKey = @"three_ds_cancel_button_text_font_name"; +static NSString *const kThreeDSCancelButtonTextColorKey = @"three_ds_cancel_button_text_color"; +static NSString *const kThreeDSCancelButtonTextFontSizeKey = @"three_ds_cancel_button_text_font_size"; +static NSString *const kThreeDSCancelButtonBackgroundColorKey = @"three_ds_cancel_button_background_color"; +static NSString *const kThreeDSCancelButtonCornerRadiusKey = @"three_ds_cancel_button_corner_radius"; + +static NSString *const kThreeDSResendButtonTextFontNameKey = @"three_ds_resend_button_text_font_name"; +static NSString *const kThreeDSResendButtonTextColorKey = @"three_ds_resend_button_text_color"; +static NSString *const kThreeDSResendButtonTextFontSizeKey = @"three_ds_resend_button_text_font_size"; +static NSString *const kThreeDSResendButtonBackgroundColorKey = @"three_ds_resend_button_background_color"; +static NSString *const kThreeDSResendButtonCornerRadiusKey = @"three_ds_resend_button_corner_radius"; + #pragma mark - Reference section keys static NSString *const kPaymentReferenceKey = @"payment_reference"; @@ -102,6 +155,8 @@ static NSString *const kShouldPaymentButtonDisplayAmount = @"should_payment_butt static NSString *const kShouldPaymentMethodsVerifySecurityCode = @"should_ask_security_code"; static NSString *const kIsInitialRecurringPaymentKey = @"is_initial_recurring_payment"; +@class JP3DSUICustomization; + @interface Settings : NSObject + (instancetype)defaultSettings; @@ -175,7 +230,7 @@ static NSString *const kIsInitialRecurringPaymentKey = @"is_initial_recurring_pa - (nonnull NSNumber *)connectTimeout; - (nonnull NSNumber *)readTimeout; - (nonnull NSNumber *)writeTimeout; - +- (nullable JP3DSUICustomization *)threeDSUICustomization; @end NS_ASSUME_NONNULL_END diff --git a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Models/Settings.m b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Models/Settings.m index 7aad6957f..50052fc3c 100644 --- a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Models/Settings.m +++ b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Models/Settings.m @@ -1,4 +1,5 @@ #import "Settings.h" +#import static NSString *const kDefaultConsumerReference = @"my-unique-consumer-ref"; static NSString *const kDontSet = @"dontSet"; @@ -268,14 +269,15 @@ - (BOOL)isInitialRecurringPaymentEnabled { - (JPAddress *)address { if (Settings.defaultSettings.isAddressOn) { NSNumber *addressCountryCode = @([self.defaults stringForKey:kAddressCountryCodeKey].intValue); - + NSString *state = [self.defaults stringForKey:kAddressStateKey]; + return [[JPAddress alloc] initWithAddress1:[self.defaults stringForKey:kAddressLine1Key] address2:[self.defaults stringForKey:kAddressLine2Key] address3:[self.defaults stringForKey:kAddressLine3Key] town:[self.defaults stringForKey:kAddressTownKey] postCode:[self.defaults stringForKey:kAddressPostCodeKey] countryCode:addressCountryCode - state:[self.defaults stringForKey:kAddressStateKey]]; + state:state.length > 0 ? state : nil]; } return nil; } @@ -356,4 +358,82 @@ - (NSNumber *)writeTimeout { return [self timeoutForKey:kWriteTimeoutKey]; } +- (JP3DSUICustomization *)threeDSUICustomization { + if ([self.defaults boolForKey:kIsThreeDSUICustomisationEnabledKey]) { + JP3DSUICustomization *customization = [JP3DSUICustomization new]; + + JP3DSLabelCustomization *labelCustomization = [JP3DSLabelCustomization new]; + NSString *font = [self.defaults stringForKey:kThreeDSLabelTextFontNameKey]; + [labelCustomization setTextFontName:font]; + [labelCustomization setTextColor:[self.defaults stringForKey:kThreeDSLabelTextColorKey]]; + [labelCustomization setTextFontSize:[self.defaults stringForKey:kThreeDSLabelTextFontSizeKey].integerValue]; + [labelCustomization setHeadingTextFontName:[self.defaults stringForKey:kThreeDSLabelHeadingTextFontNameKey]]; + [labelCustomization setHeadingTextColor:[self.defaults stringForKey:kThreeDSLabelHeadingTextColorKey]]; + [labelCustomization setHeadingTextFontSize:[self.defaults stringForKey:kThreeDSLabelHeadingTextFontSizeKey].integerValue]; + [customization setLabelCustomization:labelCustomization]; + + JP3DSToolbarCustomization *toolbarCustomization = [JP3DSToolbarCustomization new]; + [toolbarCustomization setTextFontName:[self.defaults stringForKey:kThreeDSToolbarTextFontNameKey]]; + [toolbarCustomization setTextColor:[self.defaults stringForKey:kThreeDSToolbarTextColorKey]]; + [toolbarCustomization setTextFontSize:[self.defaults stringForKey:kThreeDSToolbarTextFontSizeKey].integerValue]; + [toolbarCustomization setBackgroundColor:[self.defaults stringForKey:kThreeDSToolbarBackgroundColorKey]]; + [toolbarCustomization setHeaderText:[self.defaults stringForKey:kThreeDSToolbarHeaderTextKey]]; + [toolbarCustomization setButtonText:[self.defaults stringForKey:kThreeDSToolbarButtonTextKey]]; + [customization setToolbarCustomization:toolbarCustomization]; + + JP3DSTextBoxCustomization *textBoxCustomization = [JP3DSTextBoxCustomization new]; + [textBoxCustomization setTextFontName:[self.defaults stringForKey:kThreeDSTextBoxTextFontNameKey]]; + [textBoxCustomization setTextColor:[self.defaults stringForKey:kThreeDSTextBoxTextColorKey]]; + [textBoxCustomization setTextFontSize:[self.defaults stringForKey:kThreeDSTextBoxTextFontSizeKey].integerValue]; + [textBoxCustomization setBorderWidth:[self.defaults stringForKey:kThreeDSTextBoxBorderWidthKey].integerValue]; + [textBoxCustomization setBorderColor:[self.defaults stringForKey:kThreeDSTextBoxBorderColorKey]]; + [textBoxCustomization setCornerRadius:[self.defaults stringForKey:kThreeDSTextBoxCornerRadiusKey].integerValue]; + [customization setTextBoxCustomization:textBoxCustomization]; + + JP3DSButtonCustomization *submitCustomization = [JP3DSButtonCustomization new]; + [submitCustomization setTextFontName:[self.defaults stringForKey:kThreeDSSubmitButtonTextFontNameKey]]; + [submitCustomization setTextColor:[self.defaults stringForKey:kThreeDSSubmitButtonTextColorKey]]; + [submitCustomization setTextFontSize:[self.defaults stringForKey:kThreeDSSubmitButtonTextFontSizeKey].integerValue]; + [submitCustomization setBackgroundColor:[self.defaults stringForKey:kThreeDSSubmitButtonBackgroundColorKey]]; + [submitCustomization setCornerRadius:[self.defaults stringForKey:kThreeDSSubmitButtonCornerRadiusKey].integerValue]; + [customization setButtonCustomization:submitCustomization ofType:JP3DSButtonTypeSubmit]; + + JP3DSButtonCustomization *nextCustomization = [JP3DSButtonCustomization new]; + [nextCustomization setTextFontName:[self.defaults stringForKey:kThreeDSNextButtonTextFontNameKey]]; + [nextCustomization setTextColor:[self.defaults stringForKey:kThreeDSNextButtonTextColorKey]]; + [nextCustomization setTextFontSize:[self.defaults stringForKey:kThreeDSNextButtonTextFontSizeKey].integerValue]; + [nextCustomization setBackgroundColor:[self.defaults stringForKey:kThreeDSNextButtonBackgroundColorKey]]; + [nextCustomization setCornerRadius:[self.defaults stringForKey:kThreeDSNextButtonCornerRadiusKey].integerValue]; + [customization setButtonCustomization:nextCustomization ofType:JP3DSButtonTypeNext]; + + JP3DSButtonCustomization *cancelCustomization = [JP3DSButtonCustomization new]; + [cancelCustomization setTextFontName:[self.defaults stringForKey:kThreeDSCancelButtonTextFontNameKey]]; + [cancelCustomization setTextColor:[self.defaults stringForKey:kThreeDSCancelButtonTextColorKey]]; + [cancelCustomization setTextFontSize:[self.defaults stringForKey:kThreeDSCancelButtonTextFontSizeKey].integerValue]; + [cancelCustomization setBackgroundColor:[self.defaults stringForKey:kThreeDSCancelButtonBackgroundColorKey]]; + [cancelCustomization setCornerRadius:[self.defaults stringForKey:kThreeDSCancelButtonCornerRadiusKey].integerValue]; + [customization setButtonCustomization:cancelCustomization ofType:JP3DSButtonTypeCancel]; + + JP3DSButtonCustomization *continueCustomization = [JP3DSButtonCustomization new]; + [continueCustomization setTextFontName:[self.defaults stringForKey:kThreeDSContinueButtonTextFontNameKey]]; + [continueCustomization setTextColor:[self.defaults stringForKey:kThreeDSContinueButtonTextColorKey]]; + [continueCustomization setTextFontSize:[self.defaults stringForKey:kThreeDSContinueButtonTextFontSizeKey].integerValue]; + [continueCustomization setBackgroundColor:[self.defaults stringForKey:kThreeDSContinueButtonBackgroundColorKey]]; + [continueCustomization setCornerRadius:[self.defaults stringForKey:kThreeDSContinueButtonCornerRadiusKey].integerValue]; + [customization setButtonCustomization:continueCustomization ofType:JP3DSButtonTypeContinue]; + + JP3DSButtonCustomization *resendCustomization = [JP3DSButtonCustomization new]; + [resendCustomization setTextFontName:[self.defaults stringForKey:kThreeDSResendButtonTextFontNameKey]]; + [resendCustomization setTextColor:[self.defaults stringForKey:kThreeDSResendButtonTextColorKey]]; + [resendCustomization setTextFontSize:[self.defaults stringForKey:kThreeDSResendButtonTextFontSizeKey].integerValue]; + [resendCustomization setBackgroundColor:[self.defaults stringForKey:kThreeDSResendButtonBackgroundColorKey]]; + [resendCustomization setCornerRadius:[self.defaults stringForKey:kThreeDSResendButtonCornerRadiusKey].integerValue]; + [customization setButtonCustomization:resendCustomization ofType:JP3DSButtonTypeResend]; + + return customization; + } + + return nil; +} + @end diff --git a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Settings.bundle/Root.plist b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Settings.bundle/Root.plist index e31d70514..661d7aeef 100644 --- a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Settings.bundle/Root.plist +++ b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Settings.bundle/Root.plist @@ -178,6 +178,14 @@ Key three_ds_two_message_version + + File + ThreeDSSDKUICustomisation + Title + UI customization + Type + PSChildPaneSpecifier + Type PSGroupSpecifier diff --git a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Settings.bundle/ThreeDSSDKUICustomisation.plist b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Settings.bundle/ThreeDSSDKUICustomisation.plist new file mode 100644 index 000000000..3942d6f9a --- /dev/null +++ b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp/Settings.bundle/ThreeDSSDKUICustomisation.plist @@ -0,0 +1,499 @@ + + + + + Title + 3DS SDK UI config + PreferenceSpecifiers + + + Type + PSToggleSwitchSpecifier + Title + Enable + Key + three_ds_is_ui_customisation_enabled + DefaultValue + + + + Type + PSGroupSpecifier + Title + Toolbar customization + + + Type + PSTextFieldSpecifier + Title + Text font name + Key + three_ds_toolbar_text_font_name + DefaultValue + Helvetica + + + Type + PSTextFieldSpecifier + Title + Text color + Key + three_ds_toolbar_text_color + DefaultValue + #FFFFFF + + + Type + PSTextFieldSpecifier + Title + Text font size + Key + three_ds_toolbar_text_font_size + DefaultValue + 16 + + + Type + PSTextFieldSpecifier + Title + Background color + Key + three_ds_toolbar_background_color + DefaultValue + #6A4EE1 + + + Type + PSTextFieldSpecifier + Title + Header text + Key + three_ds_toolbar_header_text + DefaultValue + SECURE CHECKOUT + + + Type + PSTextFieldSpecifier + Title + Button text + Key + three_ds_toolbar_button_text + DefaultValue + Cancel + + + Type + PSGroupSpecifier + Title + Label customization + + + Type + PSTextFieldSpecifier + Title + Text font name + Key + three_ds_label_text_font_name + DefaultValue + Helvetica + + + Type + PSTextFieldSpecifier + Title + Text color + Key + three_ds_label_text_color + DefaultValue + #262626 + + + Type + PSTextFieldSpecifier + Title + Text font size + Key + three_ds_label_text_font_size + DefaultValue + 16 + + + Type + PSTextFieldSpecifier + Title + Heading text font name + Key + three_ds_label_heading_text_font_name + DefaultValue + Helvetica + + + Type + PSTextFieldSpecifier + Title + Heading text color + Key + three_ds_label_heading_text_color + DefaultValue + #262626 + + + Type + PSTextFieldSpecifier + Title + Heading text font size + Key + three_ds_label_heading_text_font_size + DefaultValue + 24 + + + Type + PSGroupSpecifier + Title + Text box customization + + + Type + PSTextFieldSpecifier + Title + Text font name + Key + three_ds_text_box_text_font_name + DefaultValue + Helvetica + + + Type + PSTextFieldSpecifier + Title + Text color + Key + three_ds_text_box_text_color + DefaultValue + #262626 + + + Type + PSTextFieldSpecifier + Title + Text font size + Key + three_ds_text_box_text_font_size + DefaultValue + 16 + + + Type + PSTextFieldSpecifier + Title + Border width + Key + three_ds_text_box_border_width + DefaultValue + 0 + + + Type + PSTextFieldSpecifier + Title + Border color + Key + three_ds_text_box_border_color + DefaultValue + #F6F6F6 + + + Type + PSTextFieldSpecifier + Title + Corner radius + Key + three_ds_text_box_corner_radius + DefaultValue + 6 + + + Type + PSGroupSpecifier + Title + Submit button customization + + + Type + PSTextFieldSpecifier + Title + Text font name + Key + three_ds_submit_button_text_font_name + DefaultValue + Helvetica + + + Type + PSTextFieldSpecifier + Title + Text color + Key + three_ds_submit_button_text_color + DefaultValue + #FFFFFF + + + Type + PSTextFieldSpecifier + Title + Text font size + Key + three_ds_submit_button_text_font_size + DefaultValue + 16 + + + Type + PSTextFieldSpecifier + Title + Background color + Key + three_ds_submit_button_background_color + DefaultValue + #262626 + + + Type + PSTextFieldSpecifier + Title + Corner radius + Key + three_ds_submit_button_corner_radius + DefaultValue + 4 + + + Type + PSGroupSpecifier + Title + Next button customization + + + Type + PSTextFieldSpecifier + Title + Text font name + Key + three_ds_next_button_text_font_name + DefaultValue + Helvetica + + + Type + PSTextFieldSpecifier + Title + Text color + Key + three_ds_next_button_text_color + DefaultValue + #FFFFFF + + + Type + PSTextFieldSpecifier + Title + Text font size + Key + three_ds_next_button_text_font_size + DefaultValue + 16 + + + Type + PSTextFieldSpecifier + Title + Background color + Key + three_ds_next_button_background_color + DefaultValue + #262626 + + + Type + PSTextFieldSpecifier + Title + Corner radius + Key + three_ds_next_button_corner_radius + DefaultValue + 4 + + + Type + PSGroupSpecifier + Title + Continue button customization + + + Type + PSTextFieldSpecifier + Title + Text font name + Key + three_ds_continue_button_text_font_name + DefaultValue + Helvetica + + + Type + PSTextFieldSpecifier + Title + Text color + Key + three_ds_continue_button_text_color + DefaultValue + #FFFFFF + + + Type + PSTextFieldSpecifier + Title + Text font size + Key + three_ds_continue_button_text_font_size + DefaultValue + 16 + + + Type + PSTextFieldSpecifier + Title + Background color + Key + three_ds_continue_button_background_color + DefaultValue + #262626 + + + Type + PSTextFieldSpecifier + Title + Corner radius + Key + three_ds_continue_button_corner_radius + DefaultValue + 4 + + + Type + PSGroupSpecifier + Title + Cancel button customization + + + Type + PSTextFieldSpecifier + Title + Text font name + Key + three_ds_cancel_button_text_font_name + DefaultValue + Helvetica + + + Type + PSTextFieldSpecifier + Title + Text color + Key + three_ds_cancel_button_text_color + DefaultValue + #FFFFFF + + + Type + PSTextFieldSpecifier + Title + Text font size + Key + three_ds_cancel_button_text_font_size + DefaultValue + 16 + + + Type + PSTextFieldSpecifier + Title + Background color + Key + three_ds_cancel_button_background_color + DefaultValue + #262626 + + + Type + PSTextFieldSpecifier + Title + Corner radius + Key + three_ds_cancel_button_corner_radius + DefaultValue + 4 + + + Type + PSGroupSpecifier + Title + Resend button customization + + + Type + PSTextFieldSpecifier + Title + Text font name + Key + three_ds_resend_button_text_font_name + DefaultValue + Helvetica + + + Type + PSTextFieldSpecifier + Title + Text color + Key + three_ds_resend_button_text_color + DefaultValue + #FFFFFF + + + Type + PSTextFieldSpecifier + Title + Text font size + Key + three_ds_resend_button_text_font_size + DefaultValue + 16 + + + Type + PSTextFieldSpecifier + Title + Background color + Key + three_ds_resend_button_background_color + DefaultValue + #262626 + + + Type + PSTextFieldSpecifier + Title + Corner radius + Key + three_ds_resend_button_corner_radius + DefaultValue + 4 + + + + diff --git a/Examples/ObjectiveCExampleApp/Podfile b/Examples/ObjectiveCExampleApp/Podfile index 73852904d..1bffa54ef 100644 --- a/Examples/ObjectiveCExampleApp/Podfile +++ b/Examples/ObjectiveCExampleApp/Podfile @@ -5,10 +5,10 @@ inhibit_all_warnings! target 'ObjectiveCExampleApp' do # pod 'Judo3DS2_iOS', :path => '../../../Judo3DS2-iOS-Source' - pod 'Judo3DS2_iOS', '1.1.2' + pod 'Judo3DS2_iOS', '1.1.3' pod 'JudoKit-iOS', :path => '../../' - # pod 'JudoKit-iOS', '3.1.6' + # pod 'JudoKit-iOS', '3.1.7' pod 'MaterialComponents/Snackbar' pod 'InAppSettingsKit', '3.3.6' diff --git a/Examples/ObjectiveCExampleApp/Podfile.lock b/Examples/ObjectiveCExampleApp/Podfile.lock index 766ceed0c..5bee35c58 100644 --- a/Examples/ObjectiveCExampleApp/Podfile.lock +++ b/Examples/ObjectiveCExampleApp/Podfile.lock @@ -4,10 +4,10 @@ PODS: - DeviceDNA (2.0.0): - OpenSSL-Universal (~> 1.1.180) - InAppSettingsKit (3.3.6) - - Judo3DS2_iOS (1.1.2) - - JudoKit-iOS (3.1.6): + - Judo3DS2_iOS (1.1.3) + - JudoKit-iOS (3.1.7): - DeviceDNA (~> 2.0.0) - - Judo3DS2_iOS (~> 1.1.2) + - Judo3DS2_iOS (~> 1.1.3) - TrustKit - ZappMerchantLib - MaterialComponents/AnimationTiming (124.2.0) @@ -87,7 +87,7 @@ DEPENDENCIES: - CocoaDebug (= 1.7.2) - Cucumberish (from `https://github.com/mpetrenco/Cucumberish.git`) - InAppSettingsKit (= 3.3.6) - - Judo3DS2_iOS (= 1.1.2) + - Judo3DS2_iOS (= 1.1.3) - JudoKit-iOS (from `../../`) - MaterialComponents/Snackbar @@ -120,8 +120,8 @@ SPEC CHECKSUMS: Cucumberish: 6cbd0c1f50306b369acebfe7d9f514c9c287d26c DeviceDNA: 9ff289d1fb983937754b324fa0adade2081210c4 InAppSettingsKit: 37df0b44132380d4c7db6fc7cded92997e29873a - Judo3DS2_iOS: 90b820a50035cb08ccc1b2e22900b856132c79a5 - JudoKit-iOS: eabd569f41993ddd46273a63aa5c255cef473308 + Judo3DS2_iOS: b2396a1f0aa3e8d428fdd887c8b6eae5d3aa4f79 + JudoKit-iOS: 9bdb404617132df3a22ce0713b610258fbc9a817 MaterialComponents: 1a9b2d9d45b1601ae544de85089adc4c464306d4 MDFInternationalization: d697c55307816222a55685c4ccb1044ffb030c12 MDFTextAccessibility: f4bb4cc2194286651b59a215fdeaa0e05dc90ba5 @@ -129,6 +129,6 @@ SPEC CHECKSUMS: TrustKit: 610b8c71c07914756dd74c380040a3408a747798 ZappMerchantLib: b14bc5814840426d351190309250347ca9b0983d -PODFILE CHECKSUM: 959926dd8d6e204912c4dfcf372d307df9eafa7f +PODFILE CHECKSUM: 7335da9069483ef75fe17725b8d036a04545b434 COCOAPODS: 1.11.3 diff --git a/Examples/SwiftExampleApp/Podfile b/Examples/SwiftExampleApp/Podfile index a23b29641..53d6bb245 100644 --- a/Examples/SwiftExampleApp/Podfile +++ b/Examples/SwiftExampleApp/Podfile @@ -5,7 +5,7 @@ inhibit_all_warnings! target 'SwiftExampleApp' do # pod 'Judo3DS2_iOS', :path => '../../../Judo3DS2-iOS-Source' - pod 'Judo3DS2_iOS', '1.1.2' + pod 'Judo3DS2_iOS', '1.1.3' pod 'JudoKit-iOS', :path => '../../' pod 'InAppSettingsKit', '3.3.6' diff --git a/JudoKit-iOS.podspec b/JudoKit-iOS.podspec index 739814be7..99b8dfbd2 100755 --- a/JudoKit-iOS.podspec +++ b/JudoKit-iOS.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'JudoKit-iOS' - s.version = '3.1.6' + s.version = '3.1.7' s.summary = 'Judo Pay Full iOS Client Kit' s.homepage = 'https://www.judopay.com/' s.license = 'MIT' @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.dependency 'DeviceDNA', '~> 2.0.0' s.dependency 'TrustKit' s.dependency 'ZappMerchantLib' - s.dependency 'Judo3DS2_iOS', '~> 1.1.2' + s.dependency 'Judo3DS2_iOS', '~> 1.1.3' s.frameworks = 'CoreLocation', 'Security', 'CoreTelephony', 'Vision' s.resource_bundles = { "JudoKit_iOS" => ["Resources/*.lproj/*.strings"] } diff --git a/JudoKit_iOS.xcodeproj/xcshareddata/xcschemes/JudoKit_iOS.xcscheme b/JudoKit_iOS.xcodeproj/xcshareddata/xcschemes/JudoKit_iOS.xcscheme index fbad844f2..f0ac300e8 100644 --- a/JudoKit_iOS.xcodeproj/xcshareddata/xcschemes/JudoKit_iOS.xcscheme +++ b/JudoKit_iOS.xcodeproj/xcshareddata/xcschemes/JudoKit_iOS.xcscheme @@ -47,6 +47,38 @@ BlueprintName = "JudoKit_iOSTests" ReferencedContainer = "container:JudoKit_iOS.xcodeproj"> + + + + + + + + + + + + + + + + + + + + + + diff --git a/Package.resolved b/Package.resolved index 2a9c3e00d..2ed5ba9db 100644 --- a/Package.resolved +++ b/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Judopay/Judo3DS2-iOS", "state" : { - "revision" : "9b7e59569fe326d27614942410639f0a1d0aa1ce", - "version" : "1.1.2" + "revision" : "279c56b10917f02be2e7728c246facb309c92ab8", + "version" : "1.1.3" } }, { diff --git a/Package.swift b/Package.swift index db76203c1..844202b6f 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/Judopay/DeviceDNA-iOS", from: "2.0.0"), - .package(url: "https://github.com/Judopay/Judo3DS2-iOS", from: "1.1.2"), + .package(url: "https://github.com/Judopay/Judo3DS2-iOS", from: "1.1.3"), .package(url: "https://github.com/datatheorem/TrustKit", exact: "1.7.0"), .package(url: "https://github.com/Judopay/pbba-merchant-button-library-ios", from: "3.1.3") ], diff --git a/Source/JudoKit.h b/Source/JudoKit.h index cd82e3877..d5c929133 100644 --- a/Source/JudoKit.h +++ b/Source/JudoKit.h @@ -32,7 +32,7 @@ @protocol JPAuthorization; static NSString *__nonnull const JudoKitName = @"JudoKit_iOS"; -static NSString *__nonnull const JudoKitVersion = @"3.1.6"; +static NSString *__nonnull const JudoKitVersion = @"3.1.7"; @interface JudoKit : NSObject diff --git a/Source/Models/UIConfiguration/JPUIConfiguration.h b/Source/Models/UIConfiguration/JPUIConfiguration.h index 4696b89d1..d923d2de1 100644 --- a/Source/Models/UIConfiguration/JPUIConfiguration.h +++ b/Source/Models/UIConfiguration/JPUIConfiguration.h @@ -24,7 +24,7 @@ #import -@class JPTheme; +@class JPTheme, JP3DSUICustomization; @interface JPUIConfiguration : NSObject @@ -58,4 +58,6 @@ */ @property (nonatomic, strong) JPTheme *theme; +@property (nonatomic, strong, nullable) JP3DSUICustomization *threeDSUICustomization; + @end diff --git a/Source/Modules/Transaction/Presenter/JPTransactionPresenter.m b/Source/Modules/Transaction/Presenter/JPTransactionPresenter.m index 205cfffaf..b374bcb0a 100644 --- a/Source/Modules/Transaction/Presenter/JPTransactionPresenter.m +++ b/Source/Modules/Transaction/Presenter/JPTransactionPresenter.m @@ -29,6 +29,7 @@ #import "JPCardDetailsMode.h" #import "JPCardNetwork.h" #import "JPCardTransactionDetails.h" +#import "JPConstants.h" #import "JPCountry.h" #import "JPError+Additions.h" #import "JPInputType.h" @@ -39,7 +40,6 @@ #import "JPTransactionViewController.h" #import "JPValidationResult.h" #import "NSString+Additions.h" -#import "JPConstants.h" @interface JPTransactionPresenterImpl () @property (nonatomic, strong) JPTransactionViewModel *transactionViewModel; diff --git a/Source/Services/CardTransactionService/JPCardTransactionService.m b/Source/Services/CardTransactionService/JPCardTransactionService.m index 9b9e1e50d..5760d18d7 100644 --- a/Source/Services/CardTransactionService/JPCardTransactionService.m +++ b/Source/Services/CardTransactionService/JPCardTransactionService.m @@ -42,6 +42,7 @@ #import "JPResponse.h" #import "JPSaveCardRequest.h" #import "JPTokenRequest.h" +#import "JPUIConfiguration.h" #import "UIApplication+Additions.h" @interface JP3DSChallengeStatusReceiverImpl : NSObject @@ -132,7 +133,9 @@ - (instancetype)initWithAPIService:(JPApiService *)apiService _configuration = configuration; _apiService = apiService; - [self.threeDSTwoService initializeWithConfigParameters:self.threeDSTwoConfigParameters locale:nil uiCustomization:nil]; + [self.threeDSTwoService initializeWithConfigParameters:self.threeDSTwoConfigParameters + locale:nil + uiCustomization:configuration.uiConfiguration.threeDSUICustomization]; } return self; } @@ -144,7 +147,7 @@ - (instancetype)initWithAuthorization:(id)authorization _configuration = configuration; _apiService = [[JPApiService alloc] initWithAuthorization:authorization isSandboxed:sandboxed]; - [self.threeDSTwoService initializeWithConfigParameters:self.threeDSTwoConfigParameters locale:nil uiCustomization:nil]; + [self.threeDSTwoService initializeWithConfigParameters:self.threeDSTwoConfigParameters locale:nil uiCustomization:configuration.uiConfiguration.threeDSUICustomization]; } return self; } diff --git a/Source/View/CardInputView/JPCardInputView.m b/Source/View/CardInputView/JPCardInputView.m index 882b51424..ceb4811ec 100644 --- a/Source/View/CardInputView/JPCardInputView.m +++ b/Source/View/CardInputView/JPCardInputView.m @@ -25,6 +25,7 @@ #import "JPCardDetailsMode.h" #import "JPCardInputField.h" #import "JPCardNumberField.h" +#import "JPConstants.h" #import "JPCountry.h" #import "JPLoadingButton.h" #import "JPRoundedCornerView.h" @@ -35,7 +36,6 @@ #import "UIImage+Additions.h" #import "UIStackView+Additions.h" #import "UIView+Additions.h" -#import "JPConstants.h" @interface JPCardInputView ()