Skip to content

Commit

Permalink
Update Utils.php
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue authored Jan 7, 2025
1 parent 6888b87 commit 7e3b320
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Pay/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,11 @@ protected function createSignature(string $message): string
*
* @return string The base64-encoded encrypted text.
*/
public function createRsaEncrypt(string $plaintext, ?string $serial = null): string
public function encryptWithRsaPublicKey(string $plaintext, ?string $serial = null): string
{
$platformCerts = $this->merchant->getPlatformCerts();
$platformCert = $serial ? $this->merchant->getPlatformCert($serial) : reset($platformCerts);
$platformCert = $serial ? $this->merchant->getPlatformCert($serial) : array_key_first($platformCerts);

if (empty($platformCert)) {
throw new InvalidConfigException('Missing platform certificate.');
}
Expand Down

0 comments on commit 7e3b320

Please sign in to comment.