Show "Apply credits" only

This commit is contained in:
Benjamin Beganović 2021-01-11 15:21:17 +01:00
parent 9c581f4b4c
commit 2f17f7011a

View File

@ -544,6 +544,14 @@ class Client extends BaseModel implements HasLocalePreference
} }
if (($this->getSetting('use_credits_payment') == 'option' || $this->getSetting('use_credits_payment') == 'always') && $this->service()->getCreditBalance() > 0) { if (($this->getSetting('use_credits_payment') == 'option' || $this->getSetting('use_credits_payment') == 'always') && $this->service()->getCreditBalance() > 0) {
// Show credits as only payment option if both statements are true.
if (
$this->service()->getCreditBalance() > $amount
&& $this->getSetting('use_credits_payment') == 'always') {
$payment_urls = [];
}
$payment_urls[] = [ $payment_urls[] = [
'label' => ctrans('texts.apply_credit'), 'label' => ctrans('texts.apply_credit'),
'company_gateway_id' => CompanyGateway::GATEWAY_CREDIT, 'company_gateway_id' => CompanyGateway::GATEWAY_CREDIT,