3
votes

I'm trying to implement payments with Stripe, i'm using Stripe connect.

I'm reading documentation for "Charging through the platform" and it says:

\Stripe\Stripe::setApiKey(PLATFORM_SECRET_KEY);
\Stripe\Charge::create(array(
  'amount' => 1000,
  'currency' => 'gbp',
  'source' => {TOKEN},
  'destination' => {CONNECTED_STRIPE_ACCOUNT_ID}
)); 

I have the PLATFORM_SECRET_KEY, and the CONNECTED_STRIPE_ACCOUNT_ID (Obtained from oauth flow with stripe connect), but what is the needed TOKEN?

I have readed that a token can be obtained from a "stripe form", but what is the point to "connect" the stripe account if i need to request card data to my users?

Do I missed something from the flow?

Is there a way to create a token from the user account?

Do i need to create a customer?

Note: I'm newbie with stripe payments.

1
i have connected a user through stripe connect. i want to charge the connected account and send that money to another connected stripe account or if it is not possible then save that charged amount to my own Main Stripe Standalone Platform account but i cant the stripe says it needs 'source' => {TOKEN}, token but i am on server side so i can not use my own form and stripe.js to generate token. So in my case how can i charge that connected stripe accountusama

1 Answers

5
votes

Stripe Connect is used to create charges on behalf of your users. Let's say you're a marketplace for example, you allow John to sell lamps online. Then, Alice comes and wants to buy a lamp from John on your website. You use the code you mentioned before to charge Alice and send the funds to John's account directly.

It looks like what you want here though is to charge Alice for yourself instead. Alice doesn't need a Stripe account in that case. You need to collect Alice's card details using Stripe Checkout or building your own form using Stripe.js. This will give your a card token tok_XXX that you then send to your server where you use it to create a charge through the API as explained in the charges tutorial.