Trying to simulate a POST request on postman for a callback function for API. It is from an external API posting the data to me so I did not include return in callback function.
Here is my route:
Route::post('api-callback','APIController@callback')->name('api-callback');
Controller:
public function callback(Request $request){
Log::info('callback function is called');
$response = request()->all();
Log::info($response);
if($request->status == 1){
//store transaction details
$transaction = new Transaction();
$transaction->user_id = auth()->id();
$transaction->billcode = $request->billcode;
$transaction->transaction_id = $request->refno;
$transaction->amount = $request->amount;
$transaction->save();
//update new credit balance for user
$user_credit = UserInfo::where('user_id',auth()->id());
$user_credit->credit += $request->amount;
$user_credit->save();
}
The expected result is to return 1(success). I tested it few days ago and it works as expected but I tried it again today and it is returning me HTML text with no errors. The status is 200 as well. Screenshot just for reference.
How should I debug this?