forked from OFFLINE-GmbH/oc-cashier-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.php
29 lines (23 loc) · 834 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
<?php
use OFFLINE\Cashier\Models\Settings;
/**
* Invoice Downloads
*
* @see \OFFLINE\Cashier\Components\InvoicesList
*/
Route::get('/cashier/invoice/{user}/{invoice}', function ($user, $invoice) {
$userId = decrypt($user);
$invoiceId = decrypt($invoice);
$user = \OFFLINE\Cashier\Models\User::whereId($userId)->firstOrFail();
return $user->downloadInvoice($invoiceId, [
'vendor' => Settings::get('invoice_vendor', 'Your Vendor'),
'product' => Settings::get('invoice_product', 'Your Product'),
]);
});
/**
* 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);