From e8f118c20438aed4a760867aea7d02e53a36f41b Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 14 Dec 2017 13:10:05 +0200 Subject: [PATCH] Fix Bitcoin amount --- app/Ninja/PaymentDrivers/StripePaymentDriver.php | 2 +- resources/views/invoices/view.blade.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Ninja/PaymentDrivers/StripePaymentDriver.php b/app/Ninja/PaymentDrivers/StripePaymentDriver.php index ae0622238327..901d2a3071e3 100644 --- a/app/Ninja/PaymentDrivers/StripePaymentDriver.php +++ b/app/Ninja/PaymentDrivers/StripePaymentDriver.php @@ -408,7 +408,7 @@ class StripePaymentDriver extends BasePaymentDriver 'account' => $this->account(), 'invitation' => $this->invitation, 'invoiceNumber' => $invoiceNumber, - 'amount' => $amount, + 'amount' => $this->invoice()->getRequestedAmount(), 'source' => $response, ]); } else { diff --git a/resources/views/invoices/view.blade.php b/resources/views/invoices/view.blade.php index 8f6ffebcb715..c67df1bcec8a 100644 --- a/resources/views/invoices/view.blade.php +++ b/resources/views/invoices/view.blade.php @@ -163,7 +163,7 @@ @if ($invoice->isQuote()) {!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}   @if ($showApprove) - {!! Button::success(trans('texts.approve'))->asLinkTo(URL::to('/approve/' . $invitation->invitation_key))->large() !!} + {!! Button::success(trans('texts.approve'))->withAttributes(['id' => 'approveButton', 'onclick' => 'onApproveClick()'])->large() !!} @endif @elseif ( ! $invoice->canBePaid()) {!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!} @@ -289,6 +289,11 @@ $('#authorizationModal').modal('show'); } + function onApproveClick() { + $('#approveButton').prop('disabled', true); + //location.href = "{{ url('/approve/' . $invitation->invitation_key) }}"; + } + function onDownloadClick() { try { var doc = generatePDF(invoice, invoice.invoice_design.javascript, true);