Answer the question
In order to leave comments, you need to log in
How to send get request by cron schedule timing in laravel?
Hello everyone, I'm thinking ... I need to check all successfully completed payments in the database every day and write them off as the bank orders, that's not the point, I created cron
$schedule->call(function (){
$spisanies = Spisanie::where('spisanie_check','=',true)->get();
$kkb = new KKBSign();
$kkb->invert();
$kkb->load_private_key("kkb/cert.prv", "WDfUveEf5i6");
foreach ($spisanies as $spisanie) {
$merchant = '<merchant id="93723431"><command type="complete"/><payment reference="'.$spisanie->spisanie_reference.'" approval_code="'.$spisanie->spisanie_approval_code.'" orderid="'.$spisanie->spisanie_order_id.'" amount="'.$spisanie->spisanie_amount.'" currency_code="398"/></merchant>';
$merchant_sign = '<merchant_sign type="RSA" cert_id="c333e074">'.$kkb->sign64($merchant).'</merchant_sign>';
$xml = "<document>".$merchant.$merchant_sign."</document>";
$mainXML = base64_encode($xml);
return Redirect("/answers/".$mainXML);
}
})->dailyAt('16:05');
Route::get('/answers/{xml}', 'Rus\[email protected]');
public function answers($xml){
return view('rus.answer',['xml'=>$xml]);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script>
$.ajax({
url:'https://epay.kkb.kz/jsp/remote/control.jsp?{{$xml}}',
type:'get'
});
</script>
Answer the question
In order to leave comments, you need to log in
How difficult. You can send via curl, without any views, in the same script that collects XML.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question