Skip to content

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

Open
@jetrecto

Description

@jetrecto

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions