/home/kueuepay/public_html/app/Models/UserWallet.php
<?php

namespace App\Models;

use App\Constants\GlobalConst;
use App\Models\Admin\Currency;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class UserWallet extends Model
{
    use HasFactory;
    public $timestamps = true;
    protected $fillable = ['balance', 'status','user_id','currency_id','created_at','updated_at'];

    protected $casts = [
        'id'                    => 'integer',
        'user_id'               => 'integer',
        'currency_id'           => 'integer',
        'balance'               => 'decimal:8',
        'profit_balance'        => 'decimal:8',
        'status'                => 'boolean',
    ];

    public function scopeAuth($query) {
        return $query->where('user_id',auth()->user()->id);
    }

    public function scopeActive($query) {
        return $query->where("status",true);
    }

    public function user() {
        return $this->belongsTo(User::class);
    }

    public function currency() {
        return $this->belongsTo(Currency::class);
    }

    public function scopeSender($query) {
        return $query->whereHas('currency',function($q) {
            $q->where("sender",GlobalConst::ACTIVE);
        });
    }
   

}
Check Payment

Check Payment Status

Checks the status of a payment.

            
                
**Response: SUCCESS (200 OK)**
{
 "message": {
 "success": [
  "Success"
 ]
},
"data": {
 "token": "2zMRmT3KeYT2BWMAyGhqEfuw4tOYOfGXKeyKqehZ8mF1E35hMwE69gPpyo3e",
 "trx_id": "CP44657864",
 "payer": {
  "username": "testuser",
  "email": "user@appdevs.net"
 }
 "status": "Test",
},
"type": "success"
}