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