Comments (7)
Hi @cfreyre, we're looking into this. Thanks!
from paypal-js.
@cfreyre we were able to reproduce the bug and we are working on it now, we'll let u know when we have some news. Thanks!
from paypal-js.
Hi @cfreyre, the fix has been released, please try it out and let us know, thanks!
from paypal-js.
@gabrielo91 Thank You . It is Working Fine. ¡Muchas Gracias! ; )
from paypal-js.
Hi @cfreyre, we were trying to reproduce the error and it seems it is working fine, we used the below code snippet. We see the exact same behavior in desktop and mobile, first, the on click
alert is launched, and then the creating order
one. Could you please provide some extra information about it or let us know if with such a code snippet do you have the same issue?
Thanks!
<!DOCTYPE html>
<html>
<head>
<title>Checkout Standard Integration</title>
<meta charset="UTF-8" />
</head>
<body>
<div id="paypal-button-container"></div>
<script src="https://www.paypal.com/sdk/js?client-id=AWx1gpCaWDcvW0Tfxwf6gqMuvRkxVyhYPKJIEB6KVO3AdxxZJVnNaFxbQkemez5VwrqpkcMbRN8ZGJ-j"></script>
<script>
paypal.Buttons({
createOrder: function (data, actions) {
alert('creating order')
return actions.order.create({
purchase_units: [{
amount: {
value: '50.00'
}
}]
});
}
}).render('#paypal-button-container').setAttribute('onClick', alert('on click'));
</script>
</body>
</html>
from paypal-js.
Hi, thanks @gabrielo91. Working more on the error, I think it is actually not in the onClick button per se, I think it may be in the "action.resolve" function. My code calls a file in "onClick Method" and the method "actions.resolve ();" doesn't work well. I don't know if this behavior has to do with what was reported here: https://github.com/paypal/paypal-checkout-components/issues/1657
It is worth mentioning that it was working perfect a month ago.
This is my Code:
paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
intent:"CAPTURE",
shippingAddressEditable: false,
purchase_units: [{
amount: {
value: "500",
breakdown: {
item_total: {
currency_code: "MXN",
value: "50"
},
shipping: {
currency_code: "MXN",
value: "10"
}
}
},
invoice_id:inputVal,
description: "Pedido 500 realizado en example.com",
custom_id: inputVal,
shipping: {
method: "UPS",
address: {
name: {
full_name: "George Benson"
},
...
...
}
}
}],
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
var url = "onApprove_file.php";
var data = details;
fetch(url, {
method: "POST",
body: JSON.stringify(data),
headers:{
"Content-Type": "application/json"
}
})
.then(response => window.location.replace("another_file.php"));
});
},
onClick: function(data, actions) {
return fetch("checkout_prefix.php", {
method: "post"
}).then(function(res) {
return res.json();
}).then(function(data) {
if (data.validationError) {
return actions.reject();
} else {
document.getElementById("paypal-button-container").classList.add("hidden");
document.getElementById("paypal-message").classList.add("hidden");
document.getElementById("paypal-wait").classList.remove("hidden");
return actions.resolve();
}
});
}
}).render("#paypal-button-container");
});
from paypal-js.
Hi @cfreyre, we released the fix. Please re-open this if it’s still an issue for you.
from paypal-js.
Related Issues (20)
- [Bug] Bug report
- [Feature] Feature request
- [Feature] PayPalButtonsComponent ts support HOT 1
- Buttons not showing on Nuxt.js with ssr enabled HOT 2
- TypeScript error: paypal.Buttons() is possibly undefined HOT 4
- [Feature] array of strings should be allowed for `enable-funding` and `disable-funding` HOT 1
- [Bug] Button Installment Period not working HOT 2
- Payment Method HOT 18
- [Bug] Styling, button (pill) corners become square on hover [Firefox] HOT 2
- The window.paypal global variable is not available. HOT 2
- PayPalApplePayError: accountlifecycleserv responded with no legal_country_code field HOT 3
- How to inject crossorigin="anonymous" in script tag when using loadScript HOT 3
- [Bug] CreateOrderRequestBody seems incorrectly typed HOT 2
- [Bug] Paypal Subscription Error : Billing Plan Override is not allowed due to insufficient permissions HOT 3
- [Bug] Border of PayPal button invisible on some resolutions HOT 2
- [Bug] Infinite loading screen on safari when setting up a subscription HOT 2
- [Bug] Button background changes to blue when pending transaction HOT 2
- [Bug] the paypal Frame flicker when use onClick to validate form HOT 7
- Type mismatch in lastest version of @paypal/paypal-js and @paypal/react-paypal-js HOT 1
- [Feature] CardFields types HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paypal-js.