#heshiebee
1 messages · Page 1 of 1 (latest)
This is the Stripe ruby gem
What do you mean swap out? Are you creating a plugin?
Where are you seeing deprecation information?
Change the api_key per the customer making the request. Making requests on behalf of the customers stripe account.
Are you a connect platform?
Both. We were just connect until now and are trying to refactor our integration so users can bring their own stripe
You can set the API key when initializing, using that api_key you mentioned: https://stripe.com/docs/api/authentication?lang=ruby
Why would you need to change this dynamically?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You'll need to do it on init or override on each request as shown (perhaps using some request options)
For connect you should be having your users connect then use the stripe-account header dynamically when needed:
https://stripe.com/docs/api/connected_accounts?lang=ruby
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Our connect setup works well. Just worried if I keep swapping the api_key it might leak between requests
From connect account with header to non-connect request with just the API key
You shouldn't be swapping api keys between requests, no, you should have those accounts connect
That's not an option for us.
Some customers have years of sales history they don't want to lose
If you really need to override on a request level the example showing that in the request options is likely to be what you want
You can connect to their existing account in that case
Ok, and to I have to clear out the api_key on the client or will it take precedence over that key?
How?
The request options are meant to override the Stripe.api_key
Great
Thx!
Very helpful
"OAuth is not recommended for new Connect platforms. We recommend using Connect Onboarding for Standard accounts instead."
From the docs ☝️
https://stripe.com/docs/connect/standard-accounts
Was just watching this while waiting on my question to be answered, can't you just use connect for all users, and have your standard users onboard to your connect account using this flow?
Sure, but you say you want to use this with pre-existing accounts, so your path is outside of the normal/recommended flow
This is better than juggling API keys
Which you really really should not do
Will it be deprecated shortly?
No, there would be communications if that were planned