From be327fbcbf190dfd400cf467d33fa77c2494257c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Apr 2015 19:35:41 +0300 Subject: [PATCH] Added support for Bitcoin --- app/Http/Controllers/AccountController.php | 2 +- .../Controllers/AccountGatewayController.php | 37 ++- app/Http/Controllers/InvoiceController.php | 29 ++- app/Http/Controllers/PaymentController.php | 225 +++++++----------- app/Http/Middleware/StartupCheck.php | 2 +- app/Http/routes.php | 5 +- app/Listeners/HandleInvoicePaid.php | 4 +- app/Models/Account.php | 4 +- app/Models/AccountGateway.php | 9 +- app/Models/Gateway.php | 25 +- composer.json | 3 +- composer.lock | 73 +++++- database/seeds/PaymentLibrariesSeeder.php | 3 +- resources/lang/da/texts.php | 5 + resources/lang/de/texts.php | 7 + resources/lang/en/texts.php | 10 +- resources/lang/es/texts.php | 7 +- resources/lang/es_ES/texts.php | 11 + resources/lang/fr/texts.php | 5 + resources/lang/it/texts.php | 5 + resources/lang/lt/texts.php | 5 + resources/lang/nb_NO/texts.php | 5 + resources/lang/nl/texts.php | 5 + resources/lang/pt_BR/texts.php | 5 + resources/lang/sv/texts.php | 5 + .../views/accounts/account_gateway.blade.php | 55 ++++- resources/views/accounts/payments.blade.php | 8 +- resources/views/invoices/view.blade.php | 16 +- resources/views/payments/payment.blade.php | 2 +- resources/views/public/header.blade.php | 6 +- 30 files changed, 348 insertions(+), 235 deletions(-) diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index b80a59b86450..45500006703c 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -153,7 +153,7 @@ class AccountController extends BaseController if ($count == 0) { return Redirect::to('gateways/create'); } else { - return View::make('accounts.payments', ['showAdd' => $count < 2]); + return View::make('accounts.payments', ['showAdd' => $count < 3]); } } elseif ($section == ACCOUNT_NOTIFICATIONS) { $data = [ diff --git a/app/Http/Controllers/AccountGatewayController.php b/app/Http/Controllers/AccountGatewayController.php index 489b2fb2d65c..cce6922350cb 100644 --- a/app/Http/Controllers/AccountGatewayController.php +++ b/app/Http/Controllers/AccountGatewayController.php @@ -25,10 +25,11 @@ class AccountGatewayController extends BaseController ->join('gateways', 'gateways.id', '=', 'account_gateways.gateway_id') ->where('account_gateways.deleted_at', '=', null) ->where('account_gateways.account_id', '=', Auth::user()->account_id) - ->select('account_gateways.public_id', 'gateways.name', 'account_gateways.deleted_at'); + ->select('account_gateways.public_id', 'gateways.name', 'account_gateways.deleted_at', 'account_gateways.gateway_id'); return Datatable::query($query) ->addColumn('name', function ($model) { return link_to('gateways/'.$model->public_id.'/edit', $model->name); }) + ->addColumn('payment_type', function ($model) { return Gateway::getPrettyPaymentType($model->gateway_id); }) ->addColumn('dropdown', function ($model) { $actions = '