merge to dev fix styles v2.0.0

This commit is contained in:
yansongda 2017-12-25 18:07:23 +08:00
commit 5329bfa757
3 changed files with 5 additions and 4 deletions

View File

@ -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')) {

View File

@ -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();

View File

@ -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);
}