1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Factory/PaymentFactory.php

46 lines
1.0 KiB
PHP
Raw Normal View History

2019-05-03 09:57:55 +02:00
<?php
2019-05-11 05:32:07 +02:00
/**
* Invoice Ninja (https://invoiceninja.com)
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
2019-05-03 09:57:55 +02:00
namespace App\Factory;
use App\DataMapper\ClientSettings;
use App\DataMapper\CompanySettings;
use App\Models\Payment;
2019-05-13 08:18:46 +02:00
use Illuminate\Support\Carbon;
2019-05-03 09:57:55 +02:00
use Illuminate\Support\Facades\Log;
class PaymentFactory
{
public static function create(int $company_id, int $user_id) :Payment
{
$payment = new Payment;
2019-05-03 09:57:55 +02:00
$payment->company_id = $company_id;
$payment->user_id = $user_id;
$payment->client_id = 0;
$payment->client_contact_id = null;
$payment->invitation_id = null;
2019-09-09 04:19:19 +02:00
$payment->company_gateway_id = null;
$payment->type_id = null;
2019-05-03 09:57:55 +02:00
$payment->is_deleted = false;
$payment->amount = 0;
$payment->date = Carbon::now()->format('Y-m-d');
2019-05-03 09:57:55 +02:00
$payment->transaction_reference = null;
$payment->payer_id = null;
2019-05-13 08:18:46 +02:00
$payment->status_id = Payment::STATUS_PENDING;
2019-05-03 09:57:55 +02:00
return $payment;
}
}