|
|
@@ -7,6 +7,7 @@ use app\common\logic\PaymentLogic;
|
|
|
use app\common\service\pay\AliPayService;
|
|
|
use app\common\service\pay\WeChatPayService;
|
|
|
use app\common\service\pay\WorkerWeChatPayService;
|
|
|
+use app\adminapi\logic\master_worker\MasterWorkerLogic;
|
|
|
use think\facade\Log;
|
|
|
|
|
|
/**
|
|
|
@@ -16,7 +17,7 @@ use think\facade\Log;
|
|
|
*/
|
|
|
class PayController extends \app\workerapi\controller\BaseApiController
|
|
|
{
|
|
|
- public array $notNeedLogin = ['notifyMnp','sharePrepay','notifyOa'];
|
|
|
+ public array $notNeedLogin = ['notifyMnp','sharePrepay','notifyOa','retentionMoneyOrder','retentionMoneyPrepay'];
|
|
|
|
|
|
/**
|
|
|
* @notes 工程师代支付
|
|
|
@@ -94,4 +95,37 @@ class PayController extends \app\workerapi\controller\BaseApiController
|
|
|
{
|
|
|
return (new WorkerWeChatPayService(UserTerminalEnum::WECHAT_OA))->notify();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @notes 质保金缴费订单
|
|
|
+ * @return \think\response\Json
|
|
|
+ */
|
|
|
+ public function retentionMoneyOrder()
|
|
|
+ {
|
|
|
+ $order_id = $this->request->get('order_id');
|
|
|
+ $result = MasterWorkerLogic::retentionMoneyOrderDetail($order_id);
|
|
|
+ return $this->success('', $result);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @notes 质保金预支付
|
|
|
+ * @return \think\response\Json
|
|
|
+ */
|
|
|
+ public function retentionMoneyPrepay()
|
|
|
+ {
|
|
|
+ $params = (new PayValidate())->post()->goCheck();
|
|
|
+ //订单信息
|
|
|
+ $order = PaymentLogic::getPayRetentionMoneyOrderInfo($params);
|
|
|
+ if (false === $order) {
|
|
|
+ return $this->fail(PaymentLogic::getError(), $params);
|
|
|
+ }
|
|
|
+ //支付流程
|
|
|
+ $redirectUrl = $params['redirect'] ?? '/pages/payment/payment';
|
|
|
+ $result = PaymentLogic::workerPay($params['pay_way'], $params['from'], $order, ['openid'=>$params['openid']??''], $redirectUrl);
|
|
|
+ if (false === $result) {
|
|
|
+ return $this->fail(PaymentLogic::getError(), $params);
|
|
|
+ }
|
|
|
+ $result['sn'] = $order['sn'];
|
|
|
+ return $this->success('', $result);
|
|
|
+ }
|
|
|
+
|
|
|
}
|