mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 16:07:34 -04:00 
			
		
		
		
	* Remove unnecessary save() on invoice * Update copyright * Working on Credit Repository * Implement credits as a paymentable entity * Add credit_id to transformer * fix rules for update payment * Fix random deleted_at keys in transformers * Fix for password_protect check
		
			
				
	
	
		
			43 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| /**
 | |
|  * Invoice Ninja (https://invoiceninja.com)
 | |
|  *
 | |
|  * @link https://github.com/invoiceninja/invoiceninja source repository
 | |
|  *
 | |
|  * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | |
|  *
 | |
|  * @license https://opensource.org/licenses/AAL
 | |
|  */
 | |
| 
 | |
| namespace App\Factory;
 | |
| 
 | |
| use App\DataMapper\ClientSettings;
 | |
| use App\DataMapper\CompanySettings;
 | |
| use App\Models\Payment;
 | |
| use Illuminate\Support\Carbon;
 | |
| use Illuminate\Support\Facades\Log;
 | |
| 
 | |
| class PaymentFactory
 | |
| {
 | |
|     public static function create(int $company_id, int $user_id) :Payment
 | |
|     {
 | |
|         $payment = new Payment;
 | |
|         
 | |
|         $payment->company_id = $company_id;
 | |
|         $payment->user_id = $user_id;
 | |
|         $payment->client_id = 0;
 | |
|         $payment->client_contact_id = null;
 | |
|         $payment->invitation_id = null;
 | |
|         $payment->company_gateway_id = null;
 | |
|         $payment->type_id = null;
 | |
|         $payment->is_deleted = false;
 | |
|         $payment->amount = 0;
 | |
|         $payment->date = Carbon::now()->format('Y-m-d');
 | |
|         $payment->transaction_reference = null;
 | |
|         $payment->payer_id = null;
 | |
|         $payment->status_id = Payment::STATUS_PENDING;
 | |
|         
 | |
|         return $payment;
 | |
|     }
 | |
| }
 |