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
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

VITE_APP_NAME="${APP_NAME}"

STRIPE_KEY=
STRIPE_SECRET=
STRIPE_WEBHOOK_SECRET=
CASHIER_CURRENCY=eur
130 changes: 130 additions & 0 deletions config/cashier.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<?php

use Laravel\Cashier\Console\WebhookCommand;
use Laravel\Cashier\Invoices\DompdfInvoiceRenderer;

// use Laravel\Cashier\Invoices\LaravelPdfInvoiceRenderer;

return [

/*
|--------------------------------------------------------------------------
| Stripe Keys
|--------------------------------------------------------------------------
|
| The Stripe publishable key and secret key give you access to Stripe's
| API. The "publishable" key is typically used when interacting with
| Stripe.js while the "secret" key accesses private API endpoints.
|
*/

'key' => env('STRIPE_KEY'),

'secret' => env('STRIPE_SECRET'),

/*
|--------------------------------------------------------------------------
| Cashier Path
|--------------------------------------------------------------------------
|
| This is the base URI path where Cashier's views, such as the payment
| verification screen, will be available from. You're free to tweak
| this path according to your preferences and application design.
|
*/

'path' => env('CASHIER_PATH', 'stripe'),

/*
|--------------------------------------------------------------------------
| Stripe Webhooks
|--------------------------------------------------------------------------
|
| Your Stripe webhook secret is used to prevent unauthorized requests to
| your Stripe webhook handling controllers. The tolerance setting will
| check the drift between the current time and the signed request's.
|
*/

'webhook' => [
'secret' => env('STRIPE_WEBHOOK_SECRET'),
'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300),
'events' => WebhookCommand::DEFAULT_EVENTS,
],

/*
|--------------------------------------------------------------------------
| Currency
|--------------------------------------------------------------------------
|
| This is the default currency that will be used when generating charges
| from your application. Of course, you are welcome to use any of the
| various world currencies that are currently supported via Stripe.
|
*/

'currency' => env('CASHIER_CURRENCY', 'usd'),

/*
|--------------------------------------------------------------------------
| Currency Locale
|--------------------------------------------------------------------------
|
| This is the default locale in which your money values are formatted in
| for display. To utilize other locales besides the default en locale
| verify you have the "intl" PHP extension installed on the system.
|
*/

'currency_locale' => env('CASHIER_CURRENCY_LOCALE', 'en'),

/*
|--------------------------------------------------------------------------
| Payment Confirmation Notification
|--------------------------------------------------------------------------
|
| If this setting is enabled, Cashier will automatically notify customers
| whose payments require additional verification. You should listen to
| Stripe's webhooks in order for this feature to function correctly.
|
*/

'payment_notification' => env('CASHIER_PAYMENT_NOTIFICATION'),

/*
|--------------------------------------------------------------------------
| Invoice Settings
|--------------------------------------------------------------------------
|
| The following options determine how Cashier invoices are converted from
| HTML into PDFs. You're free to change the options based on the needs
| of your application or your preferences regarding invoice styling.
|
*/

'invoices' => [
// Supported: DompdfInvoiceRenderer::class, LaravelPdfInvoiceRenderer::class
'renderer' => env('CASHIER_INVOICE_RENDERER', DompdfInvoiceRenderer::class),

'options' => [
// Supported: 'letter', 'legal', 'A4'
'paper' => env('CASHIER_PAPER', 'letter'),

'remote_enabled' => env('CASHIER_REMOTE_ENABLED', false),
],
],

/*
|--------------------------------------------------------------------------
| Stripe Logger
|--------------------------------------------------------------------------
|
| This setting defines which logging channel will be used by the Stripe
| library to write log messages. You are free to specify any of your
| logging channels listed inside the "logging" configuration file.
|
*/

'logger' => env('CASHIER_LOGGER'),

];
4 changes: 4 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@
<env name="PULSE_ENABLED" value="false"/>
<env name="TELESCOPE_ENABLED" value="false"/>
<env name="NIGHTWATCH_ENABLED" value="false"/>
<env name="STRIPE_KEY" value="pk_test_placeholder"/>
<env name="STRIPE_SECRET" value="sk_test_placeholder"/>
<env name="STRIPE_WEBHOOK_SECRET" value="whsec_test_placeholder"/>
<env name="CASHIER_CURRENCY" value="eur"/>
</php>
</phpunit>
5 changes: 5 additions & 0 deletions tests/Unit/Billing/CashierConfigTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

it('has cashier stripe configuration keys', function () {
expect(config('cashier.key'))->not->toBeNull();
});