Skip to content

Commit 1713816

Browse files
authored
Merge pull request #5 from laravel/pr4800
Update docs
2 parents c75dad0 + 981787d commit 1713816

File tree

6 files changed

+88
-9
lines changed

6 files changed

+88
-9
lines changed

.vuepress/1.x.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = [
55
children: [
66
'introduction',
77
'installation',
8+
'upgrade',
89
],
910
}, {
1011
title: "Spark Paddle",

1.x/spark-paddle/configuration.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,13 @@ Of course, you may link to the billing portal from your application's dashboard
200200
#### Billing Portal & Multiple Billables
201201

202202
If your application is billing more than one type of billable, you should add the billable type's [slug](#billable-slugs) to the `/billing` URI. For example, if you have configured a `team` billable type in addition to your `user` billable type, you may access the billing portal for teams by navigating to `http://localhost/billing/team`. However, this typically should not be necessary because most applications will only ever bill one type of model.
203+
204+
## Showing A Link To The Terms And Conditions
205+
206+
Many applications display billing terms and conditions during checkout. Spark allows you to easily do the same within your application's billing portal. To get started, add a `terms_url` configuration value in your application's `config/spark.php` configuration file:
207+
208+
```php
209+
'terms_url' => '/terms'
210+
```
211+
212+
Once added, Spark will display a link pointing to `/terms` in the billing portal.

1.x/spark-stripe/configuration.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,13 @@ Of course, you may link to the billing portal from your application's dashboard
181181
Manage Subscription
182182
</a>
183183
```
184+
185+
## Showing A Link To The Terms And Conditions
186+
187+
Many applications display billing terms and conditions during checkout. Spark allows you to easily do the same within your application's billing portal. To get started, add a `terms_url` configuration value in your application's `config/spark.php` configuration file:
188+
189+
```php
190+
'terms_url' => '/terms'
191+
```
192+
193+
Once added, Spark will display a link pointing to `/terms` in the billing portal.

1.x/spark-stripe/events.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ This event is dispatched when a subscription is changed. Possible changes includ
1616

1717
This event is dispatched when a subscription expires. This happens when a paused or cancelled subscription is no longer within its cancellation "grace period".
1818

19+
## `Spark\Events\PaymentSucceeded`
20+
21+
This event is dispatched when a new Stripe invoice is created.
22+
1923
### Grace Periods
2024

21-
When a subscription is cancelled, Cashier will automatically set the subscription's `ends_at` column in your database. This column is used to know when the billable's `subscribed` method should begin returning `false`. For example, if a customer cancels a subscription on March 1st, but the subscription was not scheduled to end until March 5th, the `subscribed` method will continue to return `true` until March 5th. This is done because a user is typically allowed to continue using an application until the end of their billing cycle.
25+
When a subscription is cancelled, Cashier will automatically set the subscription's `ends_at` column in your database. This column is used to know when the billable's `subscribed` method should begin returning `false`. For example, if a customer cancels a subscription on March 1st, but the subscription was not scheduled to end until March 5th, the `subscribed` method will continue to return `true` until March 5th. This is done because a user is typically allowed to continue using an application until the end of their billing cycle.

1.x/spark-stripe/taxes.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Taxes
22

3-
Spark may be configured to calculate and apply European Union VAT tax to subscriptions. However, before getting started, you must install the `mpociot/vat-calculator` package via the Composer package manager:
3+
Spark may be configured to calculate and apply European Union VAT tax to subscriptions.
44

5-
```bash
6-
composer require mpociot/vat-calculator
7-
```
8-
9-
Next, you should define a value for the `collects_eu_vat` configuration option within your application's `config/spark.php` configuration file. This value should be the two-character country code corresponding to the country where your business is located:
5+
To get started, you should uncomment the `Features::euVatCollection()` line within your application's `config/spark.php` configuration file. The value provided for the `home-country` option should be the two-character country code corresponding to the country where your business is located:
106

117
```php
12-
'collects_eu_vat' => 'BE',
8+
use Spark\Features;
9+
10+
'features' => [
11+
Features::euVatCollection(['home-country' => 'BE']),
12+
],
1313
```
1414

15-
Once you have completed these steps, Spark will automatically gather customer billing address information as well as VAT Number and apply the correct VAT based on the customer's location.
15+
Once you have completed these steps, Spark will automatically gather customer billing address information as well as VAT Number and apply the correct VAT based on the customer's location.

1.x/upgrade.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Upgrade
2+
3+
[[toc]]
4+
5+
## Upgrading to Spark-Stripe v1.0.5
6+
7+
#### Updating The Configuration File
8+
9+
Spark-Stripe v1.0.5 introduces a new format for enabling features in the configuration file. To use the new format, add the following lines to your `config/spark.php` configuration file:
10+
11+
```php
12+
use Spark\Features;
13+
14+
'features' => [
15+
// Features::euVatCollection(['home-country' => 'BE']),
16+
// Features::receiptEmails(['custom-addresses' => true]),
17+
Features::paymentNotificationEmails(),
18+
],
19+
```
20+
21+
Next, uncomment the features you want to use in your application and remove the old corresponding configuration keys:
22+
23+
- `collects_eu_vat`
24+
- `sends_receipt_emails`
25+
- `sends_payment_notification_emails`
26+
27+
#### Collecting Billing Email Addresses
28+
29+
Spark-Stripe v1.0.5 introduces the ability to email receipts to a custom billing address that the customer provides. This is typically used to email receipts directly to an accountant.
30+
31+
To support this feature, you need to create a new migration in your application and add the following schema modification in the migration's `up()` method:
32+
33+
```php
34+
public function up()
35+
{
36+
if (! Schema::hasColumn('users', 'receipt_emails')) {
37+
Schema::table('users', function (Blueprint $table) {
38+
$table->text('receipt_emails')->after('stripe_id');
39+
});
40+
}
41+
}
42+
```
43+
44+
Make sure to run the migration against the table that corresponds to your billable model.
45+
46+
To enable the feature, uncomment the `Features::receiptEmails()` line in your `config/spark.php` configuration file:
47+
48+
```php
49+
'features' => [
50+
// Features::euVatCollection(['home-country' => 'BE']),
51+
Features::receiptEmails(['custom-addresses' => true]),
52+
Features::paymentNotificationEmailsSending(),
53+
],
54+
```

0 commit comments

Comments
 (0)