mirror of
https://gitee.com/yansongda/pay.git
synced 2024-12-05 05:39:07 +08:00
merge to dev fix styles v2.0.0
This commit is contained in:
commit
5329bfa757
@ -90,7 +90,7 @@ class Support
|
||||
public static function generateSign($parmas, $privateKey = null): string
|
||||
{
|
||||
if (is_null($privateKey)) {
|
||||
throw new InvalidConfigException('Missing Alipay Config -- [private_key]');
|
||||
throw new InvalidConfigException('Missing Alipay Config -- [private_key]', 1);
|
||||
}
|
||||
|
||||
if (Str::endsWith($privateKey, '.pem')) {
|
||||
@ -121,7 +121,7 @@ class Support
|
||||
public static function verifySign($data, $publicKey = null, $sync = false, $sign = null): bool
|
||||
{
|
||||
if (is_null($publicKey)) {
|
||||
throw new InvalidConfigException('Missing Alipay Config -- [ali_public_key]');
|
||||
throw new InvalidConfigException('Missing Alipay Config -- [ali_public_key]', 2);
|
||||
}
|
||||
|
||||
if (Str::endsWith($publicKey, '.pem')) {
|
||||
|
@ -18,7 +18,7 @@ class AppGateway extends Gateway
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function pay($endpoint, array $payload)
|
||||
public function pay($endpoint, array $payload): Response
|
||||
{
|
||||
$payload['appid'] = $this->config->get('appid');
|
||||
$payload['trade_type'] = $this->getTradeType();
|
||||
|
@ -63,7 +63,7 @@ class Support
|
||||
$result = self::getInstance()->post(
|
||||
$endpoint,
|
||||
self::toXml($data),
|
||||
($certClient && $certKey) ? ['cert' => $certClient, 'ssl_key' => $certKey] : null
|
||||
($certClient !== null && $certKey !== null) ? ['cert' => $certClient, 'ssl_key' => $certKey] : []
|
||||
);
|
||||
|
||||
$result = self::fromXml($result);
|
||||
@ -74,6 +74,7 @@ class Support
|
||||
20000,
|
||||
$result
|
||||
);
|
||||
|
||||
return new Collection($result);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user