-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathroutes.php
32 lines (26 loc) · 872 Bytes
/
routes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
use OFFLINE\Cashier\Models\Settings;
use RainLab\User\Models\User;
/**
* Invoice Downloads
*
* @see \OFFLINE\Cashier\Components\InvoicesList
*/
Route::get('/cashier/invoice/{user}/{invoice}', function ($user, $invoice) {
$userId = decrypt($user);
$invoiceId = decrypt($invoice);
$user = User::findOrFail($userId);
return $user->downloadInvoice($invoiceId, [
'vendor' => Settings::get('invoice_vendor', 'Your Vendor (Update in settings)'),
'product' => Settings::get('invoice_product', 'Your Product (Update in settings)'),
]);
});
/**
* Webhook Handler
*/
$webhookUrl = config('services.stripe.webhook.url', 'stripe/webhook');
$webhookController = config(
'services.stripe.webhook.handler',
'\OFFLINE\Cashier\Classes\WebhookController@handleWebhook'
);
Route::post($webhookUrl, $webhookController);