#SoloGeneral - ruby + `stripe_account`

1 messages ยท Page 1 of 1 (latest)

slim meteor
#

Hello, I forget the syntax there too. Looking in to it and will get back to you

spiral tusk
#

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
slim meteor
#

Gotcha, still looking in to the proper syntax. I am sure we make a call like this somewhere in our docs...

oblique sun
#

๐Ÿ‘‹ should be Stripe::Issuing::Card.update("ic_1LcWIuR4sTLeLkjx5TcI59d6", {spending_controls: {spending_limits: {interval: 'yearly'}}, stripe_account: "acct_1LcWFtR4sTLeLkjx"})
I believe @spiral tusk

spiral tusk
oblique sun
#

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"})

spiral tusk
#

This still gives Stripe::InvalidRequestError: Invalid array

oblique sun
#

Wat

#

๐Ÿ˜…

#

One sec

spiral tusk
#

No worries haha

oblique sun
#

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"})

spiral tusk
#

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!