1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 00:41:34 +02:00
invoiceninja/app/Factory/PaymentFactory.php
David Bomba c6e1658ffe
Refactors (#3148)
* Refactor company properties to be presented from settings object instead of company properties

* Working on Email Tests

* Working on emails

* Working on email templats

* Include text version of email

* Refactor Email template builder into trait'

* Fix for custom_value4

* Refactor payment_date -> date && payment_type_id -> type_id

* expose paymentables to API

* expose paymentables to API

* Implement a next_send_date field in invoice/quote tables to allow control over reminder scheduling

* Add custom_values to users,documents and company_gateways tables
2019-12-16 22:34:38 +11:00

46 lines
1.0 KiB
PHP

<?php
/**
* 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
*/
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;
}
}