diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 22a2c3f1..16b11731 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,13 +15,13 @@ jobs: runs-on: macos-14 timeout-minutes: 30 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install HomeBrew run: | brew bundle || true cat Brewfile.lock.json || true - run: xcodebuild -version - - uses: actions/cache@v4 + - uses: actions/cache@v5 with: path: vendor/bundle key: ${{ runner.os }}-gems-${{ env.CACHE_NUMBER }}-${{ hashFiles('**/Gemfile.lock') }} @@ -32,7 +32,7 @@ jobs: bundle config set deployment 'true' bundle config set clean 'true' bundle install --jobs 4 --retry 3 - - uses: actions/cache@v4 + - uses: actions/cache@v5 with: path: Carthage key: ${{ runner.os }}-carthage-${{ env.CACHE_NUMBER }}-${{ hashFiles('Cartfile.resolved') }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 60a5c7de..48a14105 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ jobs: runs-on: macos-14 timeout-minutes: 30 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Gems run: | bundle config set deployment 'true' diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml index d9d2859c..56ea4ab3 100644 --- a/.github/workflows/update-docs.yml +++ b/.github/workflows/update-docs.yml @@ -11,13 +11,13 @@ jobs: runs-on: macos-14 timeout-minutes: 30 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Install HomeBrew run: | brew bundle || true cat Brewfile.lock.json || true - run: xcodebuild -version - - uses: actions/cache@v2 + - uses: actions/cache@v5 with: path: vendor/bundle key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} diff --git a/.gitignore b/.gitignore index f5cc1bae..a1876b12 100644 --- a/.gitignore +++ b/.gitignore @@ -80,4 +80,5 @@ docs/docsets/*.tgz Brewfile.lock.json # Claude Code -.claude \ No newline at end of file +.claude +.serena \ No newline at end of file diff --git a/example-swift/example-swift-ui/CardFormViewControllerExampleView.swift b/example-swift/example-swift-ui/CardFormViewControllerExampleView.swift index c53abef5..fffadf69 100644 --- a/example-swift/example-swift-ui/CardFormViewControllerExampleView.swift +++ b/example-swift/example-swift-ui/CardFormViewControllerExampleView.swift @@ -22,7 +22,7 @@ struct CardFormViewControllerExampleView: View { class CardFormDelegate: ObservableObject, CardFormViewControllerDelegate { @Published var isPresented: Bool = false - + func cardFormViewController(_: CardFormViewController, didCompleteWith result: CardFormResult) { switch result { case .cancel: @@ -34,7 +34,7 @@ class CardFormDelegate: ObservableObject, CardFormViewControllerDelegate { } } } - + func cardFormViewController(_: CardFormViewController, didProduced token: Token, completionHandler: @escaping (Error?) -> Void) { @@ -48,7 +48,7 @@ class CardFormDelegate: ObservableObject, CardFormViewControllerDelegate { struct CardFormViewControllerWrapper: UIViewControllerRepresentable { weak var delegate: CardFormViewControllerDelegate! - + func makeUIViewController(context: Context) -> UINavigationController { let cardFormVc = CardFormViewController.createCardFormViewController(delegate: delegate, viewType: .displayStyled) @@ -56,9 +56,9 @@ struct CardFormViewControllerWrapper: UIViewControllerRepresentable { naviVc.presentationController?.delegate = cardFormVc return naviVc } - + func updateUIViewController(_ uiViewController: UINavigationController, context: Context) { } - + typealias UIViewControllerType = UINavigationController } diff --git a/example-swift/example-swift-ui/ContentView.swift b/example-swift/example-swift-ui/ContentView.swift index 7fcd6084..d6be063a 100644 --- a/example-swift/example-swift-ui/ContentView.swift +++ b/example-swift/example-swift-ui/ContentView.swift @@ -27,7 +27,6 @@ struct ContentView: View { } } - // MARK: - Preview struct ContentView_Previews: PreviewProvider { diff --git a/example-swift/example-swift-ui/SceneDelegate.swift b/example-swift/example-swift-ui/SceneDelegate.swift index beba0fdc..a8b0f8c3 100644 --- a/example-swift/example-swift-ui/SceneDelegate.swift +++ b/example-swift/example-swift-ui/SceneDelegate.swift @@ -29,13 +29,13 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { window.makeKeyAndVisible() } } - + func scene(_ scene: UIScene, openURLContexts URLContexts: Set) { guard let urlContext = URLContexts.first else { return } let url = urlContext.url ThreeDSecureProcessHandler.shared.completeThreeDSecureProcess(url: url) } - + func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. diff --git a/example-swift/example-swift-ui/ThreeDSecureProcessHandlerExampleView.swift b/example-swift/example-swift-ui/ThreeDSecureProcessHandlerExampleView.swift index ef88715d..ebbb4f97 100644 --- a/example-swift/example-swift-ui/ThreeDSecureProcessHandlerExampleView.swift +++ b/example-swift/example-swift-ui/ThreeDSecureProcessHandlerExampleView.swift @@ -11,7 +11,7 @@ class ThreeDSecureViewModel: ObservableObject, ThreeDSecureProcessHandlerDelegat @Published var resultMessage: String = "" @Published var showResult: Bool = false @Published var isError: Bool = false - + func startThreeDSecureProcess() { guard !pendingResourceId.isEmpty, let rootViewController = UIApplication.shared.windows.first?.rootViewController else { @@ -24,7 +24,7 @@ class ThreeDSecureViewModel: ObservableObject, ThreeDSecureProcessHandlerDelegat resourceId: pendingResourceId ) } - + // MARK: - ThreeDSecureProcessHandlerDelegate func threeDSecureProcessHandlerDidFinish(_ handler: ThreeDSecureProcessHandler, status: ThreeDSecureProcessStatus) { switch status { @@ -50,7 +50,7 @@ class ThreeDSecureViewModel: ObservableObject, ThreeDSecureProcessHandlerDelegat struct ThreeDSecureProcessHandlerExampleView: View { @ObservedObject private var viewModel = ThreeDSecureViewModel() - + var body: some View { ScrollView { VStack(alignment: .leading, spacing: 20) { @@ -60,13 +60,13 @@ struct ThreeDSecureProcessHandlerExampleView: View { .padding() .border(Color.gray, width: 1) .padding(.horizontal) - + if viewModel.showResult { Text(viewModel.resultMessage) .foregroundColor(viewModel.isError ? .red : .black) .padding(.horizontal) } - + Button(action: { // 3) Call the view model's start function viewModel.startThreeDSecureProcess() @@ -76,10 +76,10 @@ struct ThreeDSecureProcessHandlerExampleView: View { .frame(maxWidth: .infinity, alignment: .center) } .padding(.horizontal) - + VStack(alignment: .leading, spacing: 12) { Text("1.下記を参考に、先にサーバーサイドで支払い、または3Dセキュアリクエストを作成してください。") - + Text("支払い作成時の3Dセキュア:") if let url = URL(string: "https://pay.jp/docs/charge-tds") { Button(action: { @@ -89,7 +89,7 @@ struct ThreeDSecureProcessHandlerExampleView: View { .foregroundColor(.blue) } } - + Text("顧客カードに対する3Dセキュア:") if let url = URL(string: "https://pay.jp/docs/customer-card-tds") { Button(action: { @@ -101,10 +101,10 @@ struct ThreeDSecureProcessHandlerExampleView: View { } } .padding(.horizontal) - + VStack(alignment: .leading, spacing: 12) { Text("2. 作成したリソースのIDを上記に入力して3Dセキュアを開始してください。") - + Text("3.立ち上がった画面が閉じ、認証が終了したら、ドキュメントを参考にサーバーサイドにて結果を確認してください。") } .padding(.horizontal) diff --git a/example-swift/example-swift/CardFormViewWith3DSViewController.swift b/example-swift/example-swift/CardFormViewWith3DSViewController.swift index 65310fe8..803f3af9 100644 --- a/example-swift/example-swift/CardFormViewWith3DSViewController.swift +++ b/example-swift/example-swift/CardFormViewWith3DSViewController.swift @@ -33,15 +33,15 @@ class CardFormViewWith3DSViewController: UIViewController { self.formContentView.addSubview(cardFormView) NotificationCenter.default.addObserver(self, - selector: #selector(handleTokenOperationStatusChange(notification:)), - name: .payjpTokenOperationStatusChanged, - object: nil) - + selector: #selector(handleTokenOperationStatusChange(notification:)), + name: .payjpTokenOperationStatusChanged, + object: nil) + } @objc private func handleTokenOperationStatusChange(notification: Notification) { if let value = notification.userInfo?[PAYNotificationKey.newTokenOperationStatus] as? Int, - let newStatus = TokenOperationStatus.init(rawValue: value) { + let newStatus = TokenOperationStatus.init(rawValue: value) { self.tokenOperationStatus = newStatus self.updateButtonEnabled() } @@ -66,9 +66,9 @@ class CardFormViewWith3DSViewController: UIViewController { case .success(let token): DispatchQueue.main.async { if let tdsStatus = token.card.threeDSecureStatus, tdsStatus == .unverified { - self.pendingToken = token - ThreeDSecureProcessHandler.shared.startThreeDSecureProcess(viewController: self, delegate: self, resourceId: token.identifer) - return + self.pendingToken = token + ThreeDSecureProcessHandler.shared.startThreeDSecureProcess(viewController: self, delegate: self, resourceId: token.identifer) + return } self.tokenIdLabel.text = token.identifer self.showToken(token: token) @@ -112,7 +112,7 @@ class CardFormViewWith3DSViewController: UIViewController { } } } - } +} // MARK: - CardFormViewDelegate @@ -142,4 +142,3 @@ extension CardFormViewWith3DSViewController: ThreeDSecureProcessHandlerDelegate } } } - diff --git a/example-swift/example-swift/ThreeDSecureExampleViewController.swift b/example-swift/example-swift/ThreeDSecureExampleViewController.swift index 4637d496..72214665 100644 --- a/example-swift/example-swift/ThreeDSecureExampleViewController.swift +++ b/example-swift/example-swift/ThreeDSecureExampleViewController.swift @@ -8,24 +8,20 @@ import PAYJP class ThreeDSecureExampleViewController: UIViewController { @IBOutlet private var startButton: UIButton! - + @IBOutlet private var textField: UITextField! - + @IBOutlet private var resultLabel: UILabel! - + private var pendingResourceId: String? - - override func viewDidLoad() { - super.viewDidLoad() - } - + @IBAction private func startThreeDSecure(_ sender: Any) { guard let resourceId = textField.text, !resourceId.isEmpty else { self.resultLabel.text = "" self.resultLabel.isHidden = true return } - + pendingResourceId = resourceId ThreeDSecureProcessHandler.shared.startThreeDSecureProcess(viewController: self, delegate: self, resourceId: resourceId) } diff --git a/example-swift/example-swift/ViewController.swift b/example-swift/example-swift/ViewController.swift index 8bb8c70d..d5a9e525 100644 --- a/example-swift/example-swift/ViewController.swift +++ b/example-swift/example-swift/ViewController.swift @@ -26,10 +26,6 @@ class ViewController: UITableViewController { case TokenId = 2 } - override func viewDidLoad() { - super.viewDidLoad() - } - override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { switch CellSection(rawValue: indexPath.section) { case .CreateToken?: