#OwenN-detach PM
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thank you for the help ! I've checked the docs already but I'm still stuck on the Connect account part.
Is this parameter not available on the paymentmethod.detach method ? Should I (very reluctantly) use the API keys of the Connect accounts instead ?
Did I make a dumb syntax error that I have missed all those hours ?
Here's the different ways I tried to write it and the errors it threw at me :
Stripe::PaymentMethod.detach(
pm.id,
stripe_account: csa.csa_key
)
and
Stripe::PaymentMethod.detach(
pm.id,
{stripe_account: csa.csa_key}
)
Results in:
"No such PaymentMethod: 'pm_1LKjXXXXXXXXXXXX'"
Stripe::PaymentMethod.detach(
{
pm.id
},
stripe_account: csa.csa_key
)
Results in :
"syntax error, unexpected '\n', expecting =>
syntax error, unexpected ')', expecting 'end' "
do you a request id I could look at? here's how you can find one https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
oh wait I see the issue
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
your passing the account id wrong
your passing it as parameters to the detach method
I'm taking a look
So I should write it like :
Stripe::PaymentMethod.detach(
paymentmethod.id,
{ stripe_account: acc.id}
)
correct ?
Thank you for your time btw
yes exactly
another thing
paymentmethod.id,
{},
{ stripe_account: acc.id}
)```
I think this is the right way
could you please provide me with request ids?
Hey it worked! I have another error now but it's not on the same topic
So I'll debug it myself
Thank you so much tarzan
I might be able to help if you share the request id
Is there any way to explain the extra {} that needs to be written there ?
Is this just to prevent stripe from thinking it's part of the request body ?
yes basically there's the id, the params which is the equivalent of the request body and the opts which are the headers