添加退款接口
This commit is contained in:
@@ -207,4 +207,33 @@ class Account
|
|||||||
|
|
||||||
echo $result;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user