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

ThreedsWebViewControllerDelegate not called #244

Closed
tarasChernysh opened this issue Aug 10, 2022 · 1 comment
Closed

ThreedsWebViewControllerDelegate not called #244

tarasChernysh opened this issue Aug 10, 2022 · 1 comment

Comments

@tarasChernysh
Copy link

tarasChernysh commented Aug 10, 2022

ThreedsWebViewControllerDelegate not called

Few weeks before it works. But now it doesn't.
Could you help me please to figure out the problem here?

class MainVC: UIViewController, ThreedsWebViewControllerDelegate {

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    
    let response = PayInvoiceResponse(
        approved: true,
        redirectLink: "auth url",
        successUrl: "success url",
        failureUrl: "fail url")
    showCheckout3dSecure(
        payResponse: response,
        webDelegate: self,
        successUrl: response.successUrl,
        failURL: response.failureUrl
    )
}

func threeDSWebViewControllerAuthenticationDidSucceed(
    _ threeDSWebViewController: ThreedsWebViewController,
    token: String?
) {
   print("success")
}

func threeDSWebViewControllerAuthenticationDidFail(_ threeDSWebViewController: ThreedsWebViewController) {
    print("fail")
}

}

extension UIViewController {

func showCheckout3dSecure(
    payResponse: PayInvoiceResponse,
    webDelegate: ThreedsWebViewControllerDelegate?,
    successUrl: String,
    failURL: String
) {
    guard payResponse.approved, let url = payResponse.url else {
        return
    }
    let threeDSWebViewController = ThreedsWebViewController(
        successUrl: URL(string: successUrl)!,
        failUrl: URL(string: failURL)!
    )
    threeDSWebViewController.authUrl = url
    threeDSWebViewController.delegate = webDelegate
    present(threeDSWebViewController, animated: true)
}

To Reproduce
Copy and paste code (please use your own urls)

Expected behavior
func threeDSWebViewControllerAuthenticationDidSucceed(:_) and func threeDSWebViewControllerAuthenticationDidFail(:_) can be called

Desktop (please complete the following information):

  • OS: Monterey
  • Xcode: 13.3.1

Smartphone (please complete the following information):

  • Device: iPhone 13 Pro Max
  • OS: 15.4.1
@tarasChernysh
Copy link
Author

It was fixed.
Our server returned wrong urls for iOS client.
It works now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant