curl - How to deauthorize/disconnect Stripe Connect accounts in Rails -


i looking quite long time example on how de-authorize / disconnect stripe connect account in rails app. perhaps versed in making external post requests, trivial, i'm new , seemed hard new manually crafting post requests. :)

i'm using omniauth-stripe-connect gem, excellent connecting account stripe connect. doesn't appear have built-in functionality disconnecting accounts.

stripe's own documentation says post deauthorize url. example curl command, can't use natively in rails. or rather, it's not advised.

curl https://connect.stripe.com/oauth/deauthorize \    -u {your_secret_key}: \    -d client_id=ca_5ry8qonyvrqzajcezvxwuwlgcjar7cw1 \    -d stripe_user_id=acct_llriadrqho6hxc 

what's best way perform post in rails?

i found other question's comments , accepted answer extremely helpful: stripe connect - retrieving access token

here ended doing:

install httparty gem , use following code:

httparty.post("https://connect.stripe.com/oauth/deauthorize",     :basic_auth => { :username => env['stripe_secret_key'] },     :query => {         client_id: env['stripe_connect_client_id'],         stripe_user_id: @user.stripe_user_id }) 

i've got stripe keys loaded environment figaro gem.

i hope saves else hours of search , tinkering!


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -