Skip to content

Commit 83270ee

Browse files
committed
Steven PR feedback: change back CardClientError.canceled to .threeDSecureCanceled
1 parent 986eabd commit 83270ee

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Diff for: Sources/CardPayments/CardClient.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public class CardClient: NSObject {
170170
if let error = error {
171171
switch error {
172172
case ASWebAuthenticationSessionError.canceledLogin:
173-
self.notifyCheckoutCancelWithError(with: CardClientError.canceled, completion: completion)
173+
self.notifyCheckoutCancelWithError(with: CardClientError.threeDSecureCanceled, completion: completion)
174174
return
175175
default:
176176
self.notifyCheckoutFailure(with: CardClientError.threeDSecureError(error), completion: completion)
@@ -206,7 +206,7 @@ public class CardClient: NSObject {
206206
if let error = error {
207207
switch error {
208208
case ASWebAuthenticationSessionError.canceledLogin:
209-
self.notifyVaultCancelWithError(with: CardClientError.canceled, completion: completion)
209+
self.notifyVaultCancelWithError(with: CardClientError.threeDSecureCanceled, completion: completion)
210210
return
211211
default:
212212
self.notifyVaultFailure(with: CardClientError.threeDSecureError(error), completion: completion)

Diff for: Sources/CardPayments/CardClientError.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ enum CardClientError {
3939
case malformedDeeplinkURLError
4040

4141
/// 10. Cancellation from 3DS verification
42-
case canceledError
42+
case threeDSCancellationError
4343
}
4444

4545
static let unknownError = CoreSDKError(
@@ -68,8 +68,8 @@ enum CardClientError {
6868
errorDescription: "An invalid 3DS URL was returned. Contact developer.paypal.com/support."
6969
)
7070

71-
static let canceled = CoreSDKError(
72-
code: Code.canceledError.rawValue,
71+
static let threeDSecureCanceled = CoreSDKError(
72+
code: Code.threeDSCancellationError.rawValue,
7373
domain: domain,
7474
errorDescription: "3DS verification has been canceled by the user."
7575
)

Diff for: UnitTests/CardPaymentsTests/CardClient_Tests.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ class CardClient_Tests: XCTestCase {
203203
XCTAssertNil(result)
204204
if let error = error as? CoreSDKError {
205205
XCTAssertEqual(error.domain, CardClientError.domain)
206-
XCTAssertEqual(error.code, CardClientError.Code.canceledError.rawValue)
207-
XCTAssertEqual(error.localizedDescription, CardClientError.canceled.localizedDescription)
206+
XCTAssertEqual(error.code, CardClientError.Code.threeDSCancellationError.rawValue)
207+
XCTAssertEqual(error.localizedDescription, CardClientError.threeDSecureCanceled.localizedDescription)
208208
} else {
209209
XCTFail("Expected error to be of type CoreSDKError")
210210
}
@@ -361,8 +361,8 @@ class CardClient_Tests: XCTestCase {
361361
XCTAssertNil(result)
362362
if let error = error as? CoreSDKError {
363363
XCTAssertEqual(error.domain, CardClientError.domain)
364-
XCTAssertEqual(error.code, CardClientError.canceled.code)
365-
XCTAssertEqual(error.localizedDescription, CardClientError.canceled.localizedDescription)
364+
XCTAssertEqual(error.code, CardClientError.threeDSecureCanceled.code)
365+
XCTAssertEqual(error.localizedDescription, CardClientError.threeDSecureCanceled.localizedDescription)
366366
} else {
367367
XCTFail("Expected error to be of type CoreSDKError")
368368
}

0 commit comments

Comments
 (0)