mirror of
https://gitee.com/yansongda/pay.git
synced 2024-12-02 04:08:21 +08:00
update
This commit is contained in:
parent
342493c5a5
commit
a976e0870c
@ -13,7 +13,8 @@ use Yansongda\Supports\Str;
|
||||
if (!function_exists('should_http_request')) {
|
||||
function should_http_request(Rocket $rocket): bool
|
||||
{
|
||||
return !in_array(NoHttpRequestParser::class, class_parents($rocket->getDirection()));
|
||||
return NoHttpRequestParser::class !== $rocket->getDirection() &&
|
||||
!in_array(NoHttpRequestParser::class, class_parents($rocket->getDirection()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ namespace Yansongda\Pay\Plugin\Alipay;
|
||||
use Closure;
|
||||
use Yansongda\Pay\Contract\PluginInterface;
|
||||
use Yansongda\Pay\Exception\InvalidResponseException;
|
||||
use Yansongda\Pay\Parser\NoHttpRequestParser;
|
||||
use Yansongda\Pay\Rocket;
|
||||
use Yansongda\Supports\Collection;
|
||||
|
||||
@ -23,7 +24,7 @@ class CallbackPlugin implements PluginInterface
|
||||
{
|
||||
$this->filterPayload($rocket);
|
||||
|
||||
if ($rocket->getParams()['sign'] ?? false) {
|
||||
if (!($rocket->getParams()['sign'] ?? false)) {
|
||||
throw new InvalidResponseException(InvalidResponseException::INVALID_RESPONSE_SIGN, '', $rocket->getParams());
|
||||
}
|
||||
|
||||
@ -35,6 +36,9 @@ class CallbackPlugin implements PluginInterface
|
||||
throw new InvalidResponseException(InvalidResponseException::INVALID_RESPONSE_SIGN, '', $rocket->getParams());
|
||||
}
|
||||
|
||||
$rocket->setDirection(NoHttpRequestParser::class)
|
||||
->setDestination($rocket->getPayload());
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,7 @@ class Alipay extends AbstractProvider
|
||||
$response = $this->getCallbackParams($contents);
|
||||
|
||||
return $this->pay(
|
||||
[CallbackPlugin::class], array_merge($response, $config ?? [])
|
||||
[CallbackPlugin::class], $response->merge($config)->all()
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user