I am developing an application with the help of another website API. In the scheme in one process I have to respond to the sign that I am receiving data details and in one state must send GET requests to their API again
my code is like this
public function confirm(){
$result = json_decode(file_get_contents('php://input'), true);
return $this->output
->set_content_type('application/json')
->set_status_header(200)
->set_output(json_encode(array(
'status' => 'OK',
'message' => 'Message from merchant if any'
)));
//kirim get untuk confirm order
$url = $this->ci->config->item("kredivo_api_link_confirm");
//load libary kredivo
$this->load->library('CoreKredivo','corekredivo');
//sent to v2/update
$confirm_order = array(
'transaction_id' => 'e75e5b62-5432-4d72-98b4-c5e938c6fbd9',
'signature_key' => 'a7Ijx%2FWgv02I4rvPQSld07uQO9TNMHg%2FFcJsS7EhA2GRKLgKiiYbYrHaLiuMKcG4cG98Iw0vTOPUgeHOZsPhqv3wvAGKgMDgEEMxMmZS3uXG0JIOzdFQc5s0zJ5qlhKZ',
);
//kirim data ke confirmation core kredivo
$confirmation = $this->corekredivo->confirmOrder($url,$confirm_order);
//menerima data dari core kredivo dan melakukan decode
$finalResponse_payment = json_decode($confirmation,true);
//untuk check
$data = array(
'_content' => 'shop/kredivo_2',
'_title' => 'Tes Konfirmasi',
'_respon' => $finalResponse_payment
);
the problem is when I make a return in this section
return $this->output
->set_content_type('application/json')
->set_status_header(200)
->set_output(json_encode(array(
'status' => 'OK',
'message' => 'Message from merchant if any'
)));
the process below is not executed, what is the cause? and maybe there are suggestions
The return keyword stops the function's execution and returns back to the method calling it. Everything written below a return statement is ignored.