|
|
@@ -69,6 +69,28 @@ class PayController extends BaseApiController
|
|
|
return $this->success('', $result);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 微信二维码预支付
|
|
|
+ * @return \think\response\Json
|
|
|
+ */
|
|
|
+ public function preNativePay()
|
|
|
+ {
|
|
|
+ $params = (new PayValidate())->post()->goCheck();
|
|
|
+ //订单信息
|
|
|
+ $order = PaymentLogic::getPayOrderInfo($params);
|
|
|
+ if (false === $order) {
|
|
|
+ return $this->fail(PaymentLogic::getError(), $params);
|
|
|
+ }
|
|
|
+ //支付流程
|
|
|
+ $redirectUrl = $params['redirect'] ?? '/pages/payment/payment';
|
|
|
+ $result = PaymentLogic::pay($params['pay_way'], $params['from'], $order, 4, $redirectUrl);
|
|
|
+ if (false === $result) {
|
|
|
+ return $this->fail(PaymentLogic::getError(), $params);
|
|
|
+ }
|
|
|
+ $result['sn'] = $order['sn'];
|
|
|
+ return $this->success('', $result);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* @notes 获取支付状态
|