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
|
|
|
|
{
|
2019-05-14 06:05:05 +02:00
|
|
|
$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;
|
|
|
|
$payment->account_gateway_id = null;
|
|
|
|
$payment->payment_type_id = null;
|
|
|
|
$payment->is_deleted = false;
|
|
|
|
$payment->amount = 0;
|
2019-05-14 06:05:05 +02:00
|
|
|
$payment->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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|