first commit

This commit is contained in:
2024-04-01 09:54:43 +08:00
commit 899d816bc3
795 changed files with 130040 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
<?php
namespace Yeepay\Yop\Sdk\Service\Bill;
use Yeepay\Yop\Sdk\Client\ClientExecutionParams;
use Yeepay\Yop\Sdk\Client\ClientHandler;
use Yeepay\Yop\Sdk\Client\ClientParams;
use Yeepay\Yop\Sdk\Exception\YopClientException;
use Yeepay\Yop\Sdk\Model\YosDownloadResponse;
use Yeepay\Yop\Sdk\Model\YosDownloadResponseUnMarshaller;
use Yeepay\Yop\Sdk\Service\Bill\Model as Model;
class BillClient
{
/**
* @var ClientHandler
*/
private $clientHandler;
/**
* BillClient constructor.
* @param ClientParams $clientParams
*/
function __construct(ClientParams $clientParams)
{
$this->clientHandler = new ClientHandler($clientParams);
}
/**
* @param Model\DownloadRequest $request
* @return YosDownloadResponse
* @throws YopClientException
*/
public function download(Model\DownloadRequest $request)
{
if ($request == null) {
throw new YopClientException("request is required.");
}
if ($request->getBizType() == null) {
throw new YopClientException("request.bizType is required.");
}
$clientExecutionParams = new ClientExecutionParams($request, Model\DownloadRequestMarshaller::getInstance(),
YosDownloadResponseUnMarshaller::getInstance());
return $this->clientHandler->execute($clientExecutionParams);
}
}