Changeset View
Changeset View
Standalone View
Standalone View
src/app/Payment.php
<?php | <?php | ||||
namespace App; | namespace App; | ||||
use Illuminate\Database\Eloquent\Model; | use Illuminate\Database\Eloquent\Model; | ||||
/** | /** | ||||
* A payment operation on a wallet. | * A payment operation on a wallet. | ||||
* | * | ||||
* @property int $amount Amount of money in cents of system currency | * @property int $amount Amount of money in cents of system currency (payment provider) | ||||
* @property int $base_amount Amount of money in cents of system currency (wallet balance) | |||||
mollekopf: How about amount_after_taxes, or taxed_amount, or wallet_amount? | |||||
* @property string $description Payment description | * @property string $description Payment description | ||||
* @property string $id Mollie's Payment ID | * @property string $id Mollie's Payment ID | ||||
* @property float $tax_rate Tax rate | |||||
* @property \App\Wallet $wallet The wallet | * @property \App\Wallet $wallet The wallet | ||||
* @property string $wallet_id The ID of the wallet | * @property string $wallet_id The ID of the wallet | ||||
* @property string $currency Currency of this payment | * @property string $currency Currency of this payment | ||||
* @property int $currency_amount Amount of money in cents of $currency | * @property int $currency_amount Amount of money in cents of $currency | ||||
*/ | */ | ||||
class Payment extends Model | class Payment extends Model | ||||
{ | { | ||||
public $incrementing = false; | public $incrementing = false; | ||||
protected $keyType = 'string'; | protected $keyType = 'string'; | ||||
/** @var array<string, string> The attributes that should be cast */ | /** @var array<string, string> The attributes that should be cast */ | ||||
protected $casts = [ | protected $casts = [ | ||||
'amount' => 'integer' | 'amount' => 'integer', | ||||
'base_amount' => 'integer', | |||||
'tax_rate' => 'float', | |||||
]; | ]; | ||||
/** @var array<int,string> The attributes that are mass assignable */ | /** @var array<int,string> The attributes that are mass assignable */ | ||||
protected $fillable = [ | protected $fillable = [ | ||||
'id', | 'id', | ||||
'wallet_id', | 'wallet_id', | ||||
'amount', | 'amount', | ||||
'base_amount', | |||||
'description', | 'description', | ||||
'provider', | 'provider', | ||||
'status', | 'status', | ||||
'tax_rate', | |||||
'type', | 'type', | ||||
'currency', | 'currency', | ||||
'currency_amount', | 'currency_amount', | ||||
]; | ]; | ||||
/** | /** | ||||
* Ensure the currency is appropriately cased. | * Ensure the currency is appropriately cased. | ||||
Show All 16 Lines |
How about amount_after_taxes, or taxed_amount, or wallet_amount?