Reputation: 43
I have successfully setup spark on my local machine it works perfectly. I have added various plan, which users are able to subscribe by making the payment. But the invoice section does not show me any invoice which should be created when a user buy's a plan. Am I missing something? I mean there is no way to see the previous invoices or receipts which user have already paid for. Moreover in DB invoice table is also empty.
Upvotes: 4
Views: 1514
Reputation: 2110
To generate invoices in Spark you will need to set up Webhooks for Stripe or Braintree.
Webhooks
In order to display a list of your customer's invoices, you must configure the appropriate webhooks on Stripe or Braintree.
Stripe webhooks should be configured to point to the /webhook/stripe
URI. The Braintree subscription_canceled
, subscription_charged_successfully
, and subscription_expired
webhook events should be configured to point to /webhook/braintree
URI.
Setting up Stripe Endpoints
You can set up your Stripe Webhooks from this url https://dashboard.stripe.com/account/webhooks or by simply logging into the dashboard and clicking Developer > Webhooks
Create the Endpoint by clicking "+Add Endpoint".
Enter in your Endpoint in the URL to be called field, for example https://example.com/webhooks/stripe
When finished, it should look like this:
Make sure you are setting web hooks for test and not live!
I use ngrok to test my webhooks locally, but if you use Laravel valet you can run $ valet share
View Invoices
After the webhook endpoints are set up, and a user is billed, the invoice will show up properly in the users Settings page under Invoices:
Upvotes: 5