增加聚合支付托管下单

This commit is contained in:
2024-04-01 17:07:53 +08:00
parent 899d816bc3
commit f8299b36aa
1291 changed files with 220566 additions and 169 deletions

View File

@@ -0,0 +1,392 @@
<?php
/**
* QrcodeBatchGenerateBatchGenerateQrCodeResponseDTOResult
*
* PHP version 5
*
* @category Class
* @package Yeepay\Yop\Sdk\
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* 电信支付
*
* <p>电信行业线易宝通应用-支付服务</p>
*
* OpenAPI spec version: 1.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.13
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Yeepay\Yop\Sdk\Service\TelPay\Model;
use \ArrayAccess;
use Yeepay\Yop\Sdk\Model\ModelInterface;
use Yeepay\Yop\Sdk\Utils\ObjectSerializer;
/**
* QrcodeBatchGenerateBatchGenerateQrCodeResponseDTOResult Class Doc Comment
*
* @category Class
* @package Yeepay\Yop\Sdk\
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class QrcodeBatchGenerateBatchGenerateQrCodeResponseDTOResult implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'QrcodeBatchGenerateBatchGenerateQrCodeResponseDTOResult';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'retCode' => 'string',
'retMsg' => 'string',
'qrCodeInfo' => '\Yeepay\Yop\Sdk\Service\TelPay\Model\QrcodeBatchGenerateQrCodeApiInfoResult[]',
'requestId' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'retCode' => null,
'retMsg' => null,
'qrCodeInfo' => null,
'requestId' => null
];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'retCode' => 'retCode',
'retMsg' => 'retMsg',
'qrCodeInfo' => 'qrCodeInfo',
'requestId' => 'requestId'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'retCode' => 'setRetCode',
'retMsg' => 'setRetMsg',
'qrCodeInfo' => 'setQrCodeInfo',
'requestId' => 'setRequestId'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'retCode' => 'getRetCode',
'retMsg' => 'getRetMsg',
'qrCodeInfo' => 'getQrCodeInfo',
'requestId' => 'getRequestId'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['retCode'] = isset($data['retCode']) ? $data['retCode'] : null;
$this->container['retMsg'] = isset($data['retMsg']) ? $data['retMsg'] : null;
$this->container['qrCodeInfo'] = isset($data['qrCodeInfo']) ? $data['qrCodeInfo'] : null;
$this->container['requestId'] = isset($data['requestId']) ? $data['requestId'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets retCode
*
* @return string
*/
public function getRetCode()
{
return $this->container['retCode'];
}
/**
* Sets retCode
*
* @param string $retCode 返回码
*
* @return $this
*/
public function setRetCode($retCode)
{
$this->container['retCode'] = $retCode;
return $this;
}
/**
* Gets retMsg
*
* @return string
*/
public function getRetMsg()
{
return $this->container['retMsg'];
}
/**
* Sets retMsg
*
* @param string $retMsg 返回信息
*
* @return $this
*/
public function setRetMsg($retMsg)
{
$this->container['retMsg'] = $retMsg;
return $this;
}
/**
* Gets qrCodeInfo
*
* @return \Yeepay\Yop\Sdk\Service\TelPay\Model\QrcodeBatchGenerateQrCodeApiInfoResult[]
*/
public function getQrCodeInfo()
{
return $this->container['qrCodeInfo'];
}
/**
* Sets qrCodeInfo
*
* @param \Yeepay\Yop\Sdk\Service\TelPay\Model\QrcodeBatchGenerateQrCodeApiInfoResult[] $qrCodeInfo 二维码信息
*
* @return $this
*/
public function setQrCodeInfo($qrCodeInfo)
{
$this->container['qrCodeInfo'] = $qrCodeInfo;
return $this;
}
/**
* Gets requestId
*
* @return string
*/
public function getRequestId()
{
return $this->container['requestId'];
}
/**
* Sets requestId
*
* @param string $requestId 请求号
*
* @return $this
*/
public function setRequestId($requestId)
{
$this->container['requestId'] = $requestId;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View File

@@ -0,0 +1,452 @@
<?php
/**
* QrcodeBatchGenerateQrCodeApiInfoResult
*
* PHP version 5
*
* @category Class
* @package Yeepay\Yop\Sdk\
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* 电信支付
*
* <p>电信行业线易宝通应用-支付服务</p>
*
* OpenAPI spec version: 1.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.13
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Yeepay\Yop\Sdk\Service\TelPay\Model;
use \ArrayAccess;
use Yeepay\Yop\Sdk\Model\ModelInterface;
use Yeepay\Yop\Sdk\Utils\ObjectSerializer;
/**
* QrcodeBatchGenerateQrCodeApiInfoResult Class Doc Comment
*
* @category Class
* @package Yeepay\Yop\Sdk\
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class QrcodeBatchGenerateQrCodeApiInfoResult implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'QrcodeBatchGenerateQrCodeApiInfoResult';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'qrId' => 'string',
'merchantNo' => 'string',
'qrShortName' => 'string',
'qrStatus' => 'string',
'qrContent' => 'string',
'createTime' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'qrId' => null,
'merchantNo' => null,
'qrShortName' => null,
'qrStatus' => null,
'qrContent' => null,
'createTime' => null
];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'qrId' => 'qrId',
'merchantNo' => 'merchantNo',
'qrShortName' => 'qrShortName',
'qrStatus' => 'qrStatus',
'qrContent' => 'qrContent',
'createTime' => 'createTime'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'qrId' => 'setQrId',
'merchantNo' => 'setMerchantNo',
'qrShortName' => 'setQrShortName',
'qrStatus' => 'setQrStatus',
'qrContent' => 'setQrContent',
'createTime' => 'setCreateTime'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'qrId' => 'getQrId',
'merchantNo' => 'getMerchantNo',
'qrShortName' => 'getQrShortName',
'qrStatus' => 'getQrStatus',
'qrContent' => 'getQrContent',
'createTime' => 'getCreateTime'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['qrId'] = isset($data['qrId']) ? $data['qrId'] : null;
$this->container['merchantNo'] = isset($data['merchantNo']) ? $data['merchantNo'] : null;
$this->container['qrShortName'] = isset($data['qrShortName']) ? $data['qrShortName'] : null;
$this->container['qrStatus'] = isset($data['qrStatus']) ? $data['qrStatus'] : null;
$this->container['qrContent'] = isset($data['qrContent']) ? $data['qrContent'] : null;
$this->container['createTime'] = isset($data['createTime']) ? $data['createTime'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets qrId
*
* @return string
*/
public function getQrId()
{
return $this->container['qrId'];
}
/**
* Sets qrId
*
* @param string $qrId 二维码id
*
* @return $this
*/
public function setQrId($qrId)
{
$this->container['qrId'] = $qrId;
return $this;
}
/**
* Gets merchantNo
*
* @return string
*/
public function getMerchantNo()
{
return $this->container['merchantNo'];
}
/**
* Sets merchantNo
*
* @param string $merchantNo 收款商编
*
* @return $this
*/
public function setMerchantNo($merchantNo)
{
$this->container['merchantNo'] = $merchantNo;
return $this;
}
/**
* Gets qrShortName
*
* @return string
*/
public function getQrShortName()
{
return $this->container['qrShortName'];
}
/**
* Sets qrShortName
*
* @param string $qrShortName 二维码简称
*
* @return $this
*/
public function setQrShortName($qrShortName)
{
$this->container['qrShortName'] = $qrShortName;
return $this;
}
/**
* Gets qrStatus
*
* @return string
*/
public function getQrStatus()
{
return $this->container['qrStatus'];
}
/**
* Sets qrStatus
*
* @param string $qrStatus 二维码状态
*
* @return $this
*/
public function setQrStatus($qrStatus)
{
$this->container['qrStatus'] = $qrStatus;
return $this;
}
/**
* Gets qrContent
*
* @return string
*/
public function getQrContent()
{
return $this->container['qrContent'];
}
/**
* Sets qrContent
*
* @param string $qrContent 二维码地址信息
*
* @return $this
*/
public function setQrContent($qrContent)
{
$this->container['qrContent'] = $qrContent;
return $this;
}
/**
* Gets createTime
*
* @return string
*/
public function getCreateTime()
{
return $this->container['createTime'];
}
/**
* Sets createTime
*
* @param string $createTime 创建时间
*
* @return $this
*/
public function setCreateTime($createTime)
{
$this->container['createTime'] = $createTime;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View File

@@ -0,0 +1,142 @@
<?php
namespace Yeepay\Yop\Sdk\Service\TelPay\Model;
class QrcodeBatchGenerateRequest extends \Yeepay\Yop\Sdk\Model\BaseRequest
{
/**
* @var string
*/
private $parentMerchantNo;
/**
* @var string
*/
private $merchantNo;
/**
* @var string
*/
private $requestId;
/**
* @var string
*/
private $qrCodeInfo;
/**
* @var string
*/
private $districtCode;
/**
* Gets parentMerchantNo
*
* @return string
*/
public function getParentMerchantNo()
{
return $this->parentMerchantNo;
}
/**
* Sets parentMerchantNo
*
* @param string $parentMerchantNo
* @return QrcodeBatchGenerateRequest
*/
public function setParentMerchantNo($parentMerchantNo)
{
$this->parentMerchantNo = $parentMerchantNo;
return $this;
}
/**
* Gets merchantNo
*
* @return string
*/
public function getMerchantNo()
{
return $this->merchantNo;
}
/**
* Sets merchantNo
*
* @param string $merchantNo
* @return QrcodeBatchGenerateRequest
*/
public function setMerchantNo($merchantNo)
{
$this->merchantNo = $merchantNo;
return $this;
}
/**
* Gets requestId
*
* @return string
*/
public function getRequestId()
{
return $this->requestId;
}
/**
* Sets requestId
*
* @param string $requestId
* @return QrcodeBatchGenerateRequest
*/
public function setRequestId($requestId)
{
$this->requestId = $requestId;
return $this;
}
/**
* Gets qrCodeInfo
*
* @return string
*/
public function getQrCodeInfo()
{
return $this->qrCodeInfo;
}
/**
* Sets qrCodeInfo
*
* @param string $qrCodeInfo
* @return QrcodeBatchGenerateRequest
*/
public function setQrCodeInfo($qrCodeInfo)
{
$this->qrCodeInfo = $qrCodeInfo;
return $this;
}
/**
* Gets districtCode
*
* @return string
*/
public function getDistrictCode()
{
return $this->districtCode;
}
/**
* Sets districtCode
*
* @param string $districtCode
* @return QrcodeBatchGenerateRequest
*/
public function setDistrictCode($districtCode)
{
$this->districtCode = $districtCode;
return $this;
}
public static function getOperationId()
{
return 'qrcodeBatchGenerate';
}
}

View File

@@ -0,0 +1,92 @@
<?php
namespace Yeepay\Yop\Sdk\Service\TelPay\Model;
use Yeepay\Yop\Sdk\Http\Headers;
use Yeepay\Yop\Sdk\Internal\DefaultRequest;
use Yeepay\Yop\Sdk\Internal\Request;
use Yeepay\Yop\Sdk\Model\Transform\RequestMarshaller;
use Yeepay\Yop\Sdk\Utils\ObjectSerializer;
use Yeepay\Yop\Sdk\Utils\UUIDUtils;
class QrcodeBatchGenerateRequestMarshaller implements RequestMarshaller
{
/**
* @var QrcodeBatchGenerateRequestMarshaller
*/
private static $instance;
public static function __init()
{
self::$instance = new QrcodeBatchGenerateRequestMarshaller();
}
/**
* @return QrcodeBatchGenerateRequestMarshaller
*/
public static function getInstance()
{
return self::$instance;
}
/**
* @var string
*/
private $serviceName = 'TelPay';
/**
* @var string
*/
private $httpMethod = 'POST';
/**
* @var string
*/
private $resourcePath = '/rest/v1.0/tel-pay/qrcode/batch-generate';
/**
* @var string
*/
private $contentType = 'application/x-www-form-urlencoded';
/**
* @param QrcodeBatchGenerateRequest $request
* @return Request
*/
public function marshal($request)
{
$internalRequest = new DefaultRequest($this->serviceName);
$internalRequest->setResourcePath($this->resourcePath);
$internalRequest->setHttpMethod($this->httpMethod);
if (!empty($request->getRequestConfig()) && !empty($request->getRequestConfig()->getCustomRequestHeaders())) {
foreach ($request->getRequestConfig()->getCustomRequestHeaders() as $name => $value) {
$internalRequest->addHeader($name, $value);
}
}
if (!isset($internalRequest->getHeaders()[Headers::YOP_REQUEST_ID])) {
$internalRequest->addHeader(Headers::YOP_REQUEST_ID, UUIDUtils::uuid());
}
if($request->getParentMerchantNo() != null){
$internalRequest->addParameter('parentMerchantNo', ObjectSerializer::sanitizeForSerialization($request->getParentMerchantNo(), 'string'));
}
if($request->getMerchantNo() != null){
$internalRequest->addParameter('merchantNo', ObjectSerializer::sanitizeForSerialization($request->getMerchantNo(), 'string'));
}
if($request->getRequestId() != null){
$internalRequest->addParameter('requestId', ObjectSerializer::sanitizeForSerialization($request->getRequestId(), 'string'));
}
if($request->getQrCodeInfo() != null){
$internalRequest->addParameter('qrCodeInfo', ObjectSerializer::sanitizeForSerialization($request->getQrCodeInfo(), 'string'));
}
if($request->getDistrictCode() != null){
$internalRequest->addParameter('districtCode', ObjectSerializer::sanitizeForSerialization($request->getDistrictCode(), 'string'));
}
$internalRequest->addHeader(Headers::CONTENT_TYPE, $this->contentType);
return $internalRequest;
}
}
QrcodeBatchGenerateRequestMarshaller::__init();

View File

@@ -0,0 +1,34 @@
<?php
namespace Yeepay\Yop\Sdk\Service\TelPay\Model;
class QrcodeBatchGenerateResponse extends \Yeepay\Yop\Sdk\Model\BaseResponse
{
/**
* @var QrcodeBatchGenerateBatchGenerateQrCodeResponseDTOResult
*/
private $result;
function getResultClass()
{
return '\Yeepay\Yop\Sdk\Service\TelPay\Model\QrcodeBatchGenerateBatchGenerateQrCodeResponseDTOResult';
}
/**
* @param QrcodeBatchGenerateBatchGenerateQrCodeResponseDTOResult $result
*/
function setResult($result)
{
$this->result = $result;
}
/**
* @return QrcodeBatchGenerateBatchGenerateQrCodeResponseDTOResult
*/
function getResult()
{
return $this->result;
}
}

View File

@@ -0,0 +1,39 @@
<?php
namespace Yeepay\Yop\Sdk\Service\TelPay\Model;
use Yeepay\Yop\Sdk\Model\Transform\BaseResponseUnMarshaller;
class QrcodeBatchGenerateResponseUnMarshaller extends BaseResponseUnMarshaller
{
/**
* @var QrcodeBatchGenerateResponseUnMarshaller
*/
private static $instance;
public static function __init()
{
self::$instance = new QrcodeBatchGenerateResponseUnMarshaller();
}
/**
* @return QrcodeBatchGenerateResponseUnMarshaller
*/
public static function getInstance()
{
return self::$instance;
}
/**
* @return QrcodeBatchGenerateResponse
*/
protected function getResponseInstance()
{
return new QrcodeBatchGenerateResponse();
}
}
QrcodeBatchGenerateResponseUnMarshaller::__init();

View File

@@ -0,0 +1,452 @@
<?php
/**
* QrcodeQueryQrCodeApiInfoResult
*
* PHP version 5
*
* @category Class
* @package Yeepay\Yop\Sdk\
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* 电信支付
*
* <p>电信行业线易宝通应用-支付服务</p>
*
* OpenAPI spec version: 1.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.13
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Yeepay\Yop\Sdk\Service\TelPay\Model;
use \ArrayAccess;
use Yeepay\Yop\Sdk\Model\ModelInterface;
use Yeepay\Yop\Sdk\Utils\ObjectSerializer;
/**
* QrcodeQueryQrCodeApiInfoResult Class Doc Comment
*
* @category Class
* @package Yeepay\Yop\Sdk\
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class QrcodeQueryQrCodeApiInfoResult implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'QrcodeQueryQrCodeApiInfoResult';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'qrId' => 'string',
'merchantNo' => 'string',
'qrShortName' => 'string',
'qrStatus' => 'string',
'qrContent' => 'string',
'createTime' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'qrId' => null,
'merchantNo' => null,
'qrShortName' => null,
'qrStatus' => null,
'qrContent' => null,
'createTime' => null
];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'qrId' => 'qrId',
'merchantNo' => 'merchantNo',
'qrShortName' => 'qrShortName',
'qrStatus' => 'qrStatus',
'qrContent' => 'qrContent',
'createTime' => 'createTime'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'qrId' => 'setQrId',
'merchantNo' => 'setMerchantNo',
'qrShortName' => 'setQrShortName',
'qrStatus' => 'setQrStatus',
'qrContent' => 'setQrContent',
'createTime' => 'setCreateTime'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'qrId' => 'getQrId',
'merchantNo' => 'getMerchantNo',
'qrShortName' => 'getQrShortName',
'qrStatus' => 'getQrStatus',
'qrContent' => 'getQrContent',
'createTime' => 'getCreateTime'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['qrId'] = isset($data['qrId']) ? $data['qrId'] : null;
$this->container['merchantNo'] = isset($data['merchantNo']) ? $data['merchantNo'] : null;
$this->container['qrShortName'] = isset($data['qrShortName']) ? $data['qrShortName'] : null;
$this->container['qrStatus'] = isset($data['qrStatus']) ? $data['qrStatus'] : null;
$this->container['qrContent'] = isset($data['qrContent']) ? $data['qrContent'] : null;
$this->container['createTime'] = isset($data['createTime']) ? $data['createTime'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets qrId
*
* @return string
*/
public function getQrId()
{
return $this->container['qrId'];
}
/**
* Sets qrId
*
* @param string $qrId 二维码id
*
* @return $this
*/
public function setQrId($qrId)
{
$this->container['qrId'] = $qrId;
return $this;
}
/**
* Gets merchantNo
*
* @return string
*/
public function getMerchantNo()
{
return $this->container['merchantNo'];
}
/**
* Sets merchantNo
*
* @param string $merchantNo 收款商编
*
* @return $this
*/
public function setMerchantNo($merchantNo)
{
$this->container['merchantNo'] = $merchantNo;
return $this;
}
/**
* Gets qrShortName
*
* @return string
*/
public function getQrShortName()
{
return $this->container['qrShortName'];
}
/**
* Sets qrShortName
*
* @param string $qrShortName 二维码简称
*
* @return $this
*/
public function setQrShortName($qrShortName)
{
$this->container['qrShortName'] = $qrShortName;
return $this;
}
/**
* Gets qrStatus
*
* @return string
*/
public function getQrStatus()
{
return $this->container['qrStatus'];
}
/**
* Sets qrStatus
*
* @param string $qrStatus 二维码状态
*
* @return $this
*/
public function setQrStatus($qrStatus)
{
$this->container['qrStatus'] = $qrStatus;
return $this;
}
/**
* Gets qrContent
*
* @return string
*/
public function getQrContent()
{
return $this->container['qrContent'];
}
/**
* Sets qrContent
*
* @param string $qrContent 二维码地址信息
*
* @return $this
*/
public function setQrContent($qrContent)
{
$this->container['qrContent'] = $qrContent;
return $this;
}
/**
* Gets createTime
*
* @return string
*/
public function getCreateTime()
{
return $this->container['createTime'];
}
/**
* Sets createTime
*
* @param string $createTime 创建时间
*
* @return $this
*/
public function setCreateTime($createTime)
{
$this->container['createTime'] = $createTime;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View File

@@ -0,0 +1,422 @@
<?php
/**
* QrcodeQueryQueryQrCodeApiResponseDTOResult
*
* PHP version 5
*
* @category Class
* @package Yeepay\Yop\Sdk\
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* 电信支付
*
* <p>电信行业线易宝通应用-支付服务</p>
*
* OpenAPI spec version: 1.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.13
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Yeepay\Yop\Sdk\Service\TelPay\Model;
use \ArrayAccess;
use Yeepay\Yop\Sdk\Model\ModelInterface;
use Yeepay\Yop\Sdk\Utils\ObjectSerializer;
/**
* QrcodeQueryQueryQrCodeApiResponseDTOResult Class Doc Comment
*
* @category Class
* @package Yeepay\Yop\Sdk\
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class QrcodeQueryQueryQrCodeApiResponseDTOResult implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'QrcodeQueryQueryQrCodeApiResponseDTOResult';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'retCode' => 'string',
'retMsg' => 'string',
'qrCodeInfo' => '\Yeepay\Yop\Sdk\Service\TelPay\Model\QrcodeQueryQrCodeApiInfoResult[]',
'requestId' => 'string',
'totalCount' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'retCode' => null,
'retMsg' => null,
'qrCodeInfo' => null,
'requestId' => null,
'totalCount' => 'int32'
];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'retCode' => 'retCode',
'retMsg' => 'retMsg',
'qrCodeInfo' => 'qrCodeInfo',
'requestId' => 'requestId',
'totalCount' => 'totalCount'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'retCode' => 'setRetCode',
'retMsg' => 'setRetMsg',
'qrCodeInfo' => 'setQrCodeInfo',
'requestId' => 'setRequestId',
'totalCount' => 'setTotalCount'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'retCode' => 'getRetCode',
'retMsg' => 'getRetMsg',
'qrCodeInfo' => 'getQrCodeInfo',
'requestId' => 'getRequestId',
'totalCount' => 'getTotalCount'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['retCode'] = isset($data['retCode']) ? $data['retCode'] : null;
$this->container['retMsg'] = isset($data['retMsg']) ? $data['retMsg'] : null;
$this->container['qrCodeInfo'] = isset($data['qrCodeInfo']) ? $data['qrCodeInfo'] : null;
$this->container['requestId'] = isset($data['requestId']) ? $data['requestId'] : null;
$this->container['totalCount'] = isset($data['totalCount']) ? $data['totalCount'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets retCode
*
* @return string
*/
public function getRetCode()
{
return $this->container['retCode'];
}
/**
* Sets retCode
*
* @param string $retCode 返回码
*
* @return $this
*/
public function setRetCode($retCode)
{
$this->container['retCode'] = $retCode;
return $this;
}
/**
* Gets retMsg
*
* @return string
*/
public function getRetMsg()
{
return $this->container['retMsg'];
}
/**
* Sets retMsg
*
* @param string $retMsg 返回信息
*
* @return $this
*/
public function setRetMsg($retMsg)
{
$this->container['retMsg'] = $retMsg;
return $this;
}
/**
* Gets qrCodeInfo
*
* @return \Yeepay\Yop\Sdk\Service\TelPay\Model\QrcodeQueryQrCodeApiInfoResult[]
*/
public function getQrCodeInfo()
{
return $this->container['qrCodeInfo'];
}
/**
* Sets qrCodeInfo
*
* @param \Yeepay\Yop\Sdk\Service\TelPay\Model\QrcodeQueryQrCodeApiInfoResult[] $qrCodeInfo 二维码信息
*
* @return $this
*/
public function setQrCodeInfo($qrCodeInfo)
{
$this->container['qrCodeInfo'] = $qrCodeInfo;
return $this;
}
/**
* Gets requestId
*
* @return string
*/
public function getRequestId()
{
return $this->container['requestId'];
}
/**
* Sets requestId
*
* @param string $requestId 请求号
*
* @return $this
*/
public function setRequestId($requestId)
{
$this->container['requestId'] = $requestId;
return $this;
}
/**
* Gets totalCount
*
* @return int
*/
public function getTotalCount()
{
return $this->container['totalCount'];
}
/**
* Sets totalCount
*
* @param int $totalCount 总条数
*
* @return $this
*/
public function setTotalCount($totalCount)
{
$this->container['totalCount'] = $totalCount;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View File

@@ -0,0 +1,242 @@
<?php
namespace Yeepay\Yop\Sdk\Service\TelPay\Model;
class QrcodeQueryRequest extends \Yeepay\Yop\Sdk\Model\BaseRequest
{
/**
* @var string
*/
private $parentMerchantNo;
/**
* @var string
*/
private $merchantNo;
/**
* @var string
*/
private $requestId;
/**
* @var int
*/
private $pageSize;
/**
* @var int
*/
private $pageNo;
/**
* @var string
*/
private $qrId;
/**
* @var string
*/
private $startTime;
/**
* @var string
*/
private $endTime;
/**
* @var string
*/
private $qrStatus;
/**
* Gets parentMerchantNo
*
* @return string
*/
public function getParentMerchantNo()
{
return $this->parentMerchantNo;
}
/**
* Sets parentMerchantNo
*
* @param string $parentMerchantNo
* @return QrcodeQueryRequest
*/
public function setParentMerchantNo($parentMerchantNo)
{
$this->parentMerchantNo = $parentMerchantNo;
return $this;
}
/**
* Gets merchantNo
*
* @return string
*/
public function getMerchantNo()
{
return $this->merchantNo;
}
/**
* Sets merchantNo
*
* @param string $merchantNo
* @return QrcodeQueryRequest
*/
public function setMerchantNo($merchantNo)
{
$this->merchantNo = $merchantNo;
return $this;
}
/**
* Gets requestId
*
* @return string
*/
public function getRequestId()
{
return $this->requestId;
}
/**
* Sets requestId
*
* @param string $requestId
* @return QrcodeQueryRequest
*/
public function setRequestId($requestId)
{
$this->requestId = $requestId;
return $this;
}
/**
* Gets pageSize
*
* @return int
*/
public function getPageSize()
{
return $this->pageSize;
}
/**
* Sets pageSize
*
* @param int $pageSize
* @return QrcodeQueryRequest
*/
public function setPageSize($pageSize)
{
$this->pageSize = $pageSize;
return $this;
}
/**
* Gets pageNo
*
* @return int
*/
public function getPageNo()
{
return $this->pageNo;
}
/**
* Sets pageNo
*
* @param int $pageNo
* @return QrcodeQueryRequest
*/
public function setPageNo($pageNo)
{
$this->pageNo = $pageNo;
return $this;
}
/**
* Gets qrId
*
* @return string
*/
public function getQrId()
{
return $this->qrId;
}
/**
* Sets qrId
*
* @param string $qrId
* @return QrcodeQueryRequest
*/
public function setQrId($qrId)
{
$this->qrId = $qrId;
return $this;
}
/**
* Gets startTime
*
* @return string
*/
public function getStartTime()
{
return $this->startTime;
}
/**
* Sets startTime
*
* @param string $startTime
* @return QrcodeQueryRequest
*/
public function setStartTime($startTime)
{
$this->startTime = $startTime;
return $this;
}
/**
* Gets endTime
*
* @return string
*/
public function getEndTime()
{
return $this->endTime;
}
/**
* Sets endTime
*
* @param string $endTime
* @return QrcodeQueryRequest
*/
public function setEndTime($endTime)
{
$this->endTime = $endTime;
return $this;
}
/**
* Gets qrStatus
*
* @return string
*/
public function getQrStatus()
{
return $this->qrStatus;
}
/**
* Sets qrStatus
*
* @param string $qrStatus
* @return QrcodeQueryRequest
*/
public function setQrStatus($qrStatus)
{
$this->qrStatus = $qrStatus;
return $this;
}
public static function getOperationId()
{
return 'qrcodeQuery';
}
}

View File

@@ -0,0 +1,104 @@
<?php
namespace Yeepay\Yop\Sdk\Service\TelPay\Model;
use Yeepay\Yop\Sdk\Http\Headers;
use Yeepay\Yop\Sdk\Internal\DefaultRequest;
use Yeepay\Yop\Sdk\Internal\Request;
use Yeepay\Yop\Sdk\Model\Transform\RequestMarshaller;
use Yeepay\Yop\Sdk\Utils\ObjectSerializer;
use Yeepay\Yop\Sdk\Utils\UUIDUtils;
class QrcodeQueryRequestMarshaller implements RequestMarshaller
{
/**
* @var QrcodeQueryRequestMarshaller
*/
private static $instance;
public static function __init()
{
self::$instance = new QrcodeQueryRequestMarshaller();
}
/**
* @return QrcodeQueryRequestMarshaller
*/
public static function getInstance()
{
return self::$instance;
}
/**
* @var string
*/
private $serviceName = 'TelPay';
/**
* @var string
*/
private $httpMethod = 'GET';
/**
* @var string
*/
private $resourcePath = '/rest/v1.0/tel-pay/qrcode/query';
/**
* @var string
*/
private $contentType = 'application/x-www-form-urlencoded';
/**
* @param QrcodeQueryRequest $request
* @return Request
*/
public function marshal($request)
{
$internalRequest = new DefaultRequest($this->serviceName);
$internalRequest->setResourcePath($this->resourcePath);
$internalRequest->setHttpMethod($this->httpMethod);
if (!empty($request->getRequestConfig()) && !empty($request->getRequestConfig()->getCustomRequestHeaders())) {
foreach ($request->getRequestConfig()->getCustomRequestHeaders() as $name => $value) {
$internalRequest->addHeader($name, $value);
}
}
if (!isset($internalRequest->getHeaders()[Headers::YOP_REQUEST_ID])) {
$internalRequest->addHeader(Headers::YOP_REQUEST_ID, UUIDUtils::uuid());
}
if($request->getParentMerchantNo() != null){
$internalRequest->addParameter('parentMerchantNo', ObjectSerializer::sanitizeForSerialization($request->getParentMerchantNo(), 'string'));
}
if($request->getMerchantNo() != null){
$internalRequest->addParameter('merchantNo', ObjectSerializer::sanitizeForSerialization($request->getMerchantNo(), 'string'));
}
if($request->getRequestId() != null){
$internalRequest->addParameter('requestId', ObjectSerializer::sanitizeForSerialization($request->getRequestId(), 'string'));
}
if($request->getPageSize() != null){
$internalRequest->addParameter('pageSize', ObjectSerializer::sanitizeForSerialization($request->getPageSize(), 'int', 'int32'));
}
if($request->getPageNo() != null){
$internalRequest->addParameter('pageNo', ObjectSerializer::sanitizeForSerialization($request->getPageNo(), 'int', 'int32'));
}
if($request->getQrId() != null){
$internalRequest->addParameter('qrId', ObjectSerializer::sanitizeForSerialization($request->getQrId(), 'string'));
}
if($request->getStartTime() != null){
$internalRequest->addParameter('startTime', ObjectSerializer::sanitizeForSerialization($request->getStartTime(), 'string'));
}
if($request->getEndTime() != null){
$internalRequest->addParameter('endTime', ObjectSerializer::sanitizeForSerialization($request->getEndTime(), 'string'));
}
if($request->getQrStatus() != null){
$internalRequest->addParameter('qrStatus', ObjectSerializer::sanitizeForSerialization($request->getQrStatus(), 'string'));
}
$internalRequest->addHeader(Headers::CONTENT_TYPE, $this->contentType);
return $internalRequest;
}
}
QrcodeQueryRequestMarshaller::__init();

View File

@@ -0,0 +1,34 @@
<?php
namespace Yeepay\Yop\Sdk\Service\TelPay\Model;
class QrcodeQueryResponse extends \Yeepay\Yop\Sdk\Model\BaseResponse
{
/**
* @var QrcodeQueryQueryQrCodeApiResponseDTOResult
*/
private $result;
function getResultClass()
{
return '\Yeepay\Yop\Sdk\Service\TelPay\Model\QrcodeQueryQueryQrCodeApiResponseDTOResult';
}
/**
* @param QrcodeQueryQueryQrCodeApiResponseDTOResult $result
*/
function setResult($result)
{
$this->result = $result;
}
/**
* @return QrcodeQueryQueryQrCodeApiResponseDTOResult
*/
function getResult()
{
return $this->result;
}
}

View File

@@ -0,0 +1,39 @@
<?php
namespace Yeepay\Yop\Sdk\Service\TelPay\Model;
use Yeepay\Yop\Sdk\Model\Transform\BaseResponseUnMarshaller;
class QrcodeQueryResponseUnMarshaller extends BaseResponseUnMarshaller
{
/**
* @var QrcodeQueryResponseUnMarshaller
*/
private static $instance;
public static function __init()
{
self::$instance = new QrcodeQueryResponseUnMarshaller();
}
/**
* @return QrcodeQueryResponseUnMarshaller
*/
public static function getInstance()
{
return self::$instance;
}
/**
* @return QrcodeQueryResponse
*/
protected function getResponseInstance()
{
return new QrcodeQueryResponse();
}
}
QrcodeQueryResponseUnMarshaller::__init();

View File

@@ -0,0 +1,72 @@
<?php
namespace Yeepay\Yop\Sdk\Service\TelPay;
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\Service\TelPay\Model as Model;
class TelPayClient
{
/**
* @var ClientHandler
*/
private $clientHandler;
/**
* TelPayClient constructor.
* @param ClientParams $clientParams
*/
function __construct(ClientParams $clientParams)
{
$this->clientHandler = new ClientHandler($clientParams);
}
/**
* @param Model\QrcodeBatchGenerateRequest $request
* @return Model\QrcodeBatchGenerateResponse
* @throws YopClientException
*/
public function qrcodeBatchGenerate(Model\QrcodeBatchGenerateRequest $request)
{
if ($request == null) {
throw new YopClientException("request is required.");
}
$clientExecutionParams = new ClientExecutionParams($request, Model\QrcodeBatchGenerateRequestMarshaller::getInstance(),
Model\QrcodeBatchGenerateResponseUnMarshaller::getInstance());
return $this->clientHandler->execute($clientExecutionParams);
}
/**
* @param Model\QrcodeQueryRequest $request
* @return Model\QrcodeQueryResponse
* @throws YopClientException
*/
public function qrcodeQuery(Model\QrcodeQueryRequest $request)
{
if ($request == null) {
throw new YopClientException("request is required.");
}
if ($request->getParentMerchantNo() == null) {
throw new YopClientException("request.parentMerchantNo is required.");
}
if ($request->getMerchantNo() == null) {
throw new YopClientException("request.merchantNo is required.");
}
if ($request->getRequestId() == null) {
throw new YopClientException("request.requestId is required.");
}
if ($request->getPageSize() == null) {
throw new YopClientException("request.pageSize is required.");
}
if ($request->getPageNo() == null) {
throw new YopClientException("request.pageNo is required.");
}
$clientExecutionParams = new ClientExecutionParams($request, Model\QrcodeQueryRequestMarshaller::getInstance(),
Model\QrcodeQueryResponseUnMarshaller::getInstance());
return $this->clientHandler->execute($clientExecutionParams);
}
}

View File

@@ -0,0 +1,69 @@
<?php
namespace Yeepay\Yop\Sdk\Service\TelPay;
use Yeepay\Yop\Sdk\Auth\AuthorityReqRegistryImpl;
use Yeepay\Yop\Sdk\Auth\AuthorizationReqRegistry;
use Yeepay\Yop\Sdk\Auth\AuthorizationReqSupport;
use Yeepay\Yop\Sdk\Client\ClientParams;
use Yeepay\Yop\Sdk\Client\Support\ClientParamsSupport;
use Yeepay\Yop\Sdk\Config\AppSdkConfig;
use Yeepay\Yop\Sdk\Config\AppSdkConfigProvider;
use Yeepay\Yop\Sdk\Config\DefaultAppSdkConfigProvider;
use Yeepay\Yop\Sdk\Exception\YopClientException;
class TelPayClientBuilder
{
/**
* @var AuthorizationReqRegistry
*/
private static $authorizationReqRegistry;
public static function __init()
{
self::$authorizationReqRegistry = new AuthorityReqRegistryImpl();
self::$authorizationReqRegistry->register('qrcodeBatchGenerate', AuthorizationReqSupport::getAuthorizationReq('YOP-RSA2048-SHA256'));
self::$authorizationReqRegistry->register('qrcodeQuery', AuthorizationReqSupport::getAuthorizationReq('YOP-RSA2048-SHA256'));
}
/**
* @var ClientParams
*/
private $clientParams;
/**
* TelPayClientBuilder constructor.
* @param ClientParams $clientParams
*/
public function __construct(ClientParams $clientParams)
{
$this->clientParams = $clientParams;
}
public function build()
{
return new TelPayClient($this->clientParams);
}
/**
* @param $config AppSdkConfig|array|AppSdkConfigProvider
* @return TelPayClientBuilder
* @throws YopClientException
*/
public static function builder($config)
{
$appSdkConfigProvider = null;
if ($config instanceof AppSdkConfigProvider) {
$appSdkConfigProvider = $config;
} else {
$appSdkConfigProvider = new DefaultAppSdkConfigProvider($config);
}
$clientParams = ClientParamsSupport::generateClientParams($appSdkConfigProvider);
$clientParams->setAuthorizationReqRegistry(self::$authorizationReqRegistry);
return new TelPayClientBuilder($clientParams);
}
}
TelPayClientBuilder::__init();