|
|
@@ -486,7 +486,7 @@ class DouYinService
|
|
|
return $str;
|
|
|
}
|
|
|
public static function getClientToken() {
|
|
|
- $url = 'https://open.douyin.com/oauth/client_token/';
|
|
|
+ $url = config('douyin.host').'oauth/client_token/';
|
|
|
$cache_name = 'dy_client_token';
|
|
|
$cache_data = cache($cache_name);
|
|
|
if(empty($cache_data) || $cache_data == null){
|
|
|
@@ -517,7 +517,7 @@ class DouYinService
|
|
|
|
|
|
//通过后向抖音申请退款
|
|
|
//getClientToken()
|
|
|
- $url = 'https://open.douyin.com/api/trade_basic/v1/developer/refund_create/';
|
|
|
+ $url = config('douyin.host').'api/trade_basic/v1/developer/refund_create/';
|
|
|
$data = [
|
|
|
"order_id" => $orderInfo['transaction_id'],
|
|
|
"out_refund_no" => $douyinRefundOrder->refund_number,
|
|
|
@@ -527,7 +527,7 @@ class DouYinService
|
|
|
"params" => json_encode(['refund_number'=>$douyinRefundOrder->refund_number])
|
|
|
],
|
|
|
"refund_total_amount " => $douyinRefundOrder->refund_amount * 100,
|
|
|
- //"notify_url" => "https://xxx",
|
|
|
+ "notify_url" => config('douyin.refundNotifyUrl'),
|
|
|
"refund_reason" => [
|
|
|
[
|
|
|
"code" => 101,
|
|
|
@@ -535,7 +535,7 @@ class DouYinService
|
|
|
]
|
|
|
]
|
|
|
];
|
|
|
- $res = http_request($url,json_encode($data));
|
|
|
+ $res = http_request($url,$data,['Content-Type' => 'application/json;charset=utf-8','access_token' => self::getClientToken()]);
|
|
|
if(isset($res['err_msg']) && $res['err_msg'] === 'success'){
|
|
|
$douyinRefundOrder->transaction_id = $res['data']['refund_id'];
|
|
|
$douyinRefundOrder->save();
|