4

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.

Invoice Panel

Dave
  • 5,108
  • 16
  • 30
  • 40

1 Answers1

5

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

  1. 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

  2. Create the Endpoint by clicking "+Add Endpoint".

  3. Enter in your Endpoint in the URL to be called field, for example https://example.com/webhooks/stripe

  4. When finished, it should look like this:

endpoints

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:

enter image description here

Giovanni S
  • 2,050
  • 18
  • 33
  • I have added the webhook, but still am not able to see the invoices. Where can I look into for investigation? – Devs love ZenUML Nov 27 '18 at 12:11
  • Just a note, the example given uses https://example.com/webhooks/stripe when it should be https://example.com/webhook/stripe (in case anyone is trying to paste the snippet). – Red Roboto Aug 08 '20 at 00:34