diff --git a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp.xcodeproj/project.pbxproj b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp.xcodeproj/project.pbxproj index b0734bd5a..4d8ae4baa 100644 --- a/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp.xcodeproj/project.pbxproj +++ b/Examples/ObjectiveCExampleApp/ObjectiveCExampleApp.xcodeproj/project.pbxproj @@ -1091,7 +1091,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.1.3; + MARKETING_VERSION = 3.1.4; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.judo.JudoPayDemoObjC; PRODUCT_NAME = "Judopay demo"; @@ -1116,7 +1116,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.1.3; + MARKETING_VERSION = 3.1.4; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.judo.JudoPayDemoObjC; PRODUCT_NAME = "Judopay demo"; diff --git a/Examples/ObjectiveCExampleApp/Podfile b/Examples/ObjectiveCExampleApp/Podfile index ce4111b76..a1b96c9de 100644 --- a/Examples/ObjectiveCExampleApp/Podfile +++ b/Examples/ObjectiveCExampleApp/Podfile @@ -8,7 +8,7 @@ target 'ObjectiveCExampleApp' do pod 'Judo3DS2_iOS', '1.1.1' pod 'JudoKit-iOS', :path => '../../' - # pod 'JudoKit-iOS', '3.1.3' + # pod 'JudoKit-iOS', '3.1.4' pod 'MaterialComponents/Snackbar' pod 'InAppSettingsKit', '3.3.6' diff --git a/Examples/ObjectiveCExampleApp/Podfile.lock b/Examples/ObjectiveCExampleApp/Podfile.lock index 6b8177330..8ef0f8f5d 100644 --- a/Examples/ObjectiveCExampleApp/Podfile.lock +++ b/Examples/ObjectiveCExampleApp/Podfile.lock @@ -5,7 +5,7 @@ PODS: - OpenSSL-Universal (~> 1.1.180) - InAppSettingsKit (3.3.6) - Judo3DS2_iOS (1.1.1) - - JudoKit-iOS (3.1.3): + - JudoKit-iOS (3.1.4): - DeviceDNA (~> 2.0.0) - Judo3DS2_iOS (~> 1.1.1) - TrustKit @@ -121,7 +121,7 @@ SPEC CHECKSUMS: DeviceDNA: 9ff289d1fb983937754b324fa0adade2081210c4 InAppSettingsKit: 37df0b44132380d4c7db6fc7cded92997e29873a Judo3DS2_iOS: 1699474533e69b69593c6a76b42645cb240f618a - JudoKit-iOS: 5cf695508b309a32de91cf295dd6ad1dbd6da7b7 + JudoKit-iOS: b27be15d89a866fc631cb41e8b1bf858bd7ef922 MaterialComponents: 1a9b2d9d45b1601ae544de85089adc4c464306d4 MDFInternationalization: d697c55307816222a55685c4ccb1044ffb030c12 MDFTextAccessibility: f4bb4cc2194286651b59a215fdeaa0e05dc90ba5 @@ -129,6 +129,6 @@ SPEC CHECKSUMS: TrustKit: 610b8c71c07914756dd74c380040a3408a747798 ZappMerchantLib: b14bc5814840426d351190309250347ca9b0983d -PODFILE CHECKSUM: 329b62a1c91d513968575fafa51d80b66ae2b98c +PODFILE CHECKSUM: ab6d39957f7926b3c432c44c02a79a5b0569bf12 COCOAPODS: 1.11.3 diff --git a/Examples/SwiftExampleApp/Podfile.lock b/Examples/SwiftExampleApp/Podfile.lock index a88f83830..3141567c9 100644 --- a/Examples/SwiftExampleApp/Podfile.lock +++ b/Examples/SwiftExampleApp/Podfile.lock @@ -4,7 +4,7 @@ PODS: - OpenSSL-Universal (~> 1.1.180) - InAppSettingsKit (3.3.6) - Judo3DS2_iOS (1.1.1) - - JudoKit-iOS (3.1.3): + - JudoKit-iOS (3.1.4): - DeviceDNA (~> 2.0.0) - Judo3DS2_iOS (~> 1.1.1) - TrustKit @@ -41,7 +41,7 @@ SPEC CHECKSUMS: DeviceDNA: 9ff289d1fb983937754b324fa0adade2081210c4 InAppSettingsKit: 37df0b44132380d4c7db6fc7cded92997e29873a Judo3DS2_iOS: 1699474533e69b69593c6a76b42645cb240f618a - JudoKit-iOS: 3d32a771a931398754d256a1f174e8510e5446f4 + JudoKit-iOS: b27be15d89a866fc631cb41e8b1bf858bd7ef922 OpenSSL-Universal: ee0a7a25f2042782e2df405e66db3e429198e392 SwiftLint: 32ee33ded0636d0905ef6911b2b67bbaeeedafa5 TrustKit: dad4c3a08248c21fcb9a3b5be3c2e2b9d4f9b973 diff --git a/JudoKit-iOS.podspec b/JudoKit-iOS.podspec index be2ab5cf9..75e1ea1a0 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.3' + s.version = '3.1.4' s.summary = 'Judo Pay Full iOS Client Kit' s.homepage = 'https://www.judopay.com/' s.license = 'MIT' diff --git a/Source/JudoKit.h b/Source/JudoKit.h index 903a25d8b..3cc60d2aa 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.3"; +static NSString *__nonnull const JudoKitVersion = @"3.1.4"; @interface JudoKit : NSObject diff --git a/Source/Models/ApplePayWrappers/JPApplePayWrappers.m b/Source/Models/ApplePayWrappers/JPApplePayWrappers.m index a17796651..f8c65bbab 100644 --- a/Source/Models/ApplePayWrappers/JPApplePayWrappers.m +++ b/Source/Models/ApplePayWrappers/JPApplePayWrappers.m @@ -135,7 +135,7 @@ + (PKShippingType)pkShippingTypeForConfiguration:(JPConfiguration *)configuratio if (cardNetworks & JPCardNetworkTypeMasterCard) { [pkPaymentNetworks addObject:PKPaymentNetworkMasterCard]; } - + if (cardNetworks & JPCardNetworkTypeAMEX) { [pkPaymentNetworks addObject:PKPaymentNetworkAmex]; } diff --git a/Source/Models/Response/JPResponse.m b/Source/Models/Response/JPResponse.m index 2b6ef4676..59cc832ac 100644 --- a/Source/Models/Response/JPResponse.m +++ b/Source/Models/Response/JPResponse.m @@ -29,6 +29,17 @@ #import "JPConsumer.h" #import "JPOrderDetails.h" +static NSString *const kStatusDeclined = @"declined"; +static NSString *const kStatusSuccess = @"success"; +static NSString *const kStatusError = @"error"; + +static NSString *const kTransactionTypePayment = @"payment"; +static NSString *const kTransactionTypePreAuth = @"preauth"; +static NSString *const kTransactionTypeRegister = @"register"; +static NSString *const kTransactionTypeRegisterCard = @"registercard"; +static NSString *const kTransactionTypeSaveCard = @"save"; +static NSString *const kTransactionTypeCheckCard = @"checkcard"; + @implementation JPResponse - (instancetype)initWithDictionary:(NSDictionary *)dictionary { @@ -112,23 +123,47 @@ - (void)setupIDEALFromDictionary:(NSDictionary *)dictionary { } - (JPTransactionResult)transactionResultForString:(NSString *)resultString { - if ([resultString isEqualToString:@"Declined"]) { + NSString *result = resultString.lowercaseString; + + if ([result isEqualToString:kStatusSuccess]) { + return JPTransactionResultSuccess; + } + + if ([result isEqualToString:kStatusDeclined]) { return JPTransactionResultDeclined; } - return JPTransactionResultSuccess; + + if ([result isEqualToString:kStatusError]) { + return JPTransactionResultError; + } + + return JPTransactionResultUnknown; } - (JPTransactionType)transactionTypeForString:(NSString *)typeString { - if ([typeString isEqualToString:@"PreAuth"]) { + NSString *type = typeString.lowercaseString; + + if ([type isEqualToString:kTransactionTypePayment]) { + return JPTransactionTypePayment; + } + + if ([type isEqualToString:kTransactionTypePreAuth]) { return JPTransactionTypePreAuth; - } else if ([typeString isEqualToString:@"RegisterCard"]) { + } + + if ([type isEqualToString:kTransactionTypeRegister] || [type isEqualToString:kTransactionTypeRegisterCard]) { return JPTransactionTypeRegisterCard; - } else if ([typeString isEqualToString:@"Save"]) { - return JPTransactionTypeSaveCard; - } else if ([typeString isEqualToString:@"CheckCard"]) { + } + + if ([type isEqualToString:kTransactionTypeCheckCard]) { return JPTransactionTypeCheckCard; } - return JPTransactionTypePayment; + + if ([type isEqualToString:kTransactionTypeSaveCard]) { + return JPTransactionTypeSaveCard; + } + + return JPTransactionTypeUnknown; } @end diff --git a/Source/Models/Transaction/JPTransactionResult.h b/Source/Models/Transaction/JPTransactionResult.h index 2d4dbd9df..797f1f749 100644 --- a/Source/Models/Transaction/JPTransactionResult.h +++ b/Source/Models/Transaction/JPTransactionResult.h @@ -25,7 +25,8 @@ #import typedef NS_ENUM(NSUInteger, JPTransactionResult) { - JPTransactionResultSuccess, - JPTransactionResultDeclined, - JPTransactionResultError + JPTransactionResultError = 0, + JPTransactionResultSuccess = 1, + JPTransactionResultDeclined = 2, + JPTransactionResultUnknown = NSUIntegerMax }; diff --git a/Source/Models/Transaction/JPTransactionType.h b/Source/Models/Transaction/JPTransactionType.h index 6efe0f704..8d073d36a 100644 --- a/Source/Models/Transaction/JPTransactionType.h +++ b/Source/Models/Transaction/JPTransactionType.h @@ -28,9 +28,10 @@ * An enum that defines the transaction type */ typedef NS_ENUM(NSUInteger, JPTransactionType) { - JPTransactionTypePayment, - JPTransactionTypePreAuth, - JPTransactionTypeRegisterCard, - JPTransactionTypeCheckCard, - JPTransactionTypeSaveCard + JPTransactionTypePayment = 1, + JPTransactionTypePreAuth = 2, + JPTransactionTypeRegisterCard = 3, + JPTransactionTypeCheckCard = 4, + JPTransactionTypeSaveCard = 5, + JPTransactionTypeUnknown = NSUIntegerMax }; diff --git a/Source/Modules/PaymentMethods/Interactor/JPPaymentMethodsInteractor.m b/Source/Modules/PaymentMethods/Interactor/JPPaymentMethodsInteractor.m index 621a22d7a..b01d5f461 100644 --- a/Source/Modules/PaymentMethods/Interactor/JPPaymentMethodsInteractor.m +++ b/Source/Modules/PaymentMethods/Interactor/JPPaymentMethodsInteractor.m @@ -231,6 +231,8 @@ - (void)paymentTransactionWithStoredCardDetails:(JPStoredCardDetails *)details JPCardTransactionDetails *transactionDetails = [[JPCardTransactionDetails alloc] initWithConfiguration:self.configuration andStoredCardDetails:details]; + transactionDetails.secureCode = securityCode; + switch (self.transactionMode) { case JPTransactionTypePreAuth: [self.transactionService invokePreAuthTokenPaymentWithDetails:transactionDetails andCompletion:completion]; diff --git a/Source/Services/CardValidation/JPCardValidationService.m b/Source/Services/CardValidation/JPCardValidationService.m index 2d82dfc29..40e5c9794 100644 --- a/Source/Services/CardValidation/JPCardValidationService.m +++ b/Source/Services/CardValidation/JPCardValidationService.m @@ -360,7 +360,7 @@ - (JPValidationResult *)validateFifthExpiryDigitInput:(NSString *)input { int currentYear = 0; int inputMonth = 0; int inputYear = 0; - + if (currentDateComponents.count == 2) { currentMonth = currentDateComponents.firstObject.intValue; currentYear = currentDateComponents.lastObject.intValue; @@ -370,7 +370,7 @@ - (JPValidationResult *)validateFifthExpiryDigitInput:(NSString *)input { inputMonth = inputDateComponents.firstObject.intValue; inputYear = inputDateComponents.lastObject.intValue; } - + if (inputYear < currentYear) { self.lastExpiryDateValidationResult = [JPValidationResult validationWithResult:NO inputAllowed:YES