|
|
|
@ -39,6 +39,9 @@ class PaymentController extends BaseController |
|
|
|
'openid' => $data['openid'], |
|
|
|
]); |
|
|
|
|
|
|
|
$result['sign_type'] = 'MD5'; |
|
|
|
$result['timestamp'] = time(); |
|
|
|
|
|
|
|
return $this->success($result); |
|
|
|
} |
|
|
|
|
|
|
|
@ -57,18 +60,21 @@ class PaymentController extends BaseController |
|
|
|
->first(); |
|
|
|
|
|
|
|
if (empty($orderMain)) { |
|
|
|
return $this->result(ErrorCode::PAY_FAILURE, ['order_id' => $data['order_id']],'订单不存在或已失效'); |
|
|
|
return $this->result(ErrorCode::PAY_FAILURE, $data,'订单不存在或已失效'); |
|
|
|
} |
|
|
|
|
|
|
|
$result = $app->order->unify([ |
|
|
|
'body' => '懒族生活 - 当面支付', |
|
|
|
'out_trade_no' => $orderMain->global_order_id, |
|
|
|
'total_fee' => bcmul(floatval($orderMain->money), 100), |
|
|
|
'total_fee' => bcmul(floatval($orderMain->money), 100, 0), |
|
|
|
'notify_url' => config('site_host') . '/v1/notify/wxminiOffline', |
|
|
|
'trade_type' => 'JSAPI', |
|
|
|
'openid' => $data['openid'], |
|
|
|
]); |
|
|
|
|
|
|
|
$result['sign_type'] = 'MD5'; |
|
|
|
$result['timestamp'] = time(); |
|
|
|
|
|
|
|
return $this->success($result); |
|
|
|
} |
|
|
|
|