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:
2025-11-15 18:51:40 +05:00
parent 8637c22ed7
commit c24f7cbac6
9 changed files with 333 additions and 22 deletions

View File

@@ -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
*

View File

@@ -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');
}
}