Stripe payout
Does anyone know how to perform a payout action from your platform to a user? I'm building an e-commerce where users can sell products, after a successful customer payment, the user receives credit on his account. This part is working perfectly, now I want the user to be able to withdraw his money from the platform.
Basically what I need is something that allows me to tell stripe to payout this $user this $amount of money.
@leotechyy Not really what I need. I need a way to payout the seller that exact amount that I have in my platform. I need to pass the amount to stripe and then stripe sends the seller the payment
@MooseSaid share your code sends the payment
@MooseSaid use this for send payment your .env file add this
STRIPE_KEY=pk_test_reFxwbsm9cdCKASdTfxAR
STRIPE_SECRET=sk_test_oQMFWteJiPd4wj4AtgApY
public function stripePost(Request $request)
{
Stripe\Stripe::setApiKey(env('STRIPE_SECRET'));
Stripe\Charge::create ([
"amount" => 100 ,
"currency" => "usd",
"source" => $request->stripeToken,
"description" => "your description message"
]);
Session::flash('success', 'Payment successful!');
return back();
}
@leotechyy Okay let me breakdown my problem.
I have accomplished until now:
1- A visitor can add item to cart and checkout.
2- Uses stripe card element to take the payment.
3- When payment is successful, the amount goes to the platform's stripe account.
4- The application listens to successful payment webhook and adds credit to the seller's account on the platform (As simple as having a column on the database for each seller with the default of 0 and it increases upon each successful customer payment).
Now all what I'm trying to do is:
Add a button in the seller's profile on the platform that allows the seller to receive exactly the amount that is on their account on the platform.
Let's say he has $100 credit on the platform, after clicking 'pay me' button, the seller will get this $100 paid out from the platform's stripe account to his bank account.
not sure why people don't understand your question! Obviously not english speakers.
Sorry, i don't know the answer, but I think you are unlikely to do it with stripe unless the customer registered a credit card with stripe and you did a refund
This appears to be what you need
@Snapey t
It's closest thing to what I need but still this will require from me to change the whole way I'm handling payments. For example, this will force me to create Stripe product for each product on the platform.
What do you think about this? https://stripe.com/docs/connect/add-and-pay-out-guide
I'm thinking of using this technique since I'm doing everything manual. I believe I can skip the part where I top-up my Stripe account (Since it should be having credit by default from the successful payment).
So here is what I think:
0- A customer makes a successful payment towards some products and the application catches Stripe webhooks and fires a job to add credit to the seller's platform account.
1- The seller receives a notification that he has credit on the platform's account.
2- The seller then can click on a button that takes him to a route where I redirect him to create (stripe express account)[https://stripe.com/docs/connect/add-and-pay-out-guide?integration=with-code#with-code-create-account-link]
3- After the seller gets redirected to the platform again and I catch the webhook that account has been created, The seller then will be redirected to receive the determined amount by my platform. https://stripe.com/docs/connect/add-and-pay-out-guide?integration=with-code#with-code-pay-out-to-user
@MooseSaid You need to think about charge-backs.
There is no way you should payout on demand.
Suppose I create an account and add an item.
I then get my friend to purchase my items. You fulfil the order, and credit my account with an amount minus your handling. I then request payout and get most of what my friend payed. My friend then initiates a refund via his card provider, Stripe then hits you with a charge-back for the original amount.
Then both me and my friend disappear.
But as far as I know that card payments are irreversible. That's why I used Stripe card elements so that the payer can't reverse it.
But how to test my theory, if card payments are reversible then I'm screwed.
But thinking about it in another way, my platform allows users to create their own shops where they sell their products and it's their responsibility to fulfill the order. So what would be the point if a friend buys and then reverse the payment himself? But yeah if their friend can reverse the payment I think Stripe will demand me to pay them. So in every scenario if the buyer reverse the payment it would be a problem. Now what?
@asheroto so, what if I changed my approach? Instead of making my platform recieve the whole amount on the platform's Stripe account and then payout a specific amount to the seller's card directly, I will hand things to Stripe and of course they know how to protect themselves.
It might go like this: 1- customer makes a payment to buy something.
2- Stripe takes the money and adds the platform's fee to my platform's stripe account, take their fees and hand over the rest to the seller's stripe account.
So this will take away all the stress about securing things since the platform part in all of this is just getting paid
You shouldn't have to create a product ID for each item, but you can. :-) I track everything in my own system and have Stripe payouts on a monthly basis on the 1st. I actually don't even transfer funds into their Connect account until the day before the 1st of the month. The reason for that is because right now there is no 'minimum' transfer requirement you can specify within Stripe. Meaning if somebody accrues $0.50 and I spend $0.50 transferring it to them, I lost money. I did contact Stripe to request this feature. For example, setting a $5 minimum payout amount for Connect accounts. Once funds are transferred into their connect account, Stripe's monthly payout will pick up on it the next day (the 1st) and handle the transfer to their bank.
You can specify when you want to initiate the payout, for example, instant, daily, weekly, monthly, or manual. 😊
What I do is require that they create a Stripe Express account before they start accruing funds at all, just part of the account process. I then have a waiting period to prevent against fraud. Accounts that have shown legitimacy I'll allow for a faster payout OR I might end up implementing identity verification which will also allow for a faster payout.
@asheroto Thank you so much for sharing,
okay so your opinion is to force the user to create stripe express account before having the ability to create a product on my platform, and I should connect this product to stripe so that every successful payment would add to his stripe account a specific amount and then I should set Stripe to payout the seller each month for example to prevent fraud. Am i getting this right?
Almost. :-)
- Have the user sign up with Stripe upon account creation/setup
- On successful payment, add funds to their account... OR....
- Add funds to their accounts on your website, but don't tell Stripe about their funds until you're ready to pay them (that way you can control the payout amounts)
It's up to you! I do recommend implementing some type of waiting period to avoid fraud.
@asheroto but, if stripe will give them their money on their own stripe accounts, why would I worry about fraud? If the user tried to fraud they would be stealing from Stripe not my platform, correct?
I believe that's why stripe has an instant payout? They surely know how to protect themselves.
Thank you I think I was fooling myself when I thought that I can use stripe only to make payments. I can, but they take away a big burden if I utilize their features. Such as giving me my precentage of the profit and adds the rest to the seller's seperate stripe account.
@moosesaid Read the Stripe Connect docs. You’re basically describing Shopify. Stripe has a guide for using Connect to process payments where you can charge an application fee before sending the remainder to the vendor.
Please or to participate in this conversation.