增加聚合支付托管下单
This commit is contained in:
@@ -37,6 +37,7 @@ class ClientHandler
|
||||
|
||||
/**
|
||||
* ClientHandler constructor.
|
||||
*
|
||||
* @param ClientParams $clientParams
|
||||
*/
|
||||
public function __construct(ClientParams $clientParams)
|
||||
@@ -57,9 +58,9 @@ class ClientHandler
|
||||
*/
|
||||
public function execute(ClientExecutionParams $executionParams)
|
||||
{
|
||||
|
||||
$executionContext = $this->getExecutionContext($executionParams);
|
||||
$request = $executionParams->getRequestMarshaller()->marshal($executionParams->getRequest());
|
||||
\Log::channel('yeepay')->info(json_encode($request->getParameters()));
|
||||
|
||||
/** @var ExecutionContext $httpExecutionContext */
|
||||
$httpExecutionContext = $executionContext[0];
|
||||
@@ -81,41 +82,41 @@ class ClientHandler
|
||||
{
|
||||
$httpExecutionContext = new ExecutionContext();
|
||||
$ResponseUnMarshalParams = new ResponseUnMarshalParams();
|
||||
$request = $executionParams->getRequest();
|
||||
$authorizationReq = $this->authorizationReqRegistry->getAuthorizationReq($request::getOperationId());
|
||||
|
||||
$request = $executionParams->getRequest();
|
||||
$authorizationReq = $this->authorizationReqRegistry->getAuthorizationReq($request::getOperationId());
|
||||
if (isset($authorizationReq)) {
|
||||
$signer = SignerFactory::getSigner($authorizationReq->getSignerType());
|
||||
$signOptions = new SignOptions($authorizationReq->getDigestAlg(), $authorizationReq->getProtocolPrefix());
|
||||
$httpExecutionContext->setSigner($signer)->setSignOptions($signOptions);
|
||||
$ResponseUnMarshalParams->setSigner($signer)->setSignOptions($signOptions)
|
||||
->setPublicKey($this->credentialsProvider->getYopPublicKey($authorizationReq->getCredentialType()));
|
||||
->setPublicKey($this->credentialsProvider->getYopPublicKey($authorizationReq->getCredentialType()));
|
||||
|
||||
$credentials = null;
|
||||
$requestConfig = $request->getRequestConfig();
|
||||
$needEncrypt = false;
|
||||
if (isset($requestConfig)) {
|
||||
if (!empty($requestConfig->getCredentials())) {
|
||||
if (! empty($requestConfig->getCredentials())) {
|
||||
$credentials = $requestConfig->getCredentials();
|
||||
} else {
|
||||
$customAppKey = $requestConfig->getAppKey();
|
||||
if (!empty($customAppKey)) {
|
||||
if (! empty($customAppKey)) {
|
||||
$credentials = $this->credentialsProvider->getCredential($customAppKey,
|
||||
$authorizationReq->getCredentialType());
|
||||
if (!isset($credentials)) {
|
||||
if (! isset($credentials)) {
|
||||
throw new YopClientException('no credentials specified, appKey:'.$customAppKey
|
||||
.', credentialType:'.$authorizationReq->getCredentialType());
|
||||
.', credentialType:'.$authorizationReq->getCredentialType());
|
||||
}
|
||||
}
|
||||
}
|
||||
$needEncrypt = $requestConfig->isNeedEncrypt();
|
||||
}
|
||||
if (!isset($credentials)) {
|
||||
if (! isset($credentials)) {
|
||||
$credentials = $this->credentialsProvider->getDefaultAppCredential($authorizationReq->getCredentialType());
|
||||
}
|
||||
if (!isset($credentials)) {
|
||||
if (! isset($credentials)) {
|
||||
throw new YopClientException('no credentials specified for defaultAppKey, credentialType:'
|
||||
.$authorizationReq->getCredentialType());
|
||||
.$authorizationReq->getCredentialType());
|
||||
}
|
||||
$httpExecutionContext->setCredentials($credentials);
|
||||
if ($needEncrypt) {
|
||||
|
||||
Reference in New Issue
Block a user