fix(auth): require verified identity for wallet and gift card
This commit is contained in:
@@ -58,6 +58,7 @@ class GiftCardController extends Controller
|
|||||||
if(!$user){
|
if(!$user){
|
||||||
throw new UnprocessableEntityHttpException('auth failed!');
|
throw new UnprocessableEntityHttpException('auth failed!');
|
||||||
}
|
}
|
||||||
|
self::assertCustomerIdentityVerified($user instanceof Customer ? $user : null);
|
||||||
|
|
||||||
if (!app(ConfigService::class)->getBool('has_page_gift_card', false)) {
|
if (!app(ConfigService::class)->getBool('has_page_gift_card', false)) {
|
||||||
throw new UnprocessableEntityHttpException('قابلیت کارت هدیه غیرفعال است.');
|
throw new UnprocessableEntityHttpException('قابلیت کارت هدیه غیرفعال است.');
|
||||||
|
|||||||
@@ -370,6 +370,7 @@ class WalletController extends Controller
|
|||||||
public function withdraw(Request $request)
|
public function withdraw(Request $request)
|
||||||
{
|
{
|
||||||
$customer = auth('customer')->user();
|
$customer = auth('customer')->user();
|
||||||
|
self::assertCustomerIdentityVerified($customer instanceof Customer ? $customer : null);
|
||||||
$data = $request->all();
|
$data = $request->all();
|
||||||
if (!isset($data['card_id'])) {
|
if (!isset($data['card_id'])) {
|
||||||
return response()->json(['message' => 'لطفا کارت بانکی را وارد کنید'], 422);
|
return response()->json(['message' => 'لطفا کارت بانکی را وارد کنید'], 422);
|
||||||
@@ -706,6 +707,7 @@ class WalletController extends Controller
|
|||||||
$this->validateWithdrawAmount((int) $data['value']);
|
$this->validateWithdrawAmount((int) $data['value']);
|
||||||
|
|
||||||
$customer = auth('customer')->user();
|
$customer = auth('customer')->user();
|
||||||
|
self::assertCustomerIdentityVerified($customer instanceof Customer ? $customer : null);
|
||||||
$otp = rand(1000, 9999);
|
$otp = rand(1000, 9999);
|
||||||
$customer->token_sms = $otp;
|
$customer->token_sms = $otp;
|
||||||
$customer->save();
|
$customer->save();
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ class WalletPaymentController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$customer = auth('customer')->user();
|
$customer = auth('customer')->user();
|
||||||
|
self::assertCustomerIdentityVerified($customer instanceof \App\Models\Customer ? $customer : null);
|
||||||
$withdraw = Withdraw::create([
|
$withdraw = Withdraw::create([
|
||||||
'customer_id' => $customer->id,
|
'customer_id' => $customer->id,
|
||||||
'cash' => $amount,
|
'cash' => $amount,
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ class paypingController extends Controller
|
|||||||
public function startTransation(Request $request)
|
public function startTransation(Request $request)
|
||||||
{
|
{
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
|
self::assertCustomerIdentityVerified($user instanceof \App\Models\Customer ? $user : null);
|
||||||
$finalPriseP = $request->value;
|
$finalPriseP = $request->value;
|
||||||
if ($user->id == 4) {
|
if ($user->id == 4) {
|
||||||
$finalPriseP = 10700;
|
$finalPriseP = 10700;
|
||||||
|
|||||||
Reference in New Issue
Block a user