From b9bd680fb1d3bbe716df789d53b94a5f547e929a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Mon, 2 Dec 2024 15:02:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=80=E6=AC=BE=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Account.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/app/api/controller/Account.php b/app/api/controller/Account.php index 9c77e2d..8d697fe 100644 --- a/app/api/controller/Account.php +++ b/app/api/controller/Account.php @@ -207,4 +207,33 @@ class Account echo $result; } + + + //退款 + public function refund() + { + //获取传递的数据 + $data = $_GET; + $url = 'http://localhost:5000/api/course/v1/order/ApiRefund'; + + $params = array( + "apikey" => $data['apikey'], + "Account" => $data['account'] + ); + + $data_string = json_encode($params); + + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); + curl_setopt($ch, CURLOPT_POSTFIELDS,$data_string); + curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); + curl_setopt($ch, CURLOPT_HTTPHEADER, array( + 'Content-Type: application/json', + 'Content-Length: ' . strlen($data_string)) + ); + + $result = curl_exec($ch); + + echo $result; + } } \ No newline at end of file