1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Revert Payment method getters

This commit is contained in:
David Bomba 2022-02-20 15:58:58 +11:00
parent 1b2a5fa09a
commit ea6905f4a0

View File

@ -70,26 +70,24 @@ class PaymentMethod
$transformed_ids = $this->transformKeys(explode(',', $company_gateways));
$this->gateways = $this->client
->company
->company_gateways
$this->gateways =
CompanyGateway::with('gateway')
->where('company_id', $this->client->company_id)
->whereIn('id', $transformed_ids)
->where('is_deleted', false)
->whereNull('deleted_at')
->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
->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
});
})->get();
} else {
$this->gateways = $this->client
->company
->company_gateways
$this->gateways = CompanyGateway::with('gateway')
->where('company_id', $this->client->company_id)
->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
->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));
$this->gateways = $this->client
->company
->company_gateways
$this->gateways = CompanyGateway::with('gateway')
->where('company_id', $this->client->company_id)
->whereIn('id', $transformed_ids)
->where('is_deleted', false)
->whereNull('deleted_at')
->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa')
->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
});
})->get();
} else {
$this->gateways = $this->client
->company
->company_gateways
$this->gateways = CompanyGateway::with('gateway')
->where('company_id', $this->client->company_id)
->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa')
->whereNull('deleted_at')
->where('is_deleted', false);
->where('is_deleted', false)->get();
}