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

PR-3766: Credit card support support #9

Merged
merged 7 commits into from
Jan 18, 2024
Merged

PR-3766: Credit card support support #9

merged 7 commits into from
Jan 18, 2024

Conversation

lukasz-lenkiewicz
Copy link
Contributor

Its a duplicate of #8 - but with renamed branch

@@ -84,28 +79,66 @@ extension CardPaymentHandler: WKNavigationDelegate {

func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
print(navigationAction)
if let body = navigationAction.request.httpBody { }
if let url = navigationAction.request.mainDocumentURL?.absoluteString {
Copy link
Contributor

Choose a reason for hiding this comment

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

@lukasz-lenkiewicz ca we listen to messages from iframes for error and success?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in order to support javascript, html response needs to be changed similiar way as its for reactnative:

try {
    window.ReactNativeWebView.postMessage(
      JSON.stringify({
        type: '3DS-challenge-completed',
      })
    );
  } catch (e) {}

and use something like:

try {
  window.webkit.messageHandlers.payrails.postMessage(
    JSON.stringify({
      type: '3DS-challenge-completed',
    })
  );
} catch (e) {}

without above, iOS doesnt get the information, thats why atm it works with redirect url which is set by

 window.setTimeout(() => {
  window.location.href = 'https:\/\/www.bootstrap.payrails.io\/success';
}, 500);

@grgmgd grgmgd merged commit cc68eeb into main Jan 18, 2024
8 checks passed
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