Laravel cashier stripe checkout I am learning laravel cashier and need some help, i am trying to use checkout of stripe instead of my custom checkout
this is the the code i tried so far, and it's giving me an error Route [home] not defined.
Route::get('/subscription-checkout', function (Request $request) {
return $request->user()
->newSubscription('default', 'price_monthly')
->checkout();
});
any help please?
@waleedviews Well the error message is pretty clear? You don’t have a route named home.
You’ll either need to explicitly define what your cancel and success URLs are:
Route::get('/subscription-checkout', function (Request $request) {
return $request->user()
->newSubscription('default', 'price_monthly')
->checkout([
'cancel_url' => url('checkout-cancelled'),
'success_url' => url('checkout-complete'),
]);
});
Or actually create a home route for Stripe to redirect the user back to after a customer has completed their checkout.
@martinbean you are right, fixed it,
i have change my pricing but it's giving me an error, any help with this please
The price parameter should be the ID of a price object, rather than the literal numerical price.
@martinbean i have resolve the issue, it make sense now. thank you for the help.
Please sign in or create an account to participate in this conversation.