Comments (21)
@JasonTheAdams I will take a look at it and get back to you. Thank you for sharing.
from paypal-sdk-client.
To be clear, in our case we need to use both onClick
and onError
, so this is a blocker for us.
from paypal-sdk-client.
@JasonTheAdams It's more that it's not clear and can't commit to a date. We will certainly do our best.
from paypal-sdk-client.
Issue-Label Bot is automatically applying the label bug
to this issue, with a confidence of 0.69. Please mark this comment with 👍 or 👎 to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
from paypal-sdk-client.
@JasonTheAdams I'm seeing this message in the logs: Partner Policy config not found for request
. Also, try to throw an error at the first line of the createOrderHandler and see if it catches it.
from paypal-sdk-client.
@mnicpt We figured out the issue. It turns out that if the onClick
option is used, then onError
no longer works. You can see this in my codepen: https://codepen.io/JasonTheAdams/pen/gOrKyoG — if you comment out the onClick
option then onError
starts working.
from paypal-sdk-client.
@mnicpt As an update, we are coordinating with our PayPal Sr. Integration Engineer to aim to launch in a couple of weeks. We have another bug on PayPal's side going live on the 30th. If it's at all possible to have a fix in place before then, that would be incredibly helpful. Having the ability to catch and present errors meaningfully to our users is important.
Thanks!
from paypal-sdk-client.
@JasonTheAdams Can you send me the code that is being executed in the onClickHandler?
from paypal-sdk-client.
@JasonTheAdams Also want to mention that the onError
function will only be called for errors occurring inside our libraries and not from custom code. I ran the pen above and I don't see the onError
function being called. An example of this error may come from the orderId
not being passed to the onApprove
call or the token
is not being passed to createOrder
. If you are expecting and error to be caught from your custom code, we don't support that through the onError
function.
from paypal-sdk-client.
Hi @mnicpt! That's the point of the pen above. 😉 If you comment out the onClick: function() { }
line then you'll see that onError
works as expected.
It does seem to me that whatever calls onError
is simply catching JS Errors that get thrown — which is great!
Also, to answer your question, the error is being thrown in createOrder
, just like in that pen. The issue isn't with what's in our onClick
callback, as even an empty callback causes the issue.
from paypal-sdk-client.
from paypal-sdk-client.
Yep there's definitely an inconsistency we need to fix here. We may need a few days to dig into this and figure out what the best fix is, and that we're consistently returning the right kind of errors (whether or not onClick is passed)
from paypal-sdk-client.
Awesome, thank you! 🙌
from paypal-sdk-client.
Hi @mnicpt! That's the point of the pen above. 😉 If you comment out the
onClick: function() { }
line then you'll see thatonError
works as expected.It does seem to me that whatever calls
onError
is simply catching JS Errors that get thrown — which is great!Also, to answer your question, the error is being thrown in
createOrder
, just like in that pen. The issue isn't with what's in ouronClick
callback, as even an empty callback causes the issue.
My bad. My head was spinning yesterday looking at why this was occurring. As Daniel mentioned above, and after much exploration yesterday, we want to make sure that we do this right and will let you know when we have this ready for you. Thanks again, @JasonTheAdams .
from paypal-sdk-client.
My bad. My head was spinning yesterday looking at why this was occurring. As Daniel mentioned above, and after much exploration yesterday, we want to make sure that we do this right and will let you know when we have this ready for you. Thanks again, @JasonTheAdams .
Not a problem at all. Thank you for your efforts. 😄
from paypal-sdk-client.
@JasonTheAdams I know you mentioned above about launching in a couple of weeks. The fix for this is not trivial and will most likely take longer than that alongside the other prioritized work. Would you be able, for the short-term, try-catch any errors for now and then can have a more reliable onError
function once we get the fix released?
from paypal-sdk-client.
@mnicpt I see, that's unfortunate. We're slated to launch the second week of October. You don't think it will be done by then? If not, we'll have to see what we can do to workaround it.
from paypal-sdk-client.
@JasonTheAdams if it's a matter of unblocking your launch, can you just do something like:
const errorHandler = (err) => {
// ...
}
paypal.Buttons({
createOrder: () => {
return fetch().then(() => {
// ...
}).catch(errorHandler);
},
onError: errorHandler
})
from paypal-sdk-client.
Thanks, @bluepnume, we'll give that a shot. It does, of course, mean that we'll miss any errors that happen outside of the createOrder
function — say if there's an issue after the order is provided to the SDK.
from paypal-sdk-client.
@JasonTheAdams A fix for this has been released. Please check to see if that has fixed your issue. I will close for now but feel free to reopen if you are still seeing issues.
from paypal-sdk-client.
@mnicpt Awesome! I see that my codepen is working now. Thank you!
from paypal-sdk-client.
Related Issues (20)
- Flow syntax error
- QUESTION: Where am I supposed to ask about webhook?
- PayPal CloudQuery Plugin?
- Njm
- Heliodoro Flores
- LinkACCOUNTXML
- Action Required: Fix Renovate Configuration
- Allow for switching between Orders and Subscriptions HOT 19
- Specify orders versus subscription when displaying Smart Buttons HOT 13
- Allow to destroy existing hosted card field HOT 1
- How to detect closed onboarding window? HOT 7
- Invalid authorization code HOT 2
- PayPal
- I think we still need the package.json, it contains the new version number. HOT 7
- https://github.com/mochajs/mocha/issues/4684#issuecomment-873504793 HOT 5
- >09.0.2 / 2021-07-03 HOT 5
- mochajs/mocha#4684 (comment)mochajs/mocha#4684 HOT 5
- https://github.com/mochajs/mocha/pull/4666paypal/paypal-sdk-client#83
- Dependency Dashboard
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-sdk-client.