|
1 | 1 | # Laravel Starter Kit for Billing with Chargebee Cashier
|
2 | 2 |
|
3 |
| -Quickly set up billing in your Laravel app using Chargebee. |
| 3 | +Quickly set up billing in your Laravel application using Chargebee. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +### Installation |
4 | 8 |
|
5 |
| -## Installation |
6 | 9 | Run the following command in your terminal:
|
| 10 | + |
7 | 11 | ```sh
|
8 |
| -laravel new --using=chargebee/react-starter-kit |
9 |
| -``` |
| 12 | +laravel new --using=chargebee/laravel-react-starter-kit |
| 13 | +``` |
| 14 | + |
10 | 15 | Then, navigate to your project folder:
|
| 16 | + |
11 | 17 | ```sh
|
12 | 18 | cd your-project-name
|
13 |
| -``` |
| 19 | +``` |
| 20 | + |
| 21 | +### Environment Configuration |
14 | 22 |
|
15 |
| -## Setup |
16 | 23 | - Fill in the Chargebee-related `.env` variables (see `.env.example`).
|
17 |
| -- ⚠️ **Run the server on port `8080` or `8443` for Chargebee checkout to work.** |
18 |
| -- Fetch your plans from Chargebee: |
19 |
| - ```sh |
20 |
| - php artisan chargebee:fetch-plans |
21 |
| - ``` |
22 |
| -- Set up a webhook using **ngrok** or **Cloudflare Tunnel**. If ngrok gives you a URL like `https://{abc}.ngrok-free.app`, set your webhook URL as: |
23 |
| - 🔗 `https://{abc}.ngrok-free.app/chargebee/webhook` |
24 |
| - Add this in your Chargebee dashboard. |
25 |
| -- Start the server: |
26 |
| - ```sh |
27 |
| - php artisan serve |
28 |
| - ``` |
| 24 | +- ⚠️ **Important**: Run the server on port `8080` or `8443` for Chargebee checkout to work. You can do this by adding`SERVER_PORT=8080` in .env file. |
| 25 | + |
| 26 | +## Initial Setup |
| 27 | + |
| 28 | +### Synchronizing Plans |
| 29 | + |
| 30 | +Fetch your plans from Chargebee: |
| 31 | + |
| 32 | +```sh |
| 33 | +php artisan chargebee:fetch-plans |
| 34 | +``` |
| 35 | + |
| 36 | +### Webhook Configuration |
| 37 | + |
| 38 | +Set up a webhook using either of these options: |
| 39 | + |
| 40 | +#### Using Ngrok |
| 41 | + |
| 42 | +Here is a [short tutorial on getting started with Ngrok](https://ngrok.com/docs/getting-started/). |
| 43 | + |
| 44 | +If ngrok gives you a URL like `https://{abc}.ngrok-free.app`, set your webhook URL as: |
| 45 | +🔗 `https://{abc}.ngrok-free.app/chargebee/webhook` |
| 46 | + |
| 47 | +#### Using Cloudflare Tunnel |
| 48 | + |
| 49 | +Here is a short tutorial on [how to configure tunnel on Cloudflare to test webhook](https://medium.com/@agmmnn/test-your-webhooks-with-cloudflare-tunnel-quickly-5875f74024b4). |
| 50 | + |
| 51 | +If Cloudflare Tunnel gives you a URL like `https://{your-tunnel-name}.trycloudflare.com`, set your webhook URL as: |
| 52 | +🔗 `https://{your-tunnel-name}.trycloudflare.com/chargebee/webhook` |
| 53 | + |
| 54 | +> **Note:** Don't forget to [add this webhook URL](https://www.chargebee.com/docs/2.0/webhook_settings.html) in your Chargebee dashboard. |
| 55 | +
|
| 56 | +## Running Your Application |
| 57 | + |
| 58 | +Start the application using: |
| 59 | + |
| 60 | +```sh |
| 61 | +composer run dev |
| 62 | +``` |
0 commit comments