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

PAYPAL_POPUP_OPEN_FAILED #312

Closed
emukhin opened this issue Jul 21, 2017 · 2 comments
Closed

PAYPAL_POPUP_OPEN_FAILED #312

emukhin opened this issue Jul 21, 2017 · 2 comments

Comments

@emukhin
Copy link

emukhin commented Jul 21, 2017

General information

  • SDK version: 3.19.1
  • Environment: Production
  • Browser and OS: Firefox 8.0 (4558) iOS 10.2.1

Issue description

I have this issue only on the specified environment. Other browsers work fine.

I have the following error when I click on paypal button.

{"parameter":{"error":"{\"name\":\"BraintreeError\",\"code\":\"PAYPAL_POPUP_OPEN_FAILED\",\"message\":\"PayPal popup failed to open, make sure to tokenize in response to a user action.\",\"type\":\"MERCHANT\"}"},"contextPath":"","contentLength":228,"queryString":null,"parameters":{"error":["{\"name\":\"BraintreeError\",\"code\":\"PAYPAL_POPUP_OPEN_FAILED\",\"message\":\"PayPal popup failed to open, make sure to tokenize in response to a user action.\",\"type\":\"MERCHANT\"}"]},"postData":{"type":"application/x-www-form-urlencoded","length":228,"contents":"error=%7B%22name%22%3A%22BraintreeError%22%2C%22code%22%3A%22PAYPAL_POPUP_OPEN_FAILED%22%2C%22message%22%3A%22PayPal+popup+failed+to+open%2C+make+sure+to+tokenize+in+response+to+a+user+action.%22%2C%22type%22%3A%22MERCHANT%22%7D","name":"postData"}}

braintree.client.create({
	authorization: token
}, function (clientErr, clientInstance) {
		if (textStatus == 'success') {
			// Create PayPal component
			braintree.paypal.create({
				client: clientInstance
			}, function (err, paypalInstance) {
					$("#paypal-button").on('click', function() {
						// Tokenize here!
						paypalInstance.tokenize({
							flow: 'checkout', // Required
							amount: '1', // Required
							currency: 'CAD', // Required
							useraction: 'commit',
							displayName: 'name'
						}, function (err, tokenizationPayload) {
								if (!err) {
									// Tokenization complete, send tokenizationPayload.nonce to server
									$.ajax({
										type: "POST",
										headers: {
											'Content-Type': 'application/x-www-form-urlencoded'
										},
										dataType: "json",
										url: "/url/",
										data: {
											'nonce': tokenizationPayload,
											'orderId': '1',
											'amount': '1'
										}
									}).done(function( data, textStatus, jqXHR ) {
										location.href = "success";
									}).fail(function( jqXHR, textStatus, errorThrown ) {
										notifyError(textStatus);
										$("#error").slideDown();
									});
								} else {
									if (err.code !== 'PAYPAL_POPUP_CLOSED') {
										notifyError(err);
										$("#error").slideDown();
									}
								}
						});
					});
				}
			);
		}
	}
);
@crookedneighbor
Copy link
Contributor

Thanks for the report. Looks like iOS Firefox fakes popups so it doesn't behave like a normal window opening. We'll see about getting this fixed.

@crookedneighbor
Copy link
Contributor

Our side of this should be fixed in version 3.20.1. I noticed however that the PayPal window crashes when you try to press the login button. Also occurs with the checkout.js integration.

I've opened an issue with the PayPal team here: https://github.com/paypal/paypal-checkout/issues/417

You can subscribe to it for updates on the issue.

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

2 participants