feat(payment): add test mode check for payment callback IP validation
This commit is contained in:
@@ -237,8 +237,9 @@ class PaymentController extends BaseController
|
||||
#[Route('/api/v1/payment/callback/{gateway}', methods: ['POST', 'GET'])]
|
||||
public function callback(string $gateway, Request $request): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
$clientIp = $request->getClientIp() ?? '';
|
||||
if (!$this->isAllowedCallbackIp($clientIp)) {
|
||||
$clientIp = $request->getClientIp() ?? '';
|
||||
$isTestMode = $this->configRepo->get('payment_test_mode') === '1';
|
||||
if (!$isTestMode && !$this->isAllowedCallbackIp($clientIp)) {
|
||||
return new JsonResponse(['success' => false, 'message' => 'دسترسی ممنوع'], 403);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user