#SoloGeneral - ruby + `stripe_account`
1 messages ยท Page 1 of 1 (latest)
Hello, I forget the syntax there too. Looking in to it and will get back to you
Have you tried enclosing just the stripe_account parameter in curly braces like in this part of the doc?
charge = Stripe::Charge.retrieve(
'ch_1JGSdIJmquaq3Lbpu9p62qk5',
{
stripe_account: 'acct_1JCsS9Jmquaq3Lbp',
}
)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
When I put the braces around the stripe_account:
Stripe::Issuing::Card.update("ic_1LcWIuR4sTLeLkjx5TcI59d6", spending_controls: {spending_limits: {interval: 'yearly'}},{stripe_account: "acct_1LcWFtR4sTLeLkjx"})
It returns:
...ount: "acct_1LcWFtR4sTLeLkjx"})```
If I put the spending controls in braces as well it returns:
```Stripe::InvalidRequestError: Invalid array```
Here is the docs I am looking at for updating the card: https://stripe.com/docs/api/issuing/cards/update
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Gotcha, still looking in to the proper syntax. I am sure we make a call like this somewhere in our docs...
๐ should be Stripe::Issuing::Card.update("ic_1LcWIuR4sTLeLkjx5TcI59d6", {spending_controls: {spending_limits: {interval: 'yearly'}}, stripe_account: "acct_1LcWFtR4sTLeLkjx"})
I believe @spiral tusk
@oblique sun Just tried the command you gave and this was the result:
Stripe::InvalidRequestError: Received unknown parameter: stripe_account```
Oops, I missed a bracket pair. I'm also not the most familiar with Ruby. Try Stripe::Issuing::Card.update("ic_1LcWIuR4sTLeLkjx5TcI59d6", {spending_controls: {spending_limits: {interval: 'yearly'}}}, {stripe_account: "acct_1LcWFtR4sTLeLkjx"})
This still gives Stripe::InvalidRequestError: Invalid array
No worries haha
Ah because spending_limits is an array of hashes
Try Stripe::Issuing::Card.update("ic_1LcWIuR4sTLeLkjx5TcI59d6", {spending_controls: {spending_limits: [{interval: 'yearly'}]}}, {stripe_account: "acct_1LcWFtR4sTLeLkjx"})
That seems to have done it. I did have to include amount as well because it is a required param for some reason. Thanks so much for helping me figure that out!