-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for 3D Secure process with resource ID
- Introduce new method `startThreeDSecureProcess(viewController:delegate:resourceId:)` in ThreeDSecureProcessHandler - Add `makeTdsEntryUrl(resourceId:)` method to ThreeDSecureURLConfiguration - Mark previous token-based method as deprecated - Update tests to support new resource ID-based 3D Secure process
- Loading branch information
Showing
7 changed files
with
91 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
Tests/ThreeDSecure/ThreeDSecureURLConfigurationTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import XCTest | ||
@testable import PAYJP | ||
|
||
class ThreeDSecureURLConfigurationTests: XCTestCase { | ||
override func setUp() { | ||
super.setUp() | ||
|
||
PAYJPSDK.publicKey = "public_key" | ||
} | ||
|
||
func testMakeTdsEntryUrl() { | ||
let redirectURL = URL(string: "test://")! | ||
let redirectURLKey = "test" | ||
let configuration = ThreeDSecureURLConfiguration(redirectURL: redirectURL, redirectURLKey: redirectURLKey) | ||
let resourceId = "ch_123" | ||
let expectedUrlString = "\(PAYJPApiEndpoint)tds/\(resourceId)/start?publickey=\(PAYJPSDK.publicKey!)&back=\(redirectURLKey)" | ||
let tdsEntryUrl = configuration.makeTdsEntryUrl(resourceId: resourceId) | ||
|
||
XCTAssertEqual(tdsEntryUrl.absoluteString, expectedUrlString) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters