Describe the bug
The reject passed to onAuthorized is typed as taking no arguments, so you write actions.reject(). At runtime its the raw promise reject, so that rejects with undefined. PayPal's zalgo-promise then throws Expected reject to be called with Error, got [object Undefined], adyen-web catches that and surfaces it as "Something went wrong while parsing PayPal Order".
End result is that any deliberate reject on our side reaches us as a parsing error with the real reason gone.
To Reproduce
- Set up the PayPal component in the sessions flow
- Implement
onAuthorized and reject it, e.g. catch (e) { return actions.reject() }. Passing anything else doesnt compile, actions.reject(e) gives "Expected 0 arguments, but got 1"
- Trigger whatever your reject path is (we validate the cart total against the authorized amount)
onError fires with AdyenCheckoutError: Something went wrong while parsing PayPal Order, cause is Error: Expected reject to be called with Error, got [object Undefined]
Expected behavior
Rejecting should surface our reason. Either widen the type to reject(reason?: unknown) so we can pass an Error, or wrap it with a default like you already do for beforeSubmit in the same file:
reject: () => t(new CancelError("beforeSubmitRejected"))
Also a merchant reject isnt a parse failure, so the message shouldnt say it is.
Screenshots
n/a, sentry stacktraces instead. The relevant frame is components/PayPal/Paypal.tsx:175.
Desktop / Smartphone
Not device specific, its deterministic. We see it across everything, for example:
- Android 10 / Chrome Mobile 150
- iOS 26.5.2 / iPhone / in-app browser
Version: adyen-web 6.41.0, sessions flow
Additional context
Been our biggest PayPal issue for ~17 months, around 164 shoppers. Took us ages to find because the error message points at order parsing. We're casting to a wider signature and always passing an Error for now.
Full disclosure, I had Claude do the digging here. But these are real errors straight out of our Sentry, not something it made up.
Describe the bug
The
rejectpassed toonAuthorizedis typed as taking no arguments, so you writeactions.reject(). At runtime its the raw promise reject, so that rejects withundefined. PayPal's zalgo-promise then throwsExpected reject to be called with Error, got [object Undefined], adyen-web catches that and surfaces it as "Something went wrong while parsing PayPal Order".End result is that any deliberate reject on our side reaches us as a parsing error with the real reason gone.
To Reproduce
onAuthorizedand reject it, e.g.catch (e) { return actions.reject() }. Passing anything else doesnt compile,actions.reject(e)gives "Expected 0 arguments, but got 1"onErrorfires withAdyenCheckoutError: Something went wrong while parsing PayPal Order,causeisError: Expected reject to be called with Error, got [object Undefined]Expected behavior
Rejecting should surface our reason. Either widen the type to
reject(reason?: unknown)so we can pass an Error, or wrap it with a default like you already do forbeforeSubmitin the same file:Also a merchant reject isnt a parse failure, so the message shouldnt say it is.
Screenshots
n/a, sentry stacktraces instead. The relevant frame is
components/PayPal/Paypal.tsx:175.Desktop / Smartphone
Not device specific, its deterministic. We see it across everything, for example:
Version: adyen-web 6.41.0, sessions flow
Additional context
Been our biggest PayPal issue for ~17 months, around 164 shoppers. Took us ages to find because the error message points at order parsing. We're casting to a wider signature and always passing an Error for now.
Full disclosure, I had Claude do the digging here. But these are real errors straight out of our Sentry, not something it made up.