Online payment
This commit is contained in:
@@ -17,30 +17,9 @@ class OnlinePaymentHistory extends Model
|
|||||||
protected $table = 'online_payment_histories';
|
protected $table = 'online_payment_histories';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* Guarded attributes
|
||||||
*
|
*
|
||||||
* @var array<int, string>
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $fillable = [
|
protected $guarded = [];
|
||||||
'refunded_amount',
|
|
||||||
'booking_number',
|
|
||||||
'amount',
|
|
||||||
'depositedAmount',
|
|
||||||
'orderNumber',
|
|
||||||
'description',
|
|
||||||
'orderId',
|
|
||||||
'cardholderName',
|
|
||||||
'pan',
|
|
||||||
'approvalCode',
|
|
||||||
'expiration',
|
|
||||||
'formUrl',
|
|
||||||
'successUrl',
|
|
||||||
'errorUrl',
|
|
||||||
'api_client',
|
|
||||||
'paymentStatus',
|
|
||||||
'callbackStatus',
|
|
||||||
'username',
|
|
||||||
'online_paymantable_id',
|
|
||||||
'online_paymantable_type',
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ class MakePaymentNovaVisaMaster extends Action
|
|||||||
OnlinePaymentHistory::create([
|
OnlinePaymentHistory::create([
|
||||||
'online_paymantable_id' => $resource->id,
|
'online_paymantable_id' => $resource->id,
|
||||||
'online_paymantable_type' => '\App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder',
|
'online_paymantable_type' => '\App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder',
|
||||||
'amount' => $onlinePaymentRepo->getPrice($paymentMethod == 'usd' ? '902.38' : '1058,60'),
|
'amount' => number_format($amount, 2, '', ''),
|
||||||
'orderNumber' => $orderNumber,
|
'orderNumber' => $orderNumber,
|
||||||
'description' => 'Visa/Master tölegi',
|
'description' => 'Visa/Master tölegi',
|
||||||
'orderId' => $paymentResponse['orderId'],
|
'orderId' => $paymentResponse['orderId'],
|
||||||
@@ -162,7 +162,7 @@ class MakePaymentNovaVisaMaster extends Action
|
|||||||
'successUrl' => route('online-payment-store-visa-master'),
|
'successUrl' => route('online-payment-store-visa-master'),
|
||||||
'errorUrl' => route('online-payment-store-visa-master'),
|
'errorUrl' => route('online-payment-store-visa-master'),
|
||||||
'api_client' => config('app.url'),
|
'api_client' => config('app.url'),
|
||||||
'username' => $resource->branch->billing_username,
|
'username' => $resource->branch->billing_visa_master_username,
|
||||||
'paymentStatus' => OnlinePaymentRepo::PENDING,
|
'paymentStatus' => OnlinePaymentRepo::PENDING,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
66
app/Policies/OnlinePaymentHistoryPolicy.php
Normal file
66
app/Policies/OnlinePaymentHistoryPolicy.php
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Policies;
|
||||||
|
|
||||||
|
use App\Models\Payment\OnlinePaymentHistory;
|
||||||
|
use App\Models\User;
|
||||||
|
use Illuminate\Auth\Access\Response;
|
||||||
|
|
||||||
|
class OnlinePaymentHistoryPolicy
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine whether the user can view any models.
|
||||||
|
*/
|
||||||
|
public function viewAny(User $user): bool
|
||||||
|
{
|
||||||
|
return $user->isAdmin();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can view the model.
|
||||||
|
*/
|
||||||
|
public function view(User $user, OnlinePaymentHistory $onlinePaymentHistory): bool
|
||||||
|
{
|
||||||
|
return $user->isAdmin();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can create models.
|
||||||
|
*/
|
||||||
|
public function create(User $user): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can update the model.
|
||||||
|
*/
|
||||||
|
public function update(User $user, OnlinePaymentHistory $onlinePaymentHistory): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can delete the model.
|
||||||
|
*/
|
||||||
|
public function delete(User $user, OnlinePaymentHistory $onlinePaymentHistory): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can restore the model.
|
||||||
|
*/
|
||||||
|
public function restore(User $user, OnlinePaymentHistory $onlinePaymentHistory): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can permanently delete the model.
|
||||||
|
*/
|
||||||
|
public function forceDelete(User $user, OnlinePaymentHistory $onlinePaymentHistory): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,12 +7,14 @@ use App\Models\Order\Card\CardState;
|
|||||||
use App\Models\Order\Card\CardType;
|
use App\Models\Order\Card\CardType;
|
||||||
use App\Models\Order\Loan\LoanOrder;
|
use App\Models\Order\Loan\LoanOrder;
|
||||||
use App\Models\Order\Loan\LoanType;
|
use App\Models\Order\Loan\LoanType;
|
||||||
|
use App\Models\Payment\OnlinePaymentHistory;
|
||||||
use App\Models\System\Locale\LocaleManager;
|
use App\Models\System\Locale\LocaleManager;
|
||||||
use App\Models\System\Location\Province;
|
use App\Models\System\Location\Province;
|
||||||
use App\Models\System\Roles\Permission;
|
use App\Models\System\Roles\Permission;
|
||||||
use App\Models\System\Roles\Role;
|
use App\Models\System\Roles\Role;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Policies\Branch\BranchPolicy;
|
use App\Policies\Branch\BranchPolicy;
|
||||||
|
use App\Policies\OnlinePaymentHistoryPolicy;
|
||||||
use App\Policies\Order\Card\CardStatePolicy;
|
use App\Policies\Order\Card\CardStatePolicy;
|
||||||
use App\Policies\Order\Card\CardTypePolicy;
|
use App\Policies\Order\Card\CardTypePolicy;
|
||||||
use App\Policies\Order\Loan\LoanOrderPolicy;
|
use App\Policies\Order\Loan\LoanOrderPolicy;
|
||||||
@@ -61,6 +63,9 @@ class AuthServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
// ActionsEvents...
|
// ActionsEvents...
|
||||||
ActionEvent::class => ActionEventPolicy::class,
|
ActionEvent::class => ActionEventPolicy::class,
|
||||||
|
|
||||||
|
// Online payment history...
|
||||||
|
OnlinePaymentHistory::class => OnlinePaymentHistoryPolicy::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user