1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00

Prevent quotes from being paid

This commit is contained in:
Hillel Coren 2017-06-18 17:09:20 +03:00
parent f1c22180f6
commit 7696ba610c

View File

@ -150,19 +150,21 @@ class ClientPortalController extends BaseController
'gatewayTypeId' => count($paymentTypes) == 1 ? $paymentTypes[0]['gatewayTypeId'] : false, 'gatewayTypeId' => count($paymentTypes) == 1 ? $paymentTypes[0]['gatewayTypeId'] : false,
]; ];
if ($paymentDriver = $account->paymentDriver($invitation, GATEWAY_TYPE_CREDIT_CARD)) { if ($invoice->canBePaid()) {
$data += [ if ($paymentDriver = $account->paymentDriver($invitation, GATEWAY_TYPE_CREDIT_CARD)) {
'transactionToken' => $paymentDriver->createTransactionToken(), $data += [
'partialView' => $paymentDriver->partialView(), 'transactionToken' => $paymentDriver->createTransactionToken(),
'accountGateway' => $paymentDriver->accountGateway, 'partialView' => $paymentDriver->partialView(),
]; 'accountGateway' => $paymentDriver->accountGateway,
} ];
}
if ($accountGateway = $account->getGatewayByType(GATEWAY_TYPE_CUSTOM)) { if ($accountGateway = $account->getGatewayByType(GATEWAY_TYPE_CUSTOM)) {
$data += [ $data += [
'customGatewayName' => $accountGateway->getConfigField('name'), 'customGatewayName' => $accountGateway->getConfigField('name'),
'customGatewayText' => $accountGateway->getConfigField('text'), 'customGatewayText' => $accountGateway->getConfigField('text'),
]; ];
}
} }
if ($account->hasFeature(FEATURE_DOCUMENTS) && $this->canCreateZip()) { if ($account->hasFeature(FEATURE_DOCUMENTS) && $this->canCreateZip()) {