Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vuepress/1.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = [
children: [
'introduction',
'installation',
'upgrade',
],
}, {
title: "Spark Paddle",
Expand Down
10 changes: 10 additions & 0 deletions 1.x/spark-paddle/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,13 @@ Of course, you may link to the billing portal from your application's dashboard
#### Billing Portal & Multiple Billables

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.

## Showing A Link To The Terms And Conditions

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:

```php
'terms_url' => '/terms'
```

Once added, Spark will display a link pointing to `/terms` in the billing portal.
10 changes: 10 additions & 0 deletions 1.x/spark-stripe/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,13 @@ Of course, you may link to the billing portal from your application's dashboard
Manage Subscription
</a>
```

## Showing A Link To The Terms And Conditions

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:

```php
'terms_url' => '/terms'
```

Once added, Spark will display a link pointing to `/terms` in the billing portal.
6 changes: 5 additions & 1 deletion 1.x/spark-stripe/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ This event is dispatched when a subscription is changed. Possible changes includ

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

## `Spark\Events\PaymentSucceeded`

This event is dispatched when a new Stripe invoice is created.

### Grace Periods

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.
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.
16 changes: 8 additions & 8 deletions 1.x/spark-stripe/taxes.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Taxes

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:
Spark may be configured to calculate and apply European Union VAT tax to subscriptions.

```bash
composer require mpociot/vat-calculator
```

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:
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:

```php
'collects_eu_vat' => 'BE',
use Spark\Features;

'features' => [
Features::euVatCollection(['home-country' => 'BE']),
],
```

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.
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.
54 changes: 54 additions & 0 deletions 1.x/upgrade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Upgrade

[[toc]]

## Upgrading to Spark-Stripe v1.0.5

#### Updating The Configuration File

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:

```php
use Spark\Features;

'features' => [
// Features::euVatCollection(['home-country' => 'BE']),
// Features::receiptEmails(['custom-addresses' => true]),
Features::paymentNotificationEmails(),
],
```

Next, uncomment the features you want to use in your application and remove the old corresponding configuration keys:

- `collects_eu_vat`
- `sends_receipt_emails`
- `sends_payment_notification_emails`

#### Collecting Billing Email Addresses

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.

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:

```php
public function up()
{
if (! Schema::hasColumn('users', 'receipt_emails')) {
Schema::table('users', function (Blueprint $table) {
$table->text('receipt_emails')->after('stripe_id');
});
}
}
```

Make sure to run the migration against the table that corresponds to your billable model.

To enable the feature, uncomment the `Features::receiptEmails()` line in your `config/spark.php` configuration file:

```php
'features' => [
// Features::euVatCollection(['home-country' => 'BE']),
Features::receiptEmails(['custom-addresses' => true]),
Features::paymentNotificationEmailsSending(),
],
```