<?php
namespace App\Models\Admin;
use App\Constants\PaymentGatewayConst;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class PaymentGateway extends Model
{
use HasFactory;
protected $guarded = ['id'];
protected $casts = [
'id' => 'integer',
'slug' => 'string',
'code' => 'integer',
'type' => 'string',
'name' => 'string',
'title' => 'string',
'alias' => 'string',
'image' => 'string',
'credentials' => 'object',
'supported_currencies' => 'object',
'crypto' => 'boolean',
'desc' => 'string',
'input_fields' => 'object',
'env' => 'string',
'status' => 'integer',
'last_edit_by' => 'integer',
'created_at' => 'date:Y-m-d',
'updated_at' => 'date:Y-m-d',
];
protected $with = [
'currencies',
];
public function scopeAutomatic($query)
{
return $query->where(function ($q) {
$q->where("type", PaymentGatewayConst::AUTOMATIC);
});
}
public function scopeGateway($query, $keyword)
{
if (is_numeric($keyword)) return $query->where('code', $keyword);
return $query->where('alias', $keyword);
}
public function currencies()
{
return $this->hasMany(PaymentGatewayCurrency::class, 'payment_gateway_id')->orderBy("id", "DESC");
}
public function scopeAddMoney($query)
{
return $query->where(function ($q) {
$q->where('slug', PaymentGatewayConst::add_money_slug());
});
}
public function scopeMoneyOut($query)
{
return $query->where(function ($q) {
$q->where('slug', PaymentGatewayConst::money_out_slug());
});
}
public function scopeManual($query)
{
return $query->where(function ($q) {
$q->where("type", PaymentGatewayConst::MANUAL);
});
}
public function scopeActive($query)
{
return $query->where(function ($q) {
$q->where("status", PaymentGatewayConst::ACTIVE);
});
}
public function isManual() {
if($this->type == PaymentGatewayConst::MANUAL) {
return true;
}
return false;
}
public function isAutomatic() {
if($this->type == PaymentGatewayConst::AUTOMATIC) {
return true;
}
return false;
}
public function isCrypto() {
if($this->crypto == true) return true;
return false;
}
public function cryptoAssets()
{
return $this->hasMany(CryptoAsset::class,'payment_gateway_id');
}
}
Welcome to the Kueue Pay Payment Gateway Solutions Developer API Documentation. This comprehensive guide will empower you to seamlessly integrate our advanced payment gateway into your website, enhancing your customers’ payment experience and enabling efficient transaction processing. The Kueue Pay Developer API is designed for developers and entrepreneurs who seek simplicity, security, and reliability in their payment processing solutions.
The Kueue Pay Developer API allows you to seamlessly integrate Kueue Pay’s Payment Gateway Solutions into your website, enabling secure and efficient debit and credit card transactions. With our API, you can initiate payments, check payment statuses, and even process refunds, all while ensuring a smooth and streamlined payment experience for your customers.