Subscriptions and One-time with Stripe
subscriptionCheckout
method.
It requires price` is the price id from Stripe Store.
$checkoutData
will contain the checkout session id and the url to redirect the user to the payment page.
success_url
and cancel_url
are the urls that the user will be redirected to after the payment is successful or canceled.
FRONTEND_URL
in your .env
file.productCheckout
method.
It requires $price
parameter. The $price
is the price id in Stripe.
$checkoutData
will contain the checkout session id and the url to redirect the user to the payment page.
success_url
and cancel_url
are the urls that the user will be redirected to after the payment is successful or canceled.
After successful payment, the user will be redirected to the success_url
with the session_id
in the query string.
Use the session id to retrieve the payment details and update the user’s subscription or product.
Send the session_id
to the backend to verify the payment.