mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 15:44:33 -04:00
Revert Payment method getters
This commit is contained in:
parent
1b2a5fa09a
commit
ea6905f4a0
@ -70,26 +70,24 @@ class PaymentMethod
|
|||||||
|
|
||||||
$transformed_ids = $this->transformKeys(explode(',', $company_gateways));
|
$transformed_ids = $this->transformKeys(explode(',', $company_gateways));
|
||||||
|
|
||||||
$this->gateways = $this->client
|
$this->gateways =
|
||||||
->company
|
CompanyGateway::with('gateway')
|
||||||
->company_gateways
|
->where('company_id', $this->client->company_id)
|
||||||
->whereIn('id', $transformed_ids)
|
->whereIn('id', $transformed_ids)
|
||||||
->where('is_deleted', false)
|
->where('is_deleted', false)
|
||||||
->whereNull('deleted_at')
|
->whereNull('deleted_at')
|
||||||
->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
|
->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
|
||||||
->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority
|
->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority
|
||||||
return array_search($model->id, $transformed_ids);// this closure sorts for us
|
return array_search($model->id, $transformed_ids);// this closure sorts for us
|
||||||
});
|
})->get();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$this->gateways = $this->client
|
$this->gateways = CompanyGateway::with('gateway')
|
||||||
->company
|
->where('company_id', $this->client->company_id)
|
||||||
->company_gateways
|
|
||||||
->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
|
->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
|
||||||
->whereNull('deleted_at')
|
->whereNull('deleted_at')
|
||||||
->where('is_deleted', false);
|
->where('is_deleted', false)->get();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,25 +105,23 @@ class PaymentMethod
|
|||||||
|
|
||||||
$transformed_ids = $this->transformKeys(explode(',', $company_gateways));
|
$transformed_ids = $this->transformKeys(explode(',', $company_gateways));
|
||||||
|
|
||||||
$this->gateways = $this->client
|
$this->gateways = CompanyGateway::with('gateway')
|
||||||
->company
|
->where('company_id', $this->client->company_id)
|
||||||
->company_gateways
|
|
||||||
->whereIn('id', $transformed_ids)
|
->whereIn('id', $transformed_ids)
|
||||||
->where('is_deleted', false)
|
->where('is_deleted', false)
|
||||||
->whereNull('deleted_at')
|
->whereNull('deleted_at')
|
||||||
->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa')
|
->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa')
|
||||||
->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority
|
->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority
|
||||||
return array_search($model->id, $transformed_ids);// this closure sorts for us
|
return array_search($model->id, $transformed_ids);// this closure sorts for us
|
||||||
});
|
})->get();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$this->gateways = $this->client
|
$this->gateways = CompanyGateway::with('gateway')
|
||||||
->company
|
->where('company_id', $this->client->company_id)
|
||||||
->company_gateways
|
|
||||||
->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa')
|
->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa')
|
||||||
->whereNull('deleted_at')
|
->whereNull('deleted_at')
|
||||||
->where('is_deleted', false);
|
->where('is_deleted', false)->get();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user