File: D:/HostingSpaces/stafa/werkenbijstafa.nl/app/Komma/Shop/Payment/Transaction.php
<?php
namespace App\Komma\Shop\Payment;
use App\Komma\Shop\Orders\Models\Order;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* Class Transaction
*
* Represents an agreement, or communication, carried out between a buyer and a seller to exchange money for payment.
* The status of the transaction indicates the exchange status.
*
* @package App\Komma\Shop\Payment
* @property int $id
* @property int $order_id
* @property string $payment_reference A reference from the psp identifying the transaction. In dutch: betalingskenmerk
* @property int $psp_id An id of the transaction at the PSP side
* @property string $psp The name of the psp that was being used in the transaction. The same value as the payment_service_provider option in the payment config
* @property int $amount Amount in cents. Should match order total
* @property string $currency_iso_4217_code Examples: EUR, USD, GBP
* @property string $status
* @property string $psp_payment_reference A reference to the psp's version of the transaction
* @property string $issuer_id An id of an issuer. Example: RABONL2U
* @property string $payment_method Example: IDEAL, Paypal, Bank Transfer NL
* @property string $payment_link Example: www.examplepsp.org/payment/223141
* @property string $account_reference Example: NLRABO0123456789 (iBAN)
* @property string $account_holder_name Example: A. Einstein
* @property string $acccount_brand Example: IDEAL, Paypal, Bank Transfer NL
* @property string $ip The ip address of the one who payed the order
* @property string $error_code An error code supplied by the payment service provider
* @property \Illuminate\Support\Carbon|null $expire_date The date when the payment expires
* @property \Illuminate\Support\Carbon|null $payment_date
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Komma\Shop\Orders\Models\Order $order
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction whereAcccountBrand($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction whereAccountHolderName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction whereAccountReference($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction whereAmount($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction whereCurrencyIso4217Code($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction whereErrorCode($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction whereExpireDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction whereIp($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction whereIssuerId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction whereOrderId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction wherePaymentDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction wherePaymentMethod($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction wherePaymentTransactionId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction wherePspPaymentReference($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction whereUpdatedAt($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction wherePaymentReference($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction wherePspId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction wherePaymentLink($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Payment\Transaction wherePsp($value)
*/
class Transaction extends Model
{
/**
* The attributes that should be mutated to dates.
*
* @var array
*/
protected $dates = ['payment_date', 'expire_date'];
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'order_id',
'amount',
'psp_payment_reference',
'psp',
'psp_id',
'ip',
'currency_iso_4217_code',
'error_code',
'account_reference',
'account_holder_name',
'acccount_brand',
'issuer_id',
'payment_method',
'status',
'payment_link',
'expire_date',
'payment_date',
];
protected $table = 'order_transactions';
/**
* Returns the order this transaction belongs to
*
* @return BelongsTo
*/
public function order(): BelongsTo
{
return $this->belongsTo(Order::class);
}
}