Get account ID of connected stripe account

醉酒当歌 提交于 2019-12-06 22:41:32

问题


When I run a test for connecting a user to accept payments through my application, I will need the account id to charge their account.

Stripe\Token::create(
array("customer" => CUSTOMER_ID, "card" => CARD_ID),
array("stripe_account" => CONNECTED_STRIPE_ACCOUNT_ID) // id of the connected account
);

In this snippet (from Stripe), the CONNECTED_STRIPE_ACCOUNT_ID implies the connecting about id which starts with acct_

How do I obtain this ?

Thanks, Rich.


回答1:


I came here from a Google search with a similar issue. It is actually easy to get from the OAUTH flow, the documentation just does not make it clear which field it is. In short, the missing link is that the CONNECTED_STRIPE_ACCOUNT_ID is the stripe_user_id that you get at the end of the OAUTH flow when the account is connected as per https://stripe.com/docs/connect/standalone-accounts

In their example response at the end of the flow

{
"token_type": "bearer",
"stripe_publishable_key": PUBLISHABLE_KEY,
"scope": "read_write",
"livemode": false,
"stripe_user_id": USER_ID,  //this is it
"refresh_token": REFRESH_TOKEN,
"access_token": ACCESS_TOKEN
}



回答2:


@Anil..I will outline the steps here:

Step 1: Find client id of your platform. This you can obtain from your settings Step 2: Set a redirect URI. This will be where your users are redirected to after they have signed up for Stripe Step3: Add a Connect Button by which leads to connect authorize_url endpoint

Find more details here: https://stripe.com/docs/connect/standalone-accounts#oauth-flow



来源:https://stackoverflow.com/questions/35400085/get-account-id-of-connected-stripe-account

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!