Last active
June 27, 2018 04:20
-
-
Save studio-fars-company/6a4932429df45f659d05925696030827 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function index() | |
{ | |
return view('home'); | |
} | |
public function subscribe_process(Request $request) | |
{ | |
try { | |
Stripe::setApiKey(env('STRIPE_SECRET')); | |
$id = Auth::id();//user_id取得 | |
$user = User::find($id); | |
$user->newSubscription('main', 'Stripeで作成されたプランID')->create($request->stripeToken); | |
return back(); | |
} catch (\Exception $ex) { | |
return $ex->getMessage(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment