#Wik
1 messages ยท Page 1 of 1 (latest)
Hi
Yes you can use the per-request API key, following this example:
https://stripe.com/docs/api/authentication
Try this instead:
Stripe::Invoice.mark_uncollectible(invoice_id,{
api_key: user.stripe_key,
})
Stripe::AuthenticationError: No API key provided. Set your API key using "Stripe.api_key = <API-KEY>". You can generate API keys from the Stripe web interface. See https://stripe.com/api for details, or email support@stripe.com if you have any questions.
Try then Authenticate the Client:
Stripe.api_key = user.stripe_key
Stripe::Invoice.mark_uncollectible(invoice_id)
This works, but I wanted to do it in one call or understand why it's not possible ๐
It's been driving me mad all morning
Let me do some tests..
๐
Try this:
Stripe::Invoice.mark_uncollectible(invoice_id, {},{
api_key: user.stripe_key,
})
testing
It works, thank you! However, why does it have to be in this format? It was not obvious for me looking at the method definition in GH def mark_uncollectible(params = {}, opts = {})
because that method can take params as the method definition shows. API key need to be sent in the options opts
thank you for your help!
Welcome!