1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Changed payment page to charge invoice balance rather than full amount

This commit is contained in:
Hillel Coren 2015-02-22 23:07:38 +02:00
parent 1f47acb8ae
commit ca3abb3e56

View File

@ -236,7 +236,7 @@ class PaymentController extends \BaseController
'city' => $input['city'], 'city' => $input['city'],
'state' => $input['state'], 'state' => $input['state'],
'postal_code' => $input['postal_code'], 'postal_code' => $input['postal_code'],
'amt' => $invoice->amount, 'amt' => $invoice->balance,
'ship_to_street' => $input['address1'], 'ship_to_street' => $input['address1'],
'ship_to_city' => $input['city'], 'ship_to_city' => $input['city'],
'ship_to_state' => $input['state'], 'ship_to_state' => $input['state'],
@ -273,7 +273,7 @@ class PaymentController extends \BaseController
$card = new CreditCard($data); $card = new CreditCard($data);
return [ return [
'amount' => $invoice->amount, 'amount' => $invoice->balance,
'card' => $card, 'card' => $card,
'currency' => $currencyCode, 'currency' => $currencyCode,
'returnUrl' => URL::to('complete'), 'returnUrl' => URL::to('complete'),
@ -313,7 +313,7 @@ class PaymentController extends \BaseController
$data = [ $data = [
'showBreadcrumbs' => false, 'showBreadcrumbs' => false,
'url' => 'payment/'.$invitationKey, 'url' => 'payment/'.$invitationKey,
'amount' => $invoice->amount, 'amount' => $invoice->balance,
'invoiceNumber' => $invoice->invoice_number, 'invoiceNumber' => $invoice->invoice_number,
'client' => $client, 'client' => $client,
'contact' => $invitation->contact, 'contact' => $invitation->contact,
@ -645,7 +645,7 @@ class PaymentController extends \BaseController
$payment->invitation_id = $invitation->id; $payment->invitation_id = $invitation->id;
$payment->account_gateway_id = $accountGateway->id; $payment->account_gateway_id = $accountGateway->id;
$payment->invoice_id = $invoice->id; $payment->invoice_id = $invoice->id;
$payment->amount = $invoice->amount; $payment->amount = $invoice->balance;
$payment->client_id = $invoice->client_id; $payment->client_id = $invoice->client_id;
$payment->contact_id = $invitation->contact_id; $payment->contact_id = $invitation->contact_id;
$payment->transaction_reference = $ref; $payment->transaction_reference = $ref;