I'm working on a site selling service customer to customer. The workflow I've thought about is:
The user 'A' see the good service from user 'B' user 'A' buy the service paying the site and I manage this with:
public function store(Request $request) {
$stripeToken = $request->input('stripeToken');
$email = Auth::user()->email;
$charge = $request->input('charge');
//validation
if($stripeToken){
// Do I have to do this check ?
if(!Auth::user()->subscribed()){
Auth::user()
->subscription('monthly')
->create($stripeToken, [
'email' => $email
]);
}
Auth::user()->charge($charge, [
'receipt_email' => $email,
]);
return 'Done';
}
return 'Failed';
}
The site take the percentage
// the code is trivial
now I've to give money to 'B'
// What's the way/code to manage this ?
Thanks in advance
I would suggest you to watch this series on using command bus. https://laracasts.com/lessons/laravel-5-commands
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community