mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 17:27: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)); | ||||
| 
 | ||||
|             $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(); | ||||
| 
 | ||||
|         } | ||||
|          | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user