1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #4646 from turbo124/v5-develop

Fix for custom payment driver label
This commit is contained in:
David Bomba 2021-01-07 21:10:09 +11:00 committed by GitHub
commit 7df0e339bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 8 deletions

View File

@ -119,7 +119,7 @@ class InvoiceController extends Controller
'hashed_ids' => $invoices->pluck('hashed_id'),
'total' => $total,
];
nlog($data);
return $this->render('invoices.payment', $data);
}

View File

@ -509,14 +509,13 @@ class Client extends BaseModel implements HasLocalePreference
$payment_methods_intersect->push([$gateway->id => $type]);
}
} else {
$payment_methods_intersect->push([$gateway->id => $type]);
$payment_methods_intersect->push([$gateway->id => NULL]);
}
}
}
//handle custom gateways as they are not unique'd()---------------------------------------------------------
$payment_urls = [];
foreach ($payment_methods_intersect as $key => $child_array) {
@ -525,11 +524,22 @@ class Client extends BaseModel implements HasLocalePreference
$fee_label = $gateway->calcGatewayFeeLabel($amount, $this);
$payment_urls[] = [
'label' => $gateway->getTypeAlias($gateway_type_id) . $fee_label,
'company_gateway_id' => $gateway_id,
'gateway_type_id' => $gateway_type_id,
];
if(!$gateway_type_id){
$payment_urls[] = [
'label' => $gateway->getConfigField('name') . $fee_label,
'company_gateway_id' => $gateway_id,
'gateway_type_id' => GatewayType::CREDIT_CARD,
];
}
else
{
$payment_urls[] = [
'label' => $gateway->getTypeAlias($gateway_type_id) . $fee_label,
'company_gateway_id' => $gateway_id,
'gateway_type_id' => $gateway_type_id,
];
}
}
}