Przeglądaj źródła

工单+订单支付

whitefang 1 rok temu
rodzic
commit
54ceab8a29

+ 0 - 11
app/api/controller/PayController.php

@@ -34,8 +34,6 @@ class PayController extends BaseApiController
     /**
      * @notes 支付方式
      * @return \think\response\Json
-     * @author 段誉
-     * @date 2023/2/24 17:54
      */
     public function payWay()
     {
@@ -51,8 +49,6 @@ class PayController extends BaseApiController
     /**
      * @notes 预支付
      * @return \think\response\Json
-     * @author 段誉
-     * @date 2023/2/28 14:21
      */
     public function prepay()
     {
@@ -75,8 +71,6 @@ class PayController extends BaseApiController
     /**
      * @notes 获取支付状态
      * @return \think\response\Json
-     * @author 段誉
-     * @date 2023/3/1 16:23
      */
     public function payStatus()
     {
@@ -96,8 +90,6 @@ class PayController extends BaseApiController
      * @throws \EasyWeChat\Kernel\Exceptions\RuntimeException
      * @throws \ReflectionException
      * @throws \Throwable
-     * @author 段誉
-     * @date 2023/2/28 14:21
      */
     public function notifyMnp()
     {
@@ -112,8 +104,6 @@ class PayController extends BaseApiController
      * @throws \EasyWeChat\Kernel\Exceptions\RuntimeException
      * @throws \ReflectionException
      * @throws \Throwable
-     * @author 段誉
-     * @date 2023/2/28 14:21
      */
     public function notifyOa()
     {
@@ -123,7 +113,6 @@ class PayController extends BaseApiController
     /**
      * @notes 支付宝回调
      * @author mjf
-     * @date 2024/3/18 16:50
      */
     public function aliNotify()
     {

+ 1 - 1
app/api/logic/ServiceOrderLogic.php

@@ -107,7 +107,7 @@ class ServiceOrderLogic extends BaseLogic
             ]);
 
             return [
-                'work_sn' => (int)$service_work['work_sn'],
+                'order_id' => (int)$order['id'],
             ];
         } catch (\Exception $e) {
             self::setError($e->getMessage());

+ 4 - 13
app/common/logic/PaymentLogic.php

@@ -44,11 +44,7 @@ class PaymentLogic extends BaseLogic
     public static function getPayWay($userId, $terminal, $params)
     {
         try {
-            if ($params['from'] == 'recharge') {
-                // 充值
-                $order = RechargeOrder::findOrEmpty($params['order_id'])->toArray();
-            }
-
+            $order = RechargeOrder::findOrEmpty($params['order_id'])->toArray();
             if (empty($order)) {
                 throw new \Exception('待支付订单不存在');
             }
@@ -145,15 +141,10 @@ class PaymentLogic extends BaseLogic
     public static function getPayOrderInfo($params)
     {
         try {
-            switch ($params['from']) {
-                case 'recharge':
-                    $order = RechargeOrder::findOrEmpty($params['order_id']);
-                    if ($order->isEmpty()) {
-                        throw new \Exception('充值订单不存在');
-                    }
-                    break;
+            $order = RechargeOrder::findOrEmpty($params['order_id']);
+            if ($order->isEmpty()) {
+                throw new \Exception('订单不存在');
             }
-
             if ($order['pay_status'] == PayEnum::ISPAID) {
                 throw new \Exception('订单已支付');
             }

+ 0 - 1
app/common/service/wechat/WeChatConfigService.php

@@ -129,7 +129,6 @@ class WeChatConfigService
         if (!empty($apiclientKey) && !file_exists($keyPath)) {
             static::setCert($keyPath, trim($apiclientKey));
         }
-
         return [
             // 商户号
             'mch_id' => $pay['config']['mch_id'] ?? '',