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

[Bug] TypeError thrown from SDK code preventing payment capture process #628

Open
jetrecto opened this issue Feb 25, 2025 · 0 comments
Open

Comments

@jetrecto
Copy link

Library used

[email protected] and @8.2

🐞 Describe the Bug

Checkout with credit card fields began throwing two errors despite no changes to my code base. Checkout using separate Paypal window is functional as always. Initial debug suggests an issue with strict mode in the sdk. I am running the same test suite that I always use with the same test data and all of it was running fine as of 2/18, no changes were made to the codebase since then.

🔬 Minimal Reproduction

Simple implementation of buttons using the loadscript method

😕 Actual Behavior

After rendering of the buttons is complete, browser debugger pauses on the following exception.
TypeError: Cannot assign to read only property 'name' of function 'function(){for(var n=arguments.length,o=new Array(n),u=0;u<n;u++)o[u]=arguments[u];var s,l;c<x&&(t=null,r=null,...<omitted>...p}'
It is gracefully handled and allows the user to proceed and enter their credit card info. On submit however, the script faces another issues with a GraphQL error:
{ "name": "GraphQLError", "payload": { "errors": [ { "path": [ "approveGuestPaymentWithCreditCard" ], "extensions": { "class": "ERROR" }, "checkpoints": [ "approvePayment" ], "meta": {}, "errorData": {}, "contingency": true, "statusCode": 200 } ] }, "statusCode": 200 }
and the error message associated with it
Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them at toString.invokeGetter (<anonymous>:3:28)

Finally this is what appears in the console:

Image

None of my debug statements in the code would indicate where this is coming from, and the only stacktrace I have is the compiled version of the buttons code viewable in browser, any help would be appreciated.

🤔 Expected Behavior

Payment processing and checkout is successful. No error between order creation and order capture.

🌍 Environment

  • Node.js/npm: - Node 22.14
  • OS: - Windows 10
  • Browser: - Chrome

➕ Additional Context

Add any other context about the problem here.

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