Skip to content

Commit

Permalink
fix #264
Browse files Browse the repository at this point in the history
  • Loading branch information
yansongda committed Aug 12, 2019
1 parent 7b84d1e commit ee2b1fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Gateways/Alipay/Support.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ public static function generateSign(array $params): string
}

if (Str::endsWith($privateKey, '.pem')) {
$privateKey = openssl_pkey_get_private($privateKey);
$privateKey = openssl_pkey_get_private(
Str::startsWith($privateKey, 'file://') ? $privateKey : 'file://'.$privateKey
);
} else {
$privateKey = "-----BEGIN RSA PRIVATE KEY-----\n".
wordwrap($privateKey, 64, "\n", true).
Expand Down

0 comments on commit ee2b1fc

Please sign in to comment.