添加退款接口

This commit is contained in:
“wanyongkang”
2024-12-02 15:02:24 +08:00
parent e77389d7a0
commit b9bd680fb1

View File

@@ -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;
}
}