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

Syntax Error: Failed to Execute on Window: Invalid target origin: null #728

Open
seankang92129 opened this issue Sep 26, 2024 · 4 comments

Comments

@seankang92129
Copy link

General information

  • SDK version: 3.103.0
  • Environment: sandbox
  • Browser and OS Chrome 129.0.6668.71 (Official Build) (arm64)

Issue description

How to set the origin when the cc hosted fields are inside an iframe of a flutter web application?

image
image
braintree_v3_widget.dart.pdf

@seankang92129
Copy link
Author

In the deprecated v2 SDK documentation there is an enableCORS option when creating the braintree.setup, is there a way to pass this kind of similar options to the v3 SDK when I instantiate the client?

braintree.client.create({

authorization: 'sandbox_MYSANDBOXTOKENIZATIONKEY'

}, function (clientErr, clientInstance) {
}

@seankang92129
Copy link
Author

i also tried to run a sample v3 javascript running on a separate ec2, and I enabled CORS on the express node js server. the page loads, but when I try to generate the nonce, it get the same error.

@seankang92129
Copy link
Author

directly interacting with my nodejs server via a separate stand alone browser, it works

@seankang92129
Copy link
Author

i think I found the culprit -- if I replace the webview_flutter plugin for flutter with a different webview https://pub.dev/packages/webview_all, and point the webview to a separate CORS enabled web site, then the issue above about the null target origin goes away.

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

No branches or pull requests

1 participant