payment api
This commit is contained in:
33
app/Helpers/DuitkuHelper.php
Normal file
33
app/Helpers/DuitkuHelper.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
class DuitkuHelper
|
||||
{
|
||||
public static function configuration()
|
||||
{
|
||||
$duitkuConfig = new \Duitku\Config(env('API_KEY_DUITKU'), env('CODE_MERCHANT_DUITKU'));
|
||||
// false for production mode
|
||||
// true for sandbox mode
|
||||
$duitkuConfig->setSandboxMode(true);
|
||||
// set sanitizer (default : true)
|
||||
$duitkuConfig->setSanitizedMode(false);
|
||||
// set log parameter (default : true)
|
||||
$duitkuConfig->setDuitkuLogs(false);
|
||||
return $duitkuConfig;
|
||||
}
|
||||
|
||||
public static function paymentMethod()
|
||||
{
|
||||
$duitkuConfig = self::configuration();
|
||||
try {
|
||||
$paymentAmount = "10000"; //"YOUR_AMOUNT";
|
||||
$paymentMethodList = \Duitku\Pop::getPaymentMethod($paymentAmount, $duitkuConfig);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
return $paymentMethodList;
|
||||
} catch (Exception $e) {
|
||||
return $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
37
app/Models/Livechat.php
Normal file
37
app/Models/Livechat.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Traits\Blameable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Livechat extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes, Blameable;
|
||||
|
||||
protected $fillable = [
|
||||
'uuid',
|
||||
'doctor_id',
|
||||
'patient_id',
|
||||
'organization_id',
|
||||
'timezone',
|
||||
'descriptions',
|
||||
'payment_method',
|
||||
'request_date',
|
||||
'accept_date',
|
||||
'start_date',
|
||||
'end_date',
|
||||
];
|
||||
|
||||
public function doctor() {
|
||||
return $this->belongsTo(Person::class, 'doctor_id', 'id');
|
||||
}
|
||||
|
||||
public function practitioner() {
|
||||
return $this->belongsTo(Practitioner::class, 'doctor_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
20
app/Models/PaymentsMethods.php
Normal file
20
app/Models/PaymentsMethods.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PaymentsMethods extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'payment_methods';
|
||||
protected $fillable = [
|
||||
'config_pmc_id',
|
||||
'code',
|
||||
'name',
|
||||
'image',
|
||||
'timeout',
|
||||
'active'
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user