Skip to content

Commit

Permalink
Merge pull request #65 from Tap-Payments/remove_phone_num_validations
Browse files Browse the repository at this point in the history
Remove phone number validations
  • Loading branch information
OsamaRabie authored Jul 1, 2024
2 parents 1bc066a + 9555bb3 commit 5158eb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
2 changes: 1 addition & 1 deletion goSellSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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' => '[email protected]' }
goSellSDK.homepage = 'https://github.com/Tap-Payments/goSellSDK-iOS'
Expand Down
18 changes: 2 additions & 16 deletions goSellSDK/Core/API/Public/Models/PhoneNumber.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -137,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)
}
Expand Down

0 comments on commit 5158eb4

Please sign in to comment.