@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | $result = $this->getCertSn($ssl['issuer'] ?? [], $ssl['serialNumber'] ?? ''); |
| 119 | 119 | |
| 120 | - Pay::get(ConfigInterface::class)->set('alipay.'.$tenant.'.app_public_cert_sn', $result); |
|
| 120 | + Pay::get(ConfigInterface::class)->set('alipay.' . $tenant . '.app_public_cert_sn', $result); |
|
| 121 | 121 | |
| 122 | 122 | return $result; |
| 123 | 123 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | continue; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - $ssl = openssl_x509_parse($cert.'-----END CERTIFICATE-----'); |
|
| 150 | + $ssl = openssl_x509_parse($cert . '-----END CERTIFICATE-----'); |
|
| 151 | 151 | |
| 152 | 152 | if (false === $ssl) { |
| 153 | 153 | throw new InvalidConfigException(Exception::CONFIG_ALIPAY_INVALID, '配置异常: 解析 `alipay_root_cert` 失败'); |
@@ -156,20 +156,20 @@ discard block |
||
| 156 | 156 | $detail = $this->formatCert($ssl); |
| 157 | 157 | |
| 158 | 158 | if ('sha1WithRSAEncryption' == $detail['signatureTypeLN'] || 'sha256WithRSAEncryption' == $detail['signatureTypeLN']) { |
| 159 | - $sn .= $this->getCertSn($detail['issuer'], $detail['serialNumber']).'_'; |
|
| 159 | + $sn .= $this->getCertSn($detail['issuer'], $detail['serialNumber']) . '_'; |
|
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | $result = substr($sn, 0, -1); |
| 164 | 164 | |
| 165 | - Pay::get(ConfigInterface::class)->set('alipay.'.$tenant.'.alipay_root_cert_sn', $result); |
|
| 165 | + Pay::get(ConfigInterface::class)->set('alipay.' . $tenant . '.alipay_root_cert_sn', $result); |
|
| 166 | 166 | |
| 167 | 167 | return $result; |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | protected function getCertSn(array $issuer, string $serialNumber): string |
| 171 | 171 | { |
| 172 | - return md5($this->array2string(array_reverse($issuer)).$serialNumber); |
|
| 172 | + return md5($this->array2string(array_reverse($issuer)) . $serialNumber); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | protected function array2string(array $array): string |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $string = []; |
| 178 | 178 | |
| 179 | 179 | foreach ($array as $key => $value) { |
| 180 | - $string[] = $key.'='.$value; |
|
| 180 | + $string[] = $key . '=' . $value; |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | return implode(',', $string); |