Unknown Arguments
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
Solution: Unknown Arguments
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
Trust Score
1 verification
- 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
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
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
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep