0

我使用 codeigniter-restserver 制作了一个 API Restful 以接收来自另一个网站的 POST 请求,scema 在发送响应 json 之后我必须重定向到另一个网站以确认我已收到 transaction_id 和 signature_id

我的代码是这样的

/ untuk menambah person menaggunakan method post
        public function notification_post(){
            //untuk menerima data
            $result = json_decode(file_get_contents('php://input'), true);

            $order_id                   = $result['order_id'];
            $transaction_id         = $result['transaction_id'];
            $signature_key          = $result['signature_key'];

            $response = $this->km->confirm_payment(
                    $order_id,
                    $transaction_id,
                    $signature_key
                );

            $this->response($response);

            //sent to v2/update
            $confirm_order = array(
                'transaction_id' => $transaction_id,
                'signature_key'  => $signature_key,
            );


            //redirect ke halaman confirm
            $link = 'http://68731fea.ngrok.io/matoa-admin/transaksi/confirm';

            redirect($link, 'location');
        }

问题是,我如何在发送 $this->response($response); 后重定向到 $link

在此处输入图像描述

4

0 回答 0