wesmiler 6 ore fa
parent
commit
1ef644fb1b
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      app/Services/PaymentService.php

+ 2 - 0
app/Services/PaymentService.php

@@ -74,6 +74,7 @@ class PaymentService extends BaseService
                 $mchid = isset($config['wxpay_mchd']) ? $config['wxpay_mchd'] : '';
                 $secretV3Key = isset($config['wxpay_key_v3']) ? $config['wxpay_key_v3'] : '';
                 $secretV2Key = isset($config['wxpay_key_v2']) ? $config['wxpay_key_v2'] : '';
+                $publicKeyId = isset($config['public_key_id']) ? $config['public_key_id'] : '';
                 $wxpaySecretCert = isset($config['wxpay_secret_cert']) ? $config['wxpay_secret_cert'] : '';
                 $wxpayPublicCert = isset($config['wxpay_public_cert']) ? $config['wxpay_public_cert'] : '';
                 if (empty($appid) || empty($mchid) || empty($secretV3Key)) {
@@ -84,6 +85,7 @@ class PaymentService extends BaseService
                 // 支付参数
                 $payConfig = config('payment.wechat');
                 $payConfig['wechat']['default']['mch_id'] = $mchid;
+                $payConfig['wechat']['default']['wechat_public_cert_path']["PUB_KEY_ID_{$publicKeyId}"] = base_path().'/resources/certs/wechat/pub_key.pem';
 
                 if ($payPt == 'min') {
                     // 小程序支付