|
@@ -71,6 +71,60 @@ class Kuaishou extends BaseUniPlatform
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function settle($orderNo, $amount)
|
|
|
|
+ {
|
|
|
|
+ $url = $this->API::SETTLE.'?'.http_build_query([
|
|
|
|
+ 'app_id' => $this->appId,
|
|
|
|
+ 'access_token' => $this->accessToken,
|
|
|
|
+ ]);
|
|
|
|
+ $data = [
|
|
|
|
+ 'app_id' => $this->appId,
|
|
|
|
+ 'out_order_no' => $orderNo,
|
|
|
|
+ 'out_settle_no' => $orderNo,
|
|
|
|
+ 'reason' => '主动结算',
|
|
|
|
+ 'notify_url' => env('APP_URL') . '/api/pay/kuaishou/settle',
|
|
|
|
+ 'settle_amount' => $amount
|
|
|
|
+ ];
|
|
|
|
+ $data['sign'] = $this->getSign($data);
|
|
|
|
+
|
|
|
|
+ return $this->post(
|
|
|
|
+ $url,
|
|
|
|
+ $data,
|
|
|
|
+ 'json'
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function pushOrder($openid, $orderId): array
|
|
|
|
+ {
|
|
|
|
+ $data = [
|
|
|
|
+ 'app_id' => $this->appId,
|
|
|
|
+ 'out_order_no' => $orderId,
|
|
|
|
+ 'out_biz_order_no' => $orderId,
|
|
|
|
+ 'open_id' => $openid,
|
|
|
|
+ 'order_create_time' => (int)Carbon::now()->subDays(7)->getPreciseTimestamp(3),
|
|
|
|
+ 'order_status' => 2, // 支付成功
|
|
|
|
+ 'order_path' => 'pages/my/consume',
|
|
|
|
+ 'product_cover_img_id' => '5acfa29b90c8234ff41ede600cad6a9b715f38871eaf5973',
|
|
|
|
+ ];
|
|
|
|
+ $url = $this->API::ORDER_PUSH.'?'.http_build_query([
|
|
|
|
+ 'app_id' => $this->appId,
|
|
|
|
+ 'access_token' => $this->accessToken,
|
|
|
|
+ ]);
|
|
|
|
+ return $this->post($url, $data,'json');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function upload()
|
|
|
|
+ {
|
|
|
|
+ $url = 'https://open.kuaishou.com/openapi/mp/developer/file/img/uploadWithUrl'.'?'.http_build_query([
|
|
|
|
+ 'app_id' => $this->appId,
|
|
|
|
+ 'access_token' => $this->accessToken,
|
|
|
|
+ 'url' => 'http://fourtiao.oss-cn-beijing.aliyuncs.com/zhangsiye/images/664b34c5afb8cb56d4a3cec398e64948.png'
|
|
|
|
+ ]);
|
|
|
|
+ return $this->post(
|
|
|
|
+ $url,
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* @param array $data
|
|
* @param array $data
|