diff --git a/app/api/controller/order/RetailOrderController.php b/app/api/controller/order/RetailOrderController.php index 4b7f457..603349b 100644 --- a/app/api/controller/order/RetailOrderController.php +++ b/app/api/controller/order/RetailOrderController.php @@ -63,6 +63,7 @@ class RetailOrderController extends BaseApiController * @notes 创建零售订单 */ public function createOrder(){ + // d(WeChatConfigService::getPayConfigByTerminal(1)); $user=User::where('id',$this->request->userId)->find(); $cartId = (Array)$this->request->post('cart_id', []); diff --git a/app/common/logic/PaymentLogic.php b/app/common/logic/PaymentLogic.php index bfa3020..8cab066 100644 --- a/app/common/logic/PaymentLogic.php +++ b/app/common/logic/PaymentLogic.php @@ -63,7 +63,6 @@ class PaymentLogic extends BaseLogic // $order['redirect_url'] = $redirectUrl; // $result = $payService->pay($from, $order); $auth = UserAuth::where(['user_id' => $order['uid'], 'terminal' => $terminal])->findOrEmpty(); - $order = [ 'out_trade_no' => $paySn, 'description' => '商品', @@ -76,9 +75,10 @@ class PaymentLogic extends BaseLogic ], 'attach' => $from ]; + $config = Config::get('payment'); Pay::config($config); - $result = Pay::wechat()->mini($order); + $result = Pay::wechat()->mini($order)->toArray(); break; default: self::$error = '订单异常'; diff --git a/composer.json b/composer.json index b8aa62f..9acbc69 100644 --- a/composer.json +++ b/composer.json @@ -47,8 +47,9 @@ "tinywan/jwt": "^1.9", "next/var-dumper": "^0.1.0", "w7corp/easywechat": "^6.8", + "hyperf/pimple": "~2.2.0", "yansongda/pay": "^3.6", - "hyperf/pimple": "~2.2.0" + "guzzlehttp/guzzle": "^7.8" }, "suggest": { "ext-event": "For better performance. " diff --git a/composer.lock b/composer.lock index 358e89e..bcb76e7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "31c73aec55a41927680c578e301dcb28", + "content-hash": "aec3bdabbcd3d781fd7d055878ca0a66", "packages": [ { "name": "aliyuncs/oss-sdk-php", diff --git a/config/payment.php b/config/payment.php index 71e6e01..1ce5cde 100644 --- a/config/payment.php +++ b/config/payment.php @@ -30,9 +30,9 @@ return [ 'wechat' => [ 'default' => [ // 必填-商户号,服务商模式下为服务商商户号 - 'mch_id' => '1635725673', + 'mch_id' => '1654274867', // 必填-商户秘钥 - 'mch_secret_key' => 'F6C2A57790C667607D8E8C0C00CCF9B6', + 'mch_secret_key' => '7E00D167C9793006C93F4FB4CF65BCC2', // 必填-商户私钥 字符串或路径 'mch_secret_cert' => runtime_path().'/cert/c208f16ad08e6d2516e0b73e6d0ab8da.pem', // 必填-商户公钥证书路径