Bläddra i källkod

Check client's IP in payeer's handler

master
Immanuel Onyeka 3 år sedan
förälder
incheckning
b3315791f0
1 ändrade filer med 8 tillägg och 0 borttagningar
  1. +8
    -0
      app/Http/Controllers/BillingController.php

+ 8
- 0
app/Http/Controllers/BillingController.php Visa fil

@@ -155,6 +155,13 @@ class BillingController extends Controller

//This needs to check the ip of the sender
public function processPayeer(Request $request) {
$allowed = ['185.71.65.92', '185.71.65.189', '149.202.17.210'];
$ipAddress = $request->ip();

if ($ipAddress !in_array($allowed)){
abort(401);
}

$secret = config('services.payeer.secret');
$arHash = [$request->m_operation_id,
$request->m_operation_ps,
@@ -167,6 +174,7 @@ class BillingController extends Controller
$request->m_desc,
$request->m_status
];

if (isset($request->m_params)) {
$arHash[] = $request->m_params;
}


Laddar…
Avbryt
Spara