Refactor payment processing: update method names for clarity, enhance VisaMasterPaymentOrderRepository with payment validation logic, and improve Turkish translations for payment notifications.
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Models\User;
|
||||
use App\Modules\Branch\Models\Branch;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
@@ -93,6 +94,16 @@ class VisaMasterPaymentOrder extends Model implements HasMedia
|
||||
return $this->belongsTo(Branch::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment itmes
|
||||
*
|
||||
* @return HasMany<VisaMasterPaymentOrderItem, self>
|
||||
*/
|
||||
public function paymentItems(): HasMany
|
||||
{
|
||||
return $this->hasMany(VisaMasterPaymentOrderItem::class, 'visa_master_payment_order_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get applications types
|
||||
*
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\VisaMasterPaymentOrder\Models;
|
||||
|
||||
use App\Modules\OnlinePayment\Models\OnlinePayment;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $visa_master_payment_order_id
|
||||
* @property int $online_payment_id
|
||||
* @property string $payer_name
|
||||
* @property string $payer_card
|
||||
* @property string $payment_order_number
|
||||
* @property string $tmt_payment_amount
|
||||
* @property string $usd_payment_amount
|
||||
* @property bool $paid
|
||||
* @property bool $synced_with_system
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*/
|
||||
class VisaMasterPaymentOrderItem extends Model
|
||||
{
|
||||
/**
|
||||
* Table
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'visa_master_payment_order_items';
|
||||
|
||||
/**
|
||||
* Guarded attributes
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Parent order
|
||||
*
|
||||
* @return BelongsTo<VisaMasterPaymentOrder, self>
|
||||
*/
|
||||
public function parent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(VisaMasterPaymentOrder::class, 'visa_master_payment_order_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Online payment
|
||||
*
|
||||
* @return BelongsTo<OnlinePayment, self>
|
||||
*/
|
||||
public function onlinePayment(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(OnlinePayment::class, 'online_payment_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user