no message
This commit is contained in:
@@ -0,0 +1,293 @@
|
||||
<?php
|
||||
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
namespace Alipay\EasySDK\Payment\FaceToFace;
|
||||
|
||||
use Alipay\EasySDK\Kernel\EasySDKKernel;
|
||||
use AlibabaCloud\Tea\Tea;
|
||||
use AlibabaCloud\Tea\Request;
|
||||
use AlibabaCloud\Tea\Exception\TeaError;
|
||||
use \Exception;
|
||||
use AlibabaCloud\Tea\Exception\TeaUnableRetryError;
|
||||
|
||||
use Alipay\EasySDK\Payment\FaceToFace\Models\AlipayTradePayResponse;
|
||||
use AlibabaCloud\Tea\Response;
|
||||
use Alipay\EasySDK\Payment\FaceToFace\Models\AlipayTradePrecreateResponse;
|
||||
|
||||
class Client {
|
||||
protected $_kernel;
|
||||
|
||||
public function __construct($kernel){
|
||||
$this->_kernel = $kernel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $subject
|
||||
* @param string $outTradeNo
|
||||
* @param string $totalAmount
|
||||
* @param string $authCode
|
||||
* @return AlipayTradePayResponse
|
||||
* @throws TeaError
|
||||
* @throws Exception
|
||||
* @throws TeaUnableRetryError
|
||||
*/
|
||||
public function pay($subject, $outTradeNo, $totalAmount, $authCode){
|
||||
$_runtime = [
|
||||
"ignoreSSL" => $this->_kernel->getConfig("ignoreSSL"),
|
||||
"httpProxy" => $this->_kernel->getConfig("httpProxy"),
|
||||
"connectTimeout" => 15000,
|
||||
"readTimeout" => 15000,
|
||||
"retry" => [
|
||||
"maxAttempts" => 0
|
||||
]
|
||||
];
|
||||
$_lastRequest = null;
|
||||
$_lastException = null;
|
||||
$_now = time();
|
||||
$_retryTimes = 0;
|
||||
while (Tea::allowRetry(@$_runtime["retry"], $_retryTimes, $_now)) {
|
||||
if ($_retryTimes > 0) {
|
||||
$_backoffTime = Tea::getBackoffTime(@$_runtime["backoff"], $_retryTimes);
|
||||
if ($_backoffTime > 0) {
|
||||
Tea::sleep($_backoffTime);
|
||||
}
|
||||
}
|
||||
$_retryTimes = $_retryTimes + 1;
|
||||
try {
|
||||
$_request = new Request();
|
||||
$systemParams = [
|
||||
"method" => "alipay.trade.pay",
|
||||
"app_id" => $this->_kernel->getConfig("appId"),
|
||||
"timestamp" => $this->_kernel->getTimestamp(),
|
||||
"format" => "json",
|
||||
"version" => "1.0",
|
||||
"alipay_sdk" => $this->_kernel->getSdkVersion(),
|
||||
"charset" => "UTF-8",
|
||||
"sign_type" => $this->_kernel->getConfig("signType"),
|
||||
"app_cert_sn" => $this->_kernel->getMerchantCertSN(),
|
||||
"alipay_root_cert_sn" => $this->_kernel->getAlipayRootCertSN()
|
||||
];
|
||||
$bizParams = [
|
||||
"subject" => $subject,
|
||||
"out_trade_no" => $outTradeNo,
|
||||
"total_amount" => $totalAmount,
|
||||
"auth_code" => $authCode,
|
||||
"scene" => "bar_code"
|
||||
];
|
||||
$textParams = [];
|
||||
$_request->protocol = $this->_kernel->getConfig("protocol");
|
||||
$_request->method = "POST";
|
||||
$_request->pathname = "/gateway.do";
|
||||
$_request->headers = [
|
||||
"host" => $this->_kernel->getConfig("gatewayHost"),
|
||||
"content-type" => "application/x-www-form-urlencoded;charset=utf-8"
|
||||
];
|
||||
$_request->query = $this->_kernel->sortMap(Tea::merge([
|
||||
"sign" => $this->_kernel->sign($systemParams, $bizParams, $textParams, $this->_kernel->getConfig("merchantPrivateKey"))
|
||||
], $systemParams, $textParams));
|
||||
$_request->body = $this->_kernel->toUrlEncodedRequestBody($bizParams);
|
||||
$_lastRequest = $_request;
|
||||
$_response= Tea::send($_request, $_runtime);
|
||||
$respMap = $this->_kernel->readAsJson($_response, "alipay.trade.pay");
|
||||
if ($this->_kernel->isCertMode()) {
|
||||
if ($this->_kernel->verify($respMap, $this->_kernel->extractAlipayPublicKey($this->_kernel->getAlipayCertSN($respMap)))) {
|
||||
return AlipayTradePayResponse::fromMap($this->_kernel->toRespModel($respMap));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($this->_kernel->verify($respMap, $this->_kernel->getConfig("alipayPublicKey"))) {
|
||||
return AlipayTradePayResponse::fromMap($this->_kernel->toRespModel($respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaError([
|
||||
"message" => "验签失败,请检查支付宝公钥设置是否正确。"
|
||||
]);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
if (!($e instanceof TeaError)) {
|
||||
$e = new TeaError([], $e->getMessage(), $e->getCode(), $e);
|
||||
}
|
||||
if (Tea::isRetryable($e)) {
|
||||
$_lastException = $e;
|
||||
continue;
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
throw new TeaUnableRetryError($_lastRequest, $_lastException);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $subject
|
||||
* @param string $outTradeNo
|
||||
* @param string $totalAmount
|
||||
* @return AlipayTradePrecreateResponse
|
||||
* @throws TeaError
|
||||
* @throws Exception
|
||||
* @throws TeaUnableRetryError
|
||||
*/
|
||||
public function preCreate($subject, $outTradeNo, $totalAmount){
|
||||
$_runtime = [
|
||||
"ignoreSSL" => $this->_kernel->getConfig("ignoreSSL"),
|
||||
"httpProxy" => $this->_kernel->getConfig("httpProxy"),
|
||||
"connectTimeout" => 15000,
|
||||
"readTimeout" => 15000,
|
||||
"retry" => [
|
||||
"maxAttempts" => 0
|
||||
]
|
||||
];
|
||||
$_lastRequest = null;
|
||||
$_lastException = null;
|
||||
$_now = time();
|
||||
$_retryTimes = 0;
|
||||
while (Tea::allowRetry(@$_runtime["retry"], $_retryTimes, $_now)) {
|
||||
if ($_retryTimes > 0) {
|
||||
$_backoffTime = Tea::getBackoffTime(@$_runtime["backoff"], $_retryTimes);
|
||||
if ($_backoffTime > 0) {
|
||||
Tea::sleep($_backoffTime);
|
||||
}
|
||||
}
|
||||
$_retryTimes = $_retryTimes + 1;
|
||||
try {
|
||||
$_request = new Request();
|
||||
$systemParams = [
|
||||
"method" => "alipay.trade.precreate",
|
||||
"app_id" => $this->_kernel->getConfig("appId"),
|
||||
"timestamp" => $this->_kernel->getTimestamp(),
|
||||
"format" => "json",
|
||||
"version" => "1.0",
|
||||
"alipay_sdk" => $this->_kernel->getSdkVersion(),
|
||||
"charset" => "UTF-8",
|
||||
"sign_type" => $this->_kernel->getConfig("signType"),
|
||||
"app_cert_sn" => $this->_kernel->getMerchantCertSN(),
|
||||
"alipay_root_cert_sn" => $this->_kernel->getAlipayRootCertSN()
|
||||
];
|
||||
$bizParams = [
|
||||
"subject" => $subject,
|
||||
"out_trade_no" => $outTradeNo,
|
||||
"total_amount" => $totalAmount
|
||||
];
|
||||
$textParams = [];
|
||||
$_request->protocol = $this->_kernel->getConfig("protocol");
|
||||
$_request->method = "POST";
|
||||
$_request->pathname = "/gateway.do";
|
||||
$_request->headers = [
|
||||
"host" => $this->_kernel->getConfig("gatewayHost"),
|
||||
"content-type" => "application/x-www-form-urlencoded;charset=utf-8"
|
||||
];
|
||||
$_request->query = $this->_kernel->sortMap(Tea::merge([
|
||||
"sign" => $this->_kernel->sign($systemParams, $bizParams, $textParams, $this->_kernel->getConfig("merchantPrivateKey"))
|
||||
], $systemParams, $textParams));
|
||||
$_request->body = $this->_kernel->toUrlEncodedRequestBody($bizParams);
|
||||
$_lastRequest = $_request;
|
||||
$_response= Tea::send($_request, $_runtime);
|
||||
$respMap = $this->_kernel->readAsJson($_response, "alipay.trade.precreate");
|
||||
if ($this->_kernel->isCertMode()) {
|
||||
if ($this->_kernel->verify($respMap, $this->_kernel->extractAlipayPublicKey($this->_kernel->getAlipayCertSN($respMap)))) {
|
||||
return AlipayTradePrecreateResponse::fromMap($this->_kernel->toRespModel($respMap));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($this->_kernel->verify($respMap, $this->_kernel->getConfig("alipayPublicKey"))) {
|
||||
return AlipayTradePrecreateResponse::fromMap($this->_kernel->toRespModel($respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaError([
|
||||
"message" => "验签失败,请检查支付宝公钥设置是否正确。"
|
||||
]);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
if (!($e instanceof TeaError)) {
|
||||
$e = new TeaError([], $e->getMessage(), $e->getCode(), $e);
|
||||
}
|
||||
if (Tea::isRetryable($e)) {
|
||||
$_lastException = $e;
|
||||
continue;
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
throw new TeaUnableRetryError($_lastRequest, $_lastException);
|
||||
}
|
||||
|
||||
/**
|
||||
* ISV代商户代用,指定appAuthToken
|
||||
*
|
||||
* @param $appAuthToken String 代调用token
|
||||
* @return $this 本客户端,便于链式调用
|
||||
*/
|
||||
public function agent($appAuthToken)
|
||||
{
|
||||
$this->_kernel->injectTextParam("app_auth_token", $appAuthToken);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户授权调用,指定authToken
|
||||
*
|
||||
* @param $authToken String 用户授权token
|
||||
* @return $this
|
||||
*/
|
||||
public function auth($authToken)
|
||||
{
|
||||
$this->_kernel->injectTextParam("auth_token", $authToken);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
*
|
||||
* @param $url String 异步通知回调地址,例如:https://www.test.com/callback
|
||||
* @return $this
|
||||
*/
|
||||
public function asyncNotify($url)
|
||||
{
|
||||
$this->_kernel->injectTextParam("notify_url", $url);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
*
|
||||
* @param $testUrl String 后端系统测试地址
|
||||
* @return $this
|
||||
*/
|
||||
public function route($testUrl)
|
||||
{
|
||||
$this->_kernel->injectTextParam("ws_service_url", $testUrl);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
*
|
||||
* @param $key String 业务请求参数名称(biz_content下的字段名,比如timeout_express)
|
||||
* @param $value object 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
* 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用String储存
|
||||
* 如果该字段是一个数值型类型(比如:Number),请使用Long储存
|
||||
* 如果该字段是一个复杂类型,请使用嵌套的array指定各下级字段的值
|
||||
* 如果该字段是一个数组,请使用array储存各个值
|
||||
* @return $this
|
||||
*/
|
||||
public function optional($key, $value)
|
||||
{
|
||||
$this->_kernel->injectBizParam($key, $value);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
* optional方法的批量版本
|
||||
*
|
||||
* @param $optionalArgs array 可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释
|
||||
* @return $this
|
||||
*/
|
||||
public function batchOptional($optionalArgs)
|
||||
{
|
||||
foreach ($optionalArgs as $key => $value) {
|
||||
$this->_kernel->injectBizParam($key, $value);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+534
@@ -0,0 +1,534 @@
|
||||
<?php
|
||||
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
namespace Alipay\EasySDK\Payment\FaceToFace\Models;
|
||||
|
||||
use AlibabaCloud\Tea\Model;
|
||||
|
||||
use Alipay\EasySDK\Payment\FaceToFace\Models\TradeFundBill;
|
||||
use Alipay\EasySDK\Payment\FaceToFace\Models\VoucherDetail;
|
||||
|
||||
class AlipayTradePayResponse extends Model {
|
||||
protected $_name = [
|
||||
'httpBody' => 'http_body',
|
||||
'code' => 'code',
|
||||
'msg' => 'msg',
|
||||
'subCode' => 'sub_code',
|
||||
'subMsg' => 'sub_msg',
|
||||
'tradeNo' => 'trade_no',
|
||||
'outTradeNo' => 'out_trade_no',
|
||||
'buyerLogonId' => 'buyer_logon_id',
|
||||
'settleAmount' => 'settle_amount',
|
||||
'payCurrency' => 'pay_currency',
|
||||
'payAmount' => 'pay_amount',
|
||||
'settleTransRate' => 'settle_trans_rate',
|
||||
'transPayRate' => 'trans_pay_rate',
|
||||
'totalAmount' => 'total_amount',
|
||||
'transCurrency' => 'trans_currency',
|
||||
'settleCurrency' => 'settle_currency',
|
||||
'receiptAmount' => 'receipt_amount',
|
||||
'buyerPayAmount' => 'buyer_pay_amount',
|
||||
'pointAmount' => 'point_amount',
|
||||
'invoiceAmount' => 'invoice_amount',
|
||||
'gmtPayment' => 'gmt_payment',
|
||||
'fundBillList' => 'fund_bill_list',
|
||||
'cardBalance' => 'card_balance',
|
||||
'storeName' => 'store_name',
|
||||
'buyerUserId' => 'buyer_user_id',
|
||||
'discountGoodsDetail' => 'discount_goods_detail',
|
||||
'voucherDetailList' => 'voucher_detail_list',
|
||||
'advanceAmount' => 'advance_amount',
|
||||
'authTradePayMode' => 'auth_trade_pay_mode',
|
||||
'chargeAmount' => 'charge_amount',
|
||||
'chargeFlags' => 'charge_flags',
|
||||
'settlementId' => 'settlement_id',
|
||||
'businessParams' => 'business_params',
|
||||
'buyerUserType' => 'buyer_user_type',
|
||||
'mdiscountAmount' => 'mdiscount_amount',
|
||||
'discountAmount' => 'discount_amount',
|
||||
'buyerUserName' => 'buyer_user_name',
|
||||
];
|
||||
public function validate() {
|
||||
Model::validateRequired('httpBody', $this->httpBody, true);
|
||||
Model::validateRequired('code', $this->code, true);
|
||||
Model::validateRequired('msg', $this->msg, true);
|
||||
Model::validateRequired('subCode', $this->subCode, true);
|
||||
Model::validateRequired('subMsg', $this->subMsg, true);
|
||||
Model::validateRequired('tradeNo', $this->tradeNo, true);
|
||||
Model::validateRequired('outTradeNo', $this->outTradeNo, true);
|
||||
Model::validateRequired('buyerLogonId', $this->buyerLogonId, true);
|
||||
Model::validateRequired('settleAmount', $this->settleAmount, true);
|
||||
Model::validateRequired('payCurrency', $this->payCurrency, true);
|
||||
Model::validateRequired('payAmount', $this->payAmount, true);
|
||||
Model::validateRequired('settleTransRate', $this->settleTransRate, true);
|
||||
Model::validateRequired('transPayRate', $this->transPayRate, true);
|
||||
Model::validateRequired('totalAmount', $this->totalAmount, true);
|
||||
Model::validateRequired('transCurrency', $this->transCurrency, true);
|
||||
Model::validateRequired('settleCurrency', $this->settleCurrency, true);
|
||||
Model::validateRequired('receiptAmount', $this->receiptAmount, true);
|
||||
Model::validateRequired('buyerPayAmount', $this->buyerPayAmount, true);
|
||||
Model::validateRequired('pointAmount', $this->pointAmount, true);
|
||||
Model::validateRequired('invoiceAmount', $this->invoiceAmount, true);
|
||||
Model::validateRequired('gmtPayment', $this->gmtPayment, true);
|
||||
Model::validateRequired('fundBillList', $this->fundBillList, true);
|
||||
Model::validateRequired('cardBalance', $this->cardBalance, true);
|
||||
Model::validateRequired('storeName', $this->storeName, true);
|
||||
Model::validateRequired('buyerUserId', $this->buyerUserId, true);
|
||||
Model::validateRequired('discountGoodsDetail', $this->discountGoodsDetail, true);
|
||||
Model::validateRequired('voucherDetailList', $this->voucherDetailList, true);
|
||||
Model::validateRequired('advanceAmount', $this->advanceAmount, true);
|
||||
Model::validateRequired('authTradePayMode', $this->authTradePayMode, true);
|
||||
Model::validateRequired('chargeAmount', $this->chargeAmount, true);
|
||||
Model::validateRequired('chargeFlags', $this->chargeFlags, true);
|
||||
Model::validateRequired('settlementId', $this->settlementId, true);
|
||||
Model::validateRequired('businessParams', $this->businessParams, true);
|
||||
Model::validateRequired('buyerUserType', $this->buyerUserType, true);
|
||||
Model::validateRequired('mdiscountAmount', $this->mdiscountAmount, true);
|
||||
Model::validateRequired('discountAmount', $this->discountAmount, true);
|
||||
Model::validateRequired('buyerUserName', $this->buyerUserName, true);
|
||||
}
|
||||
public function toMap() {
|
||||
$res = [];
|
||||
if (null !== $this->httpBody) {
|
||||
$res['http_body'] = $this->httpBody;
|
||||
}
|
||||
if (null !== $this->code) {
|
||||
$res['code'] = $this->code;
|
||||
}
|
||||
if (null !== $this->msg) {
|
||||
$res['msg'] = $this->msg;
|
||||
}
|
||||
if (null !== $this->subCode) {
|
||||
$res['sub_code'] = $this->subCode;
|
||||
}
|
||||
if (null !== $this->subMsg) {
|
||||
$res['sub_msg'] = $this->subMsg;
|
||||
}
|
||||
if (null !== $this->tradeNo) {
|
||||
$res['trade_no'] = $this->tradeNo;
|
||||
}
|
||||
if (null !== $this->outTradeNo) {
|
||||
$res['out_trade_no'] = $this->outTradeNo;
|
||||
}
|
||||
if (null !== $this->buyerLogonId) {
|
||||
$res['buyer_logon_id'] = $this->buyerLogonId;
|
||||
}
|
||||
if (null !== $this->settleAmount) {
|
||||
$res['settle_amount'] = $this->settleAmount;
|
||||
}
|
||||
if (null !== $this->payCurrency) {
|
||||
$res['pay_currency'] = $this->payCurrency;
|
||||
}
|
||||
if (null !== $this->payAmount) {
|
||||
$res['pay_amount'] = $this->payAmount;
|
||||
}
|
||||
if (null !== $this->settleTransRate) {
|
||||
$res['settle_trans_rate'] = $this->settleTransRate;
|
||||
}
|
||||
if (null !== $this->transPayRate) {
|
||||
$res['trans_pay_rate'] = $this->transPayRate;
|
||||
}
|
||||
if (null !== $this->totalAmount) {
|
||||
$res['total_amount'] = $this->totalAmount;
|
||||
}
|
||||
if (null !== $this->transCurrency) {
|
||||
$res['trans_currency'] = $this->transCurrency;
|
||||
}
|
||||
if (null !== $this->settleCurrency) {
|
||||
$res['settle_currency'] = $this->settleCurrency;
|
||||
}
|
||||
if (null !== $this->receiptAmount) {
|
||||
$res['receipt_amount'] = $this->receiptAmount;
|
||||
}
|
||||
if (null !== $this->buyerPayAmount) {
|
||||
$res['buyer_pay_amount'] = $this->buyerPayAmount;
|
||||
}
|
||||
if (null !== $this->pointAmount) {
|
||||
$res['point_amount'] = $this->pointAmount;
|
||||
}
|
||||
if (null !== $this->invoiceAmount) {
|
||||
$res['invoice_amount'] = $this->invoiceAmount;
|
||||
}
|
||||
if (null !== $this->gmtPayment) {
|
||||
$res['gmt_payment'] = $this->gmtPayment;
|
||||
}
|
||||
if (null !== $this->fundBillList) {
|
||||
$res['fund_bill_list'] = [];
|
||||
if(null !== $this->fundBillList && is_array($this->fundBillList)){
|
||||
$n = 0;
|
||||
foreach($this->fundBillList as $item){
|
||||
$res['fund_bill_list'][$n++] = null !== $item ? $item->toMap() : $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (null !== $this->cardBalance) {
|
||||
$res['card_balance'] = $this->cardBalance;
|
||||
}
|
||||
if (null !== $this->storeName) {
|
||||
$res['store_name'] = $this->storeName;
|
||||
}
|
||||
if (null !== $this->buyerUserId) {
|
||||
$res['buyer_user_id'] = $this->buyerUserId;
|
||||
}
|
||||
if (null !== $this->discountGoodsDetail) {
|
||||
$res['discount_goods_detail'] = $this->discountGoodsDetail;
|
||||
}
|
||||
if (null !== $this->voucherDetailList) {
|
||||
$res['voucher_detail_list'] = [];
|
||||
if(null !== $this->voucherDetailList && is_array($this->voucherDetailList)){
|
||||
$n = 0;
|
||||
foreach($this->voucherDetailList as $item){
|
||||
$res['voucher_detail_list'][$n++] = null !== $item ? $item->toMap() : $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (null !== $this->advanceAmount) {
|
||||
$res['advance_amount'] = $this->advanceAmount;
|
||||
}
|
||||
if (null !== $this->authTradePayMode) {
|
||||
$res['auth_trade_pay_mode'] = $this->authTradePayMode;
|
||||
}
|
||||
if (null !== $this->chargeAmount) {
|
||||
$res['charge_amount'] = $this->chargeAmount;
|
||||
}
|
||||
if (null !== $this->chargeFlags) {
|
||||
$res['charge_flags'] = $this->chargeFlags;
|
||||
}
|
||||
if (null !== $this->settlementId) {
|
||||
$res['settlement_id'] = $this->settlementId;
|
||||
}
|
||||
if (null !== $this->businessParams) {
|
||||
$res['business_params'] = $this->businessParams;
|
||||
}
|
||||
if (null !== $this->buyerUserType) {
|
||||
$res['buyer_user_type'] = $this->buyerUserType;
|
||||
}
|
||||
if (null !== $this->mdiscountAmount) {
|
||||
$res['mdiscount_amount'] = $this->mdiscountAmount;
|
||||
}
|
||||
if (null !== $this->discountAmount) {
|
||||
$res['discount_amount'] = $this->discountAmount;
|
||||
}
|
||||
if (null !== $this->buyerUserName) {
|
||||
$res['buyer_user_name'] = $this->buyerUserName;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* @param array $map
|
||||
* @return AlipayTradePayResponse
|
||||
*/
|
||||
public static function fromMap($map = []) {
|
||||
$model = new self();
|
||||
if(isset($map['http_body'])){
|
||||
$model->httpBody = $map['http_body'];
|
||||
}
|
||||
if(isset($map['code'])){
|
||||
$model->code = $map['code'];
|
||||
}
|
||||
if(isset($map['msg'])){
|
||||
$model->msg = $map['msg'];
|
||||
}
|
||||
if(isset($map['sub_code'])){
|
||||
$model->subCode = $map['sub_code'];
|
||||
}
|
||||
if(isset($map['sub_msg'])){
|
||||
$model->subMsg = $map['sub_msg'];
|
||||
}
|
||||
if(isset($map['trade_no'])){
|
||||
$model->tradeNo = $map['trade_no'];
|
||||
}
|
||||
if(isset($map['out_trade_no'])){
|
||||
$model->outTradeNo = $map['out_trade_no'];
|
||||
}
|
||||
if(isset($map['buyer_logon_id'])){
|
||||
$model->buyerLogonId = $map['buyer_logon_id'];
|
||||
}
|
||||
if(isset($map['settle_amount'])){
|
||||
$model->settleAmount = $map['settle_amount'];
|
||||
}
|
||||
if(isset($map['pay_currency'])){
|
||||
$model->payCurrency = $map['pay_currency'];
|
||||
}
|
||||
if(isset($map['pay_amount'])){
|
||||
$model->payAmount = $map['pay_amount'];
|
||||
}
|
||||
if(isset($map['settle_trans_rate'])){
|
||||
$model->settleTransRate = $map['settle_trans_rate'];
|
||||
}
|
||||
if(isset($map['trans_pay_rate'])){
|
||||
$model->transPayRate = $map['trans_pay_rate'];
|
||||
}
|
||||
if(isset($map['total_amount'])){
|
||||
$model->totalAmount = $map['total_amount'];
|
||||
}
|
||||
if(isset($map['trans_currency'])){
|
||||
$model->transCurrency = $map['trans_currency'];
|
||||
}
|
||||
if(isset($map['settle_currency'])){
|
||||
$model->settleCurrency = $map['settle_currency'];
|
||||
}
|
||||
if(isset($map['receipt_amount'])){
|
||||
$model->receiptAmount = $map['receipt_amount'];
|
||||
}
|
||||
if(isset($map['buyer_pay_amount'])){
|
||||
$model->buyerPayAmount = $map['buyer_pay_amount'];
|
||||
}
|
||||
if(isset($map['point_amount'])){
|
||||
$model->pointAmount = $map['point_amount'];
|
||||
}
|
||||
if(isset($map['invoice_amount'])){
|
||||
$model->invoiceAmount = $map['invoice_amount'];
|
||||
}
|
||||
if(isset($map['gmt_payment'])){
|
||||
$model->gmtPayment = $map['gmt_payment'];
|
||||
}
|
||||
if(isset($map['fund_bill_list'])){
|
||||
if(!empty($map['fund_bill_list'])){
|
||||
$model->fundBillList = [];
|
||||
$n = 0;
|
||||
foreach($map['fund_bill_list'] as $item) {
|
||||
$model->fundBillList[$n++] = null !== $item ? TradeFundBill::fromMap($item) : $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($map['card_balance'])){
|
||||
$model->cardBalance = $map['card_balance'];
|
||||
}
|
||||
if(isset($map['store_name'])){
|
||||
$model->storeName = $map['store_name'];
|
||||
}
|
||||
if(isset($map['buyer_user_id'])){
|
||||
$model->buyerUserId = $map['buyer_user_id'];
|
||||
}
|
||||
if(isset($map['discount_goods_detail'])){
|
||||
$model->discountGoodsDetail = $map['discount_goods_detail'];
|
||||
}
|
||||
if(isset($map['voucher_detail_list'])){
|
||||
if(!empty($map['voucher_detail_list'])){
|
||||
$model->voucherDetailList = [];
|
||||
$n = 0;
|
||||
foreach($map['voucher_detail_list'] as $item) {
|
||||
$model->voucherDetailList[$n++] = null !== $item ? VoucherDetail::fromMap($item) : $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($map['advance_amount'])){
|
||||
$model->advanceAmount = $map['advance_amount'];
|
||||
}
|
||||
if(isset($map['auth_trade_pay_mode'])){
|
||||
$model->authTradePayMode = $map['auth_trade_pay_mode'];
|
||||
}
|
||||
if(isset($map['charge_amount'])){
|
||||
$model->chargeAmount = $map['charge_amount'];
|
||||
}
|
||||
if(isset($map['charge_flags'])){
|
||||
$model->chargeFlags = $map['charge_flags'];
|
||||
}
|
||||
if(isset($map['settlement_id'])){
|
||||
$model->settlementId = $map['settlement_id'];
|
||||
}
|
||||
if(isset($map['business_params'])){
|
||||
$model->businessParams = $map['business_params'];
|
||||
}
|
||||
if(isset($map['buyer_user_type'])){
|
||||
$model->buyerUserType = $map['buyer_user_type'];
|
||||
}
|
||||
if(isset($map['mdiscount_amount'])){
|
||||
$model->mdiscountAmount = $map['mdiscount_amount'];
|
||||
}
|
||||
if(isset($map['discount_amount'])){
|
||||
$model->discountAmount = $map['discount_amount'];
|
||||
}
|
||||
if(isset($map['buyer_user_name'])){
|
||||
$model->buyerUserName = $map['buyer_user_name'];
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
/**
|
||||
* @description 响应原始字符串
|
||||
* @var string
|
||||
*/
|
||||
public $httpBody;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $code;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $msg;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $subCode;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $subMsg;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $tradeNo;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $outTradeNo;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $buyerLogonId;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $settleAmount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $payCurrency;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $payAmount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $settleTransRate;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $transPayRate;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $totalAmount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $transCurrency;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $settleCurrency;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $receiptAmount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $buyerPayAmount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $pointAmount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $invoiceAmount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $gmtPayment;
|
||||
|
||||
/**
|
||||
* @var TradeFundBill[]
|
||||
*/
|
||||
public $fundBillList;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $cardBalance;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $storeName;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $buyerUserId;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $discountGoodsDetail;
|
||||
|
||||
/**
|
||||
* @var VoucherDetail[]
|
||||
*/
|
||||
public $voucherDetailList;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $advanceAmount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $authTradePayMode;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $chargeAmount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $chargeFlags;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $settlementId;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $businessParams;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $buyerUserType;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $mdiscountAmount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $discountAmount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $buyerUserName;
|
||||
|
||||
}
|
||||
Vendored
+117
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
namespace Alipay\EasySDK\Payment\FaceToFace\Models;
|
||||
|
||||
use AlibabaCloud\Tea\Model;
|
||||
|
||||
class AlipayTradePrecreateResponse extends Model {
|
||||
protected $_name = [
|
||||
'httpBody' => 'http_body',
|
||||
'code' => 'code',
|
||||
'msg' => 'msg',
|
||||
'subCode' => 'sub_code',
|
||||
'subMsg' => 'sub_msg',
|
||||
'outTradeNo' => 'out_trade_no',
|
||||
'qrCode' => 'qr_code',
|
||||
];
|
||||
public function validate() {
|
||||
Model::validateRequired('httpBody', $this->httpBody, true);
|
||||
Model::validateRequired('code', $this->code, true);
|
||||
Model::validateRequired('msg', $this->msg, true);
|
||||
Model::validateRequired('subCode', $this->subCode, true);
|
||||
Model::validateRequired('subMsg', $this->subMsg, true);
|
||||
Model::validateRequired('outTradeNo', $this->outTradeNo, true);
|
||||
Model::validateRequired('qrCode', $this->qrCode, true);
|
||||
}
|
||||
public function toMap() {
|
||||
$res = [];
|
||||
if (null !== $this->httpBody) {
|
||||
$res['http_body'] = $this->httpBody;
|
||||
}
|
||||
if (null !== $this->code) {
|
||||
$res['code'] = $this->code;
|
||||
}
|
||||
if (null !== $this->msg) {
|
||||
$res['msg'] = $this->msg;
|
||||
}
|
||||
if (null !== $this->subCode) {
|
||||
$res['sub_code'] = $this->subCode;
|
||||
}
|
||||
if (null !== $this->subMsg) {
|
||||
$res['sub_msg'] = $this->subMsg;
|
||||
}
|
||||
if (null !== $this->outTradeNo) {
|
||||
$res['out_trade_no'] = $this->outTradeNo;
|
||||
}
|
||||
if (null !== $this->qrCode) {
|
||||
$res['qr_code'] = $this->qrCode;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* @param array $map
|
||||
* @return AlipayTradePrecreateResponse
|
||||
*/
|
||||
public static function fromMap($map = []) {
|
||||
$model = new self();
|
||||
if(isset($map['http_body'])){
|
||||
$model->httpBody = $map['http_body'];
|
||||
}
|
||||
if(isset($map['code'])){
|
||||
$model->code = $map['code'];
|
||||
}
|
||||
if(isset($map['msg'])){
|
||||
$model->msg = $map['msg'];
|
||||
}
|
||||
if(isset($map['sub_code'])){
|
||||
$model->subCode = $map['sub_code'];
|
||||
}
|
||||
if(isset($map['sub_msg'])){
|
||||
$model->subMsg = $map['sub_msg'];
|
||||
}
|
||||
if(isset($map['out_trade_no'])){
|
||||
$model->outTradeNo = $map['out_trade_no'];
|
||||
}
|
||||
if(isset($map['qr_code'])){
|
||||
$model->qrCode = $map['qr_code'];
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
/**
|
||||
* @description 响应原始字符串
|
||||
* @var string
|
||||
*/
|
||||
public $httpBody;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $code;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $msg;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $subCode;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $subMsg;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $outTradeNo;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $qrCode;
|
||||
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
namespace Alipay\EasySDK\Payment\FaceToFace\Models;
|
||||
|
||||
use AlibabaCloud\Tea\Model;
|
||||
|
||||
class TradeFundBill extends Model {
|
||||
protected $_name = [
|
||||
'fundChannel' => 'fund_channel',
|
||||
'bankCode' => 'bank_code',
|
||||
'amount' => 'amount',
|
||||
'realAmount' => 'real_amount',
|
||||
];
|
||||
public function validate() {
|
||||
Model::validateRequired('fundChannel', $this->fundChannel, true);
|
||||
Model::validateRequired('bankCode', $this->bankCode, true);
|
||||
Model::validateRequired('amount', $this->amount, true);
|
||||
Model::validateRequired('realAmount', $this->realAmount, true);
|
||||
}
|
||||
public function toMap() {
|
||||
$res = [];
|
||||
if (null !== $this->fundChannel) {
|
||||
$res['fund_channel'] = $this->fundChannel;
|
||||
}
|
||||
if (null !== $this->bankCode) {
|
||||
$res['bank_code'] = $this->bankCode;
|
||||
}
|
||||
if (null !== $this->amount) {
|
||||
$res['amount'] = $this->amount;
|
||||
}
|
||||
if (null !== $this->realAmount) {
|
||||
$res['real_amount'] = $this->realAmount;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* @param array $map
|
||||
* @return TradeFundBill
|
||||
*/
|
||||
public static function fromMap($map = []) {
|
||||
$model = new self();
|
||||
if(isset($map['fund_channel'])){
|
||||
$model->fundChannel = $map['fund_channel'];
|
||||
}
|
||||
if(isset($map['bank_code'])){
|
||||
$model->bankCode = $map['bank_code'];
|
||||
}
|
||||
if(isset($map['amount'])){
|
||||
$model->amount = $map['amount'];
|
||||
}
|
||||
if(isset($map['real_amount'])){
|
||||
$model->realAmount = $map['real_amount'];
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $fundChannel;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $bankCode;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $amount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $realAmount;
|
||||
|
||||
}
|
||||
+168
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
namespace Alipay\EasySDK\Payment\FaceToFace\Models;
|
||||
|
||||
use AlibabaCloud\Tea\Model;
|
||||
|
||||
class VoucherDetail extends Model {
|
||||
protected $_name = [
|
||||
'id' => 'id',
|
||||
'name' => 'name',
|
||||
'type' => 'type',
|
||||
'amount' => 'amount',
|
||||
'merchantContribute' => 'merchant_contribute',
|
||||
'otherContribute' => 'other_contribute',
|
||||
'memo' => 'memo',
|
||||
'templateId' => 'template_id',
|
||||
'purchaseBuyerContribute' => 'purchase_buyer_contribute',
|
||||
'purchaseMerchantContribute' => 'purchase_merchant_contribute',
|
||||
'purchaseAntContribute' => 'purchase_ant_contribute',
|
||||
];
|
||||
public function validate() {
|
||||
Model::validateRequired('id', $this->id, true);
|
||||
Model::validateRequired('name', $this->name, true);
|
||||
Model::validateRequired('type', $this->type, true);
|
||||
Model::validateRequired('amount', $this->amount, true);
|
||||
Model::validateRequired('merchantContribute', $this->merchantContribute, true);
|
||||
Model::validateRequired('otherContribute', $this->otherContribute, true);
|
||||
Model::validateRequired('memo', $this->memo, true);
|
||||
Model::validateRequired('templateId', $this->templateId, true);
|
||||
Model::validateRequired('purchaseBuyerContribute', $this->purchaseBuyerContribute, true);
|
||||
Model::validateRequired('purchaseMerchantContribute', $this->purchaseMerchantContribute, true);
|
||||
Model::validateRequired('purchaseAntContribute', $this->purchaseAntContribute, true);
|
||||
}
|
||||
public function toMap() {
|
||||
$res = [];
|
||||
if (null !== $this->id) {
|
||||
$res['id'] = $this->id;
|
||||
}
|
||||
if (null !== $this->name) {
|
||||
$res['name'] = $this->name;
|
||||
}
|
||||
if (null !== $this->type) {
|
||||
$res['type'] = $this->type;
|
||||
}
|
||||
if (null !== $this->amount) {
|
||||
$res['amount'] = $this->amount;
|
||||
}
|
||||
if (null !== $this->merchantContribute) {
|
||||
$res['merchant_contribute'] = $this->merchantContribute;
|
||||
}
|
||||
if (null !== $this->otherContribute) {
|
||||
$res['other_contribute'] = $this->otherContribute;
|
||||
}
|
||||
if (null !== $this->memo) {
|
||||
$res['memo'] = $this->memo;
|
||||
}
|
||||
if (null !== $this->templateId) {
|
||||
$res['template_id'] = $this->templateId;
|
||||
}
|
||||
if (null !== $this->purchaseBuyerContribute) {
|
||||
$res['purchase_buyer_contribute'] = $this->purchaseBuyerContribute;
|
||||
}
|
||||
if (null !== $this->purchaseMerchantContribute) {
|
||||
$res['purchase_merchant_contribute'] = $this->purchaseMerchantContribute;
|
||||
}
|
||||
if (null !== $this->purchaseAntContribute) {
|
||||
$res['purchase_ant_contribute'] = $this->purchaseAntContribute;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* @param array $map
|
||||
* @return VoucherDetail
|
||||
*/
|
||||
public static function fromMap($map = []) {
|
||||
$model = new self();
|
||||
if(isset($map['id'])){
|
||||
$model->id = $map['id'];
|
||||
}
|
||||
if(isset($map['name'])){
|
||||
$model->name = $map['name'];
|
||||
}
|
||||
if(isset($map['type'])){
|
||||
$model->type = $map['type'];
|
||||
}
|
||||
if(isset($map['amount'])){
|
||||
$model->amount = $map['amount'];
|
||||
}
|
||||
if(isset($map['merchant_contribute'])){
|
||||
$model->merchantContribute = $map['merchant_contribute'];
|
||||
}
|
||||
if(isset($map['other_contribute'])){
|
||||
$model->otherContribute = $map['other_contribute'];
|
||||
}
|
||||
if(isset($map['memo'])){
|
||||
$model->memo = $map['memo'];
|
||||
}
|
||||
if(isset($map['template_id'])){
|
||||
$model->templateId = $map['template_id'];
|
||||
}
|
||||
if(isset($map['purchase_buyer_contribute'])){
|
||||
$model->purchaseBuyerContribute = $map['purchase_buyer_contribute'];
|
||||
}
|
||||
if(isset($map['purchase_merchant_contribute'])){
|
||||
$model->purchaseMerchantContribute = $map['purchase_merchant_contribute'];
|
||||
}
|
||||
if(isset($map['purchase_ant_contribute'])){
|
||||
$model->purchaseAntContribute = $map['purchase_ant_contribute'];
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $amount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $merchantContribute;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $otherContribute;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $memo;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $templateId;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $purchaseBuyerContribute;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $purchaseMerchantContribute;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $purchaseAntContribute;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user