Merhaba, larvel login işleminde kullanıcıdan email parola girdikten sonra netgsm in HTTP GET OTP SMS yöntemi ile doğrulama kodu gönderiyorum. Fakat "HTTP Error 400. The request is badly formed." hatası alıyorum. Bir göz atar mısınız ?
public function authenticated(Request $request, Authenticatable $user)
{
Auth::logout();
$request->session()->put('verify:user:id', $user->id);
// @TODO: SMS Doğrulama mesajını bura gönder
$sms_number = mt_rand(1000, 9999);
$msg = "adres.com.tr giris kodunuz: ".$sms_number;
$no = $user->phone;
$username = "xxxxxxxx"; //
$password = urlencode("xxxxxxxxxx"); //
$msgheader = "xxxxxxxxxx";
$url= "https://api.netgsm.com.tr/sms/send/otp/?usercode=$username&password=$password&no=$no&msg=$msg&msgheader=$msgheader";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$http_response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if($http_code != 200){
return back()->with('alert',$http_code.' '.$http_response);
}
session()->put('verify:sms_kodu', $sms_number);
return redirect('verify');
}