If you haven't already, please set up Stripe by following the Stripe setup guide. You also need to set up a Database.
We provide payment functionality for both one-time payments (checkout) and subscriptions.
price_1Oig4tF0OUXipSzGYnvsYC1U
)checkout.one-off
route with the price id to the href
prop, like this:
<Pricing
name="Enterprise"
:href="route('checkout.one-off', 'price_1Oig4tF0OUXipSzGYnvsYC1U')"
button-text="Buy"
description="Dedicated support and infrastructure for your company"
price="99"
price-suffix="/month"
/>
success_url
you provided in the checkout session. By default this route: /checkout/success
StripeEventListener
. E.g. send a confirmation email to the user.Subscriptions are a bit more complex than one-off payments. We have tried to make a simple example that makes it easy to setup subscriptions and change it for your needs.
price_1Oig4tF0OUXipSzGYnvsYC1U
)STRIPE_SUBSCRIPTION_PRICE_ID=price_1Oig4tF0OUXipSzGYnvsYC1U
SubscriptionToggleButton
component to a page of your choice. The button will toggle the subscription on and off.import SubscriptionToggleButton from '@/Components/SubscriptionToggleButton.vue';
success_url
you provided in the checkout session. By default this route: /dashboard
.StripeEventListener
. You can either change the content of the mail or remove it completely, it's up to you. The mail template can be found here /resources/views/mail/subscriptions/created.blade.php
.Cancel
button (located the same place as the Subscription
button previously).SubscriptionController@cancel
method. The mail template can be found here /resources/views/mail/subscriptions/canceled.blade.php
.
This was just a simple example of how to set up subscriptions. You can change the content of the emails, the routes and the functionality to fit your needs.