微信支付 发货信息
parent
6bcc51a5b1
commit
15ecc7a2cd
|
|
@ -109,6 +109,7 @@ class PayService
|
|||
}
|
||||
$data = [
|
||||
"order_key" => [
|
||||
"mchid" => config("wechat.payment.default.mch_id"),
|
||||
"order_number_type" => 1,
|
||||
"out_trade_no" => $payLog->pay_sn,
|
||||
],
|
||||
|
|
@ -117,7 +118,7 @@ class PayService
|
|||
"shipping_list" => [
|
||||
["item_desc" => "定制服务"]
|
||||
],
|
||||
"upload_time" => $payLog->pay_at->format('Y-m-d H:i:s'),
|
||||
"upload_time" => $payLog->pay_at->format('Y-m-d\TH:i:s.vP'),
|
||||
"payer" => [
|
||||
"openid" => $openid
|
||||
]
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@ class WxMpService
|
|||
$app = Factory::miniProgram(config('wechat.mini_program.default'));
|
||||
$accessToken = $app->access_token->getToken()['access_token'];
|
||||
$url = "https://api.weixin.qq.com/wxa/sec/order/upload_shipping_info?access_token=" . $accessToken;
|
||||
$response = Http::post($url, $data);
|
||||
|
||||
$response = Http::withHeaders(['Content-Type' => 'application/json; charset=utf-8'])->withBody(json_encode($data, JSON_UNESCAPED_UNICODE), 'application/json')->post($url);
|
||||
$response->throw();
|
||||
|
||||
$result = $response->json();
|
||||
logger("微信小程序-发货信息录入", $result);
|
||||
$code = data_get($result, "errcode");
|
||||
if ($code != 0) {
|
||||
throw new BizException("失败: (".$code.")" . data_get($result, "errmsg"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue