This commit is contained in:
xl
2023-11-14 12:39:28 +08:00
parent c3326a9b5a
commit f92fdab692
15 changed files with 245 additions and 272 deletions
+1 -18
View File
@@ -12,28 +12,11 @@ use wchat\common\Help;
*/
const BLOCK_SIZE = 16;
/**
* Bytes length of the AES secret key.
*/
const KEY_LENGTH_BYTE = 32;
/**
* Bytes Length of the authentication tag in AEAD cipher mode
* @deprecated 1.0 - As of the OpenSSL described, the `auth_tag` length may be one of 16, 15, 14, 13, 12, 8 or 4.
* Keep it only compatible for the samples on the official documentation.
*/
const AUTH_TAG_LENGTH_BYTE = 16;
/**
* The `aes-256-gcm` algorithm string
*/
const ALGO_AES_256_GCM = 'aes-256-gcm';
/**
* The `aes-256-ecb` algorithm string
*/
const ALGO_AES_256_ECB = 'aes-256-ecb';
trait WxV3PaymentTait
{
@@ -111,7 +94,7 @@ trait WxV3PaymentTait
{
$payConfig = $this->getPayConfig();
$mch_private_key = openssl_get_privatekey($payConfig->pay->wx->mchKey);
$mch_private_key = openssl_get_privatekey(file_get_contents($payConfig->pay->wx->mchKey));
openssl_sign($body, $raw_sign, $mch_private_key, 'sha256WithRSAEncryption');
return base64_encode($raw_sign);