diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 08b67c62ba56..fbbdc7c08e6f 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -99,6 +99,8 @@ class InvoiceController extends BaseController ->where('invitations.deleted_at', '=', null) ->select('contacts.public_id')->lists('public_id'); + $clients = Client::scope()->withTrashed()->with('contacts', 'country'); + if ($clone) { $invoice->id = $invoice->public_id = null; $invoice->invoice_number = $account->getNextInvoiceNumber($invoice); @@ -111,6 +113,7 @@ class InvoiceController extends BaseController Utils::trackViewed($invoice->getDisplayName().' - '.$invoice->client->getDisplayName(), $invoice->getEntityType()); $method = 'PUT'; $url = "{$entityType}s/{$publicId}"; + $clients->whereId($invoice->client_id); } $invoice->invoice_date = Utils::fromSqlDate($invoice->invoice_date); @@ -157,7 +160,7 @@ class InvoiceController extends BaseController $lastSent = ($invoice->is_recurring && $invoice->last_sent_date) ? $invoice->recurring_invoices->last() : null; $data = array( - 'clients' => Client::scope()->withTrashed()->with('contacts', 'country')->whereId($invoice->client_id)->get(), + 'clients' => $clients->get(), 'entityType' => $entityType, 'showBreadcrumbs' => $clone, 'invoice' => $invoice, diff --git a/app/Http/Controllers/PublicClientController.php b/app/Http/Controllers/PublicClientController.php index 4b020d482ae6..93384037bf3b 100644 --- a/app/Http/Controllers/PublicClientController.php +++ b/app/Http/Controllers/PublicClientController.php @@ -101,7 +101,9 @@ class PublicClientController extends BaseController // Checkout.com requires first getting a payment token $checkoutComToken = false; $checkoutComKey = false; + $checkoutComDebug = false; if ($accountGateway = $account->getGatewayConfig(GATEWAY_CHECKOUT_COM)) { + $checkoutComDebug = $accountGateway->getConfigField('testMode'); if ($checkoutComToken = $this->paymentService->getCheckoutComToken($invitation)) { $checkoutComKey = $accountGateway->getConfigField('publicApiKey'); $invitation->transaction_reference = $checkoutComToken; @@ -126,6 +128,7 @@ class PublicClientController extends BaseController 'paymentURL' => $paymentURL, 'checkoutComToken' => $checkoutComToken, 'checkoutComKey' => $checkoutComKey, + 'checkoutComDebug' => $checkoutComDebug, 'phantomjs' => Input::has('phantomjs'), ); diff --git a/app/Services/AccountGatewayService.php b/app/Services/AccountGatewayService.php index 61d5a9a80e1c..bd5635e0dd52 100644 --- a/app/Services/AccountGatewayService.php +++ b/app/Services/AccountGatewayService.php @@ -41,7 +41,7 @@ class AccountGatewayService extends BaseService [ 'name', function ($model) { - return link_to("gateways/{$model->public_id}/edit", $model->name); + return link_to("gateways/{$model->public_id}/edit", $model->name)->toHtml(); } ], [ diff --git a/resources/views/partials/checkout_com_payment.blade.php b/resources/views/partials/checkout_com_payment.blade.php index 9e5e63baae50..b214e2a79209 100644 --- a/resources/views/partials/checkout_com_payment.blade.php +++ b/resources/views/partials/checkout_com_payment.blade.php @@ -1,9 +1,13 @@ - +@if ($checkoutComDebug) + +@else + +@endif