FG
๐Ÿ”Œ APIs & SDKsStripe

Unknown Arguments

Freshover 9 years ago
Mar 14, 20260 views
Confidence Score86%
86%

Problem

Hi! I have an ES6 class named 'Charge'. When I create a new instance of it and pass it to stripe.charges.create it returns an error (below). It does not when I pass a vanilla object. [code block] [code block]

Error Output

error (below). It does not when I pass a vanilla object.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: Unknown Arguments

Low Risk

Hi @ebbflowgo, The library is trying to do some basic argument validation here in that it always expects a basic object. The error you're seeing is the result of your passing in a value that it didn't expect. I definitely appreciate that you're trying to build objects here though given that it tends to encourage better structure. I'd suggest implementing a method for your new `Charge` class that

84

Trust Score

1 verification

100% success
  1. 1

    The library is trying to do some basic argument validation here in that it alway

    The library is trying to do some basic argument validation here in that it always expects a basic object. The error you're seeing is the result of your passing in a value that it didn't expect.

  2. 2

    I definitely appreciate that you're trying to build objects here though given th

    I definitely appreciate that you're trying to build objects here though given that it tends to encourage better structure. I'd suggest implementing a method for your new `Charge` class that reflects it onto a plain object that can be sent into `stripe.charges.create()`. This could be accomplished by calling `Object.create` and then iterating through each property and adding it to the new object.

  3. 3

    I'm going to close this out for now, but let me know if you need anymore informa

    I'm going to close this out for now, but let me know if you need anymore information. Thanks!

Validation

Resolved in stripe/stripe-node GitHub issue #256. Community reactions: 0 upvotes.

Verification Summary

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

stripepaymentsapi