From 62ec22e874bf19a8f6791f1ae91e02eb9d2bb55a Mon Sep 17 00:00:00 2001 From: MahmoudAllam Date: Mon, 1 Jul 2024 17:29:42 +0300 Subject: [PATCH 1/3] Remove phone number validations --- goSellSDK/Core/API/Public/Models/PhoneNumber.swift | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/goSellSDK/Core/API/Public/Models/PhoneNumber.swift b/goSellSDK/Core/API/Public/Models/PhoneNumber.swift index 7fb945fb..54ae8b74 100644 --- a/goSellSDK/Core/API/Public/Models/PhoneNumber.swift +++ b/goSellSDK/Core/API/Public/Models/PhoneNumber.swift @@ -30,20 +30,6 @@ let isd = PhoneNumber.extractISDNumber(from: isdNumber) let number = phoneNumber - guard isd.tap_length > 0 && isd.tap_containsOnlyInternationalDigits else { - - let userInfo = [ErrorConstants.UserInfoKeys.isdNumber: isd] - let underlyingError = NSError(domain: ErrorConstants.internalErrorDomain, code: InternalError.invalidISDNumber.rawValue, userInfo: userInfo) - throw TapSDKKnownError(type: .internal, error: underlyingError, response: nil, body: nil) - } - - guard number.tap_length > 0 && number.tap_containsOnlyInternationalDigits else { - - let userInfo = [ErrorConstants.UserInfoKeys.phoneNumber: number] - let underlyingError = NSError(domain: ErrorConstants.internalErrorDomain, code: InternalError.invalidPhoneNumber.rawValue, userInfo: userInfo) - throw TapSDKKnownError(type: .internal, error: underlyingError, response: nil, body: nil) - } - self.isdNumber = isd self.phoneNumber = number From 7c5ad75388db6c61fd361a8890dca70a53cb7364 Mon Sep 17 00:00:00 2001 From: MahmoudAllam Date: Mon, 1 Jul 2024 17:39:12 +0300 Subject: [PATCH 2/3] Update podspec --- goSellSDK.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goSellSDK.podspec b/goSellSDK.podspec index 3265b6b0..620844ea 100644 --- a/goSellSDK.podspec +++ b/goSellSDK.podspec @@ -6,7 +6,7 @@ Pod::Spec.new do |goSellSDK| goSellSDK.name = 'goSellSDK' goSellSDK.summary = 'goSell SDK for iOS' goSellSDK.requires_arc = true - goSellSDK.version = '2.3.33' + goSellSDK.version = '2.3.34' goSellSDK.license = { :type => 'MIT', :file => 'LICENSE' } goSellSDK.author = { 'Tap Payments' => 'hello@tap.company' } goSellSDK.homepage = 'https://github.com/Tap-Payments/goSellSDK-iOS' From 9555bb30dd14ad0477e4ed03f0b09f1ccb4062f9 Mon Sep 17 00:00:00 2001 From: MahmoudAllam Date: Mon, 1 Jul 2024 17:46:48 +0300 Subject: [PATCH 3/3] Decode number with default value --- goSellSDK/Core/API/Public/Models/PhoneNumber.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/goSellSDK/Core/API/Public/Models/PhoneNumber.swift b/goSellSDK/Core/API/Public/Models/PhoneNumber.swift index 54ae8b74..c5258323 100644 --- a/goSellSDK/Core/API/Public/Models/PhoneNumber.swift +++ b/goSellSDK/Core/API/Public/Models/PhoneNumber.swift @@ -123,8 +123,8 @@ extension PhoneNumber: Decodable { let container = try decoder.container(keyedBy: CodingKeys.self) - let isdNumber = try container.decode(String.self, forKey: .isdNumber) - let phoneNumber = try container.decode(String.self, forKey: .phoneNumber) + let isdNumber = try container.decodeIfPresent(String.self, forKey: .isdNumber) ?? "" + let phoneNumber = try container.decodeIfPresent(String.self, forKey: .phoneNumber) ?? "" try self.init(isdNumber: isdNumber, phoneNumber: phoneNumber) }