Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

「支払い時」「顧客カードに対する3Dセキュア」に対応 #95

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

laiso
Copy link
Contributor

@laiso laiso commented Jan 29, 2025

既存のstartThreeDSecureProcessメソッドはトークン作成時の3Dセキュア認証のみを受け付けており、「支払い時」「顧客カードに対する3Dセキュア」に対応できていないため以下の新しいメソッドを追加します。

  1. ThreeDSecureProcessHandlerTypeに新しいメソッドを追加:
func startThreeDSecureProcess(viewController: UIViewController,
                            delegate: ThreeDSecureProcessHandlerDelegate, 
                            resourceId: String)
  1. 既存のトークンベースのメソッドを非推奨(deprecated)に設定:
    @available(*, deprecated, message: "Use startThreeDSecureProcess(viewController:delegate:resourceId:) instead.")
    func startThreeDSecureProcess(viewController: UIViewController,
                                  delegate: ThreeDSecureProcessHandlerDelegate,
                                  token: Token)

laiso added 2 commits January 28, 2025 21:35
- 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
Copy link
Contributor

@yatatsu yatatsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。2点コメントしました。

@@ -46,19 +51,33 @@ class ThreeDSecureProcessHandlerTests: XCTestCase {
XCTAssertEqual(mockDriver.openWebBrowserUrl?.absoluteString, token.tdsEntryUrl.absoluteString)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

例えばですが、Token.tdsEntryUrl を利用している箇所は追加いただいた PAYJPSDK.threeDSecureURLConfiguration?.makeTdsEntryUrl で代替可能に見えますがどうでしょうか?
Token 側の extension を消す( public ではないので非推奨ではなく削除する)とロジックを集約できるメリットがあると思いました。

@@ -19,4 +19,15 @@ public class ThreeDSecureURLConfiguration: NSObject {
self.redirectURL = redirectURL
self.redirectURLKey = redirectURLKey
}

public func makeTdsEntryUrl(resourceId: String) -> URL {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public な関数であれば略語より ThreeDSecure を使うとよりベターです。
makeThreeDSecureEntryURL(resouceId: String)

Copy link
Contributor

@natsuki-yamanaka natsuki-yamanaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これ用のexampleも用意できると嬉しいなーって気がしてます

public func startThreeDSecureProcess(viewController: UIViewController,
delegate: ThreeDSecureProcessHandlerDelegate,
token: Token) {
self.delegate = delegate
webDriver.openWebBrowser(host: viewController, url: token.tdsEntryUrl, delegate: self)
}

public func startThreeDSecureProcess(viewController: UIViewController,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@objc つけないとobjective-c側で呼び出せなそうですかね。
ThreeDSecureProcessHandlerDelegateにもつけないとダメそうです。

laiso added 2 commits January 29, 2025 20:03
- Remove `tdsEntryUrl` method from Token model
- Update ThreeDSecureProcessHandler to use new URL configuration method
- Modify test to use new URL generation approach
- Rename `makeTdsEntryUrl` to `makeThreeDSecureEntryURL` in ThreeDSecureURLConfiguration
- Update method calls in ThreeDSecureProcessHandler and tests
- Improve method naming for better readability
@laiso laiso force-pushed the laiso/3ds branch 2 times, most recently from ef79211 to 319563c Compare January 30, 2025 17:08
- Add Objective-C compatibility annotations to ThreeDSecureProcessHandler
- Update example Objective-C app to handle 3D Secure verification flow
- Implement 3D Secure delegate methods in CardFormViewScrollViewController
- Add pending token handling for 3D Secure verification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants