2019-05-03 09:57:55 +02:00
|
|
|
<?php
|
2019-05-11 05:32:07 +02:00
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-05-11 05:32:07 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2023-01-28 23:21:40 +01:00
|
|
|
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-05-11 05:32:07 +02:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2019-05-11 05:32:07 +02:00
|
|
|
*/
|
2019-05-03 09:57:55 +02:00
|
|
|
|
|
|
|
namespace App\Factory;
|
|
|
|
|
|
|
|
use App\Models\Payment;
|
2019-05-13 08:18:46 +02:00
|
|
|
use Illuminate\Support\Carbon;
|
2019-05-03 09:57:55 +02:00
|
|
|
|
|
|
|
class PaymentFactory
|
|
|
|
{
|
2020-10-14 01:53:20 +02:00
|
|
|
public static function create(int $company_id, int $user_id, int $client_id = 0) :Payment
|
2019-12-30 22:59:12 +01:00
|
|
|
{
|
|
|
|
$payment = new Payment;
|
2020-09-06 11:38:10 +02:00
|
|
|
|
2019-12-30 22:59:12 +01:00
|
|
|
$payment->company_id = $company_id;
|
|
|
|
$payment->user_id = $user_id;
|
2020-10-14 01:53:20 +02:00
|
|
|
$payment->client_id = $client_id;
|
2019-12-30 22:59:12 +01:00
|
|
|
$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;
|
2022-05-11 07:25:33 +02:00
|
|
|
$payment->exchange_rate = 1;
|
2020-09-06 11:38:10 +02:00
|
|
|
|
2019-12-30 22:59:12 +01:00
|
|
|
return $payment;
|
|
|
|
}
|
2019-05-03 09:57:55 +02:00
|
|
|
}
|