dever 5 年之前
父節點
當前提交
8719da6e74
共有 100 個文件被更改,包括 10965 次插入1240 次删除
  1. 38 2
      database/account.php
  2. 44 19
      lib/Alipay.php
  3. 10 3
      lib/Wechat.php
  4. 176 189
      sdk/alipay/aop/AlipayMobilePublicMultiMediaClient.php
  5. 101 94
      sdk/alipay/aop/AlipayMobilePublicMultiMediaExecute.php
  6. 1252 0
      sdk/alipay/aop/AopCertClient.php
  7. 527 0
      sdk/alipay/aop/AopCertification.php
  8. 985 818
      sdk/alipay/aop/AopClient.php
  9. 43 33
      sdk/alipay/aop/AopEncrypt.php
  10. 6 5
      sdk/alipay/aop/EncryptParseItem.php
  11. 5 4
      sdk/alipay/aop/EncryptResponseData.php
  12. 4 3
      sdk/alipay/aop/SignData.php
  13. 12 0
      sdk/alipay/aop/readme
  14. 4 4
      sdk/alipay/aop/request/AftAifinAddddQueryRequest.php
  15. 118 0
      sdk/alipay/aop/request/AftAifinFireeyeMytestImageQueryRequest.php
  16. 5 5
      sdk/alipay/aop/request/AftAifinFireeyeOcrImageQueryRequest.php
  17. 118 0
      sdk/alipay/aop/request/AftAifinFireeyeTestModifyRequest.php
  18. 4 4
      sdk/alipay/aop/request/AftAifinNewtestQueryRequest.php
  19. 4 4
      sdk/alipay/aop/request/AftBlockchainBaasAccountCreateRequest.php
  20. 118 0
      sdk/alipay/aop/request/AftFinsecureFaceverifyzolozFaceauthFaceInitializeRequest.php
  21. 118 0
      sdk/alipay/aop/request/AftFinsecureFaceverifyzolozFaceauthFaceQueryRequest.php
  22. 118 0
      sdk/alipay/aop/request/AftFinsecureFaceverifyzolozFaceauthWebInitializeRequest.php
  23. 118 0
      sdk/alipay/aop/request/AftFinsecureFaceverifyzolozFaceauthWebQueryRequest.php
  24. 5 5
      sdk/alipay/aop/request/AftFinsecureRiskplusSecurityPolicyQueryRequest.php
  25. 5 5
      sdk/alipay/aop/request/AliosOpenAutoInfoQueryRequest.php
  26. 1 1
      sdk/alipay/aop/request/AlipayAccountExrateAdviceAcceptRequest.php
  27. 1 1
      sdk/alipay/aop/request/AlipayAccountExrateAllclientrateQueryRequest.php
  28. 118 0
      sdk/alipay/aop/request/AlipayAccountExrateCollectcoreDataSendRequest.php
  29. 5 5
      sdk/alipay/aop/request/AlipayAccountExratePricingNotifyRequest.php
  30. 1 1
      sdk/alipay/aop/request/AlipayAccountExrateRatequeryRequest.php
  31. 118 0
      sdk/alipay/aop/request/AlipayAccountExrateSentimentDataSendRequest.php
  32. 118 0
      sdk/alipay/aop/request/AlipayAccountExrateSourcerateQueryRequest.php
  33. 118 0
      sdk/alipay/aop/request/AlipayAccountExrateTraderequestCreateRequest.php
  34. 118 0
      sdk/alipay/aop/request/AlipayAccountFinriskCompanyVerifyCreateRequest.php
  35. 118 0
      sdk/alipay/aop/request/AlipayAccountFinriskCompanyVerifyGetRequest.php
  36. 118 0
      sdk/alipay/aop/request/AlipayAccountFinriskGiriskrequestCreateRequest.php
  37. 118 0
      sdk/alipay/aop/request/AlipayAccountFinriskInstriskmonitorKeywordsBatchqueryRequest.php
  38. 118 0
      sdk/alipay/aop/request/AlipayAccountFinriskMarkriskDatafactorQueryRequest.php
  39. 1 1
      sdk/alipay/aop/request/AlipayAcquireCancelRequest.php
  40. 1 1
      sdk/alipay/aop/request/AlipayAcquireCloseRequest.php
  41. 471 0
      sdk/alipay/aop/request/AlipayAcquireCreateRequest.php
  42. 1 1
      sdk/alipay/aop/request/AlipayAcquireCreateandpayRequest.php
  43. 118 0
      sdk/alipay/aop/request/AlipayAcquireOrderShipmentinfoGetRequest.php
  44. 118 0
      sdk/alipay/aop/request/AlipayAcquireOverseasSpotCancelRequest.php
  45. 262 0
      sdk/alipay/aop/request/AlipayAcquireOverseasSpotPayRequest.php
  46. 184 0
      sdk/alipay/aop/request/AlipayAcquireOverseasSpotRefundRequest.php
  47. 118 0
      sdk/alipay/aop/request/AlipayAcquireOverseasSpotReverseRequest.php
  48. 1 1
      sdk/alipay/aop/request/AlipayAcquirePrecreateRequest.php
  49. 1 1
      sdk/alipay/aop/request/AlipayAcquireQueryRequest.php
  50. 1 1
      sdk/alipay/aop/request/AlipayAcquireRefundRequest.php
  51. 1 1
      sdk/alipay/aop/request/AlipayAppTokenGetRequest.php
  52. 118 0
      sdk/alipay/aop/request/AlipayAssetAssetorderBatchqueryRequest.php
  53. 5 5
      sdk/alipay/aop/request/AlipayAssetCardDisburseRequest.php
  54. 118 0
      sdk/alipay/aop/request/AlipayAssetCardNewtemplateCreateRequest.php
  55. 118 0
      sdk/alipay/aop/request/AlipayAssetCardReturnRefundRequest.php
  56. 118 0
      sdk/alipay/aop/request/AlipayAssetCardTransferRequest.php
  57. 118 0
      sdk/alipay/aop/request/AlipayAssetPointAccountlogQueryRequest.php
  58. 1 1
      sdk/alipay/aop/request/AlipayAssetPointBalanceQueryRequest.php
  59. 1 1
      sdk/alipay/aop/request/AlipayAssetPointBudgetQueryRequest.php
  60. 1 1
      sdk/alipay/aop/request/AlipayAssetPointOrderCreateRequest.php
  61. 1 1
      sdk/alipay/aop/request/AlipayAssetPointOrderQueryRequest.php
  62. 118 0
      sdk/alipay/aop/request/AlipayAssetPointPointprodBudgetlibAddRequest.php
  63. 118 0
      sdk/alipay/aop/request/AlipayAssetPointPointprodBudgetlibCreateRequest.php
  64. 118 0
      sdk/alipay/aop/request/AlipayAssetPointPointprodBudgetlibModifyRequest.php
  65. 118 0
      sdk/alipay/aop/request/AlipayAssetPointPointprodBudgetlibQueryRequest.php
  66. 118 0
      sdk/alipay/aop/request/AlipayAssetPointPointprodBudgetlibReturnRequest.php
  67. 118 0
      sdk/alipay/aop/request/AlipayAssetPointPointprodPointlibQueryRequest.php
  68. 118 0
      sdk/alipay/aop/request/AlipayAssetVoucherVoucherDirectuseRequest.php
  69. 118 0
      sdk/alipay/aop/request/AlipayAssetVoucherprodChargeSendRequest.php
  70. 134 0
      sdk/alipay/aop/request/AlipayBaitiaoprodAccountQueryRequest.php
  71. 134 0
      sdk/alipay/aop/request/AlipayBaitiaoprodSellerQueryRequest.php
  72. 118 0
      sdk/alipay/aop/request/AlipayBaitiaoprodSellerStatusQueryRequest.php
  73. 134 0
      sdk/alipay/aop/request/AlipayBizprodTestRequest.php
  74. 4 4
      sdk/alipay/aop/request/AlipayBossBaseAfgsdhRequest.php
  75. 118 0
      sdk/alipay/aop/request/AlipayBossBaseProcessInstanceCancelRequest.php
  76. 118 0
      sdk/alipay/aop/request/AlipayBossBaseProcessInstanceCreateRequest.php
  77. 118 0
      sdk/alipay/aop/request/AlipayBossBaseProcessInstanceQueryRequest.php
  78. 118 0
      sdk/alipay/aop/request/AlipayBossBaseProcessSignVerifyRequest.php
  79. 118 0
      sdk/alipay/aop/request/AlipayBossBaseProcessTaskProcessRequest.php
  80. 134 0
      sdk/alipay/aop/request/AlipayBossCommParameterRequest.php
  81. 118 0
      sdk/alipay/aop/request/AlipayBossContractManagementCancelRequest.php
  82. 118 0
      sdk/alipay/aop/request/AlipayBossContractManagementCreateRequest.php
  83. 118 0
      sdk/alipay/aop/request/AlipayBossContractManagementIdentifyRequest.php
  84. 118 0
      sdk/alipay/aop/request/AlipayBossContractManagementQueryRequest.php
  85. 103 0
      sdk/alipay/aop/request/AlipayBossCsBizcategoryGetbyidQueryRequest.php
  86. 1 1
      sdk/alipay/aop/request/AlipayBossCsChannelQueryRequest.php
  87. 118 0
      sdk/alipay/aop/request/AlipayBossCsCssocialYqmessageQueryRequest.php
  88. 118 0
      sdk/alipay/aop/request/AlipayBossCsDatacollectSendRequest.php
  89. 5 5
      sdk/alipay/aop/request/AlipayBossFncAliooJehjSdfRequest.php
  90. 118 0
      sdk/alipay/aop/request/AlipayBossFncArbillMonthstatementbillQueryRequest.php
  91. 4 4
      sdk/alipay/aop/request/AlipayBossFncContractManagementCreateRequest.php
  92. 118 0
      sdk/alipay/aop/request/AlipayBossFncInvoiceApplyRequest.php
  93. 118 0
      sdk/alipay/aop/request/AlipayBossFncInvoiceBatchqueryRequest.php
  94. 118 0
      sdk/alipay/aop/request/AlipayBossFncInvoiceBilllinkamtBatchqueryRequest.php
  95. 5 5
      sdk/alipay/aop/request/AlipayBossFncInvoiceLinkamtBatchqueryRequest.php
  96. 118 0
      sdk/alipay/aop/request/AlipayBossFncInvoiceMailinfoQueryRequest.php
  97. 118 0
      sdk/alipay/aop/request/AlipayBossFncInvoiceQueryRequest.php
  98. 118 0
      sdk/alipay/aop/request/AlipayBossFncInvoiceStatementbillApplyRequest.php
  99. 118 0
      sdk/alipay/aop/request/AlipayBossFncInvoicereceiptBatchqueryRequest.php
  100. 118 0
      sdk/alipay/aop/request/AlipayBossFncInvoicereceiptCreateRequest.php

+ 38 - 2
database/account.php

@@ -154,10 +154,46 @@ return array
 			'show'	=> 'type=alipay',
 		),
 
+		'appCertPath'		=> array
+		(
+			'type' 		=> 'varchar-150',
+			'name' 		=> '支付宝appCertPath',
+			'default' 	=> '',
+			'desc' 		=> '证书cert文件',
+			'match' 	=> 'option',
+			'update'	=> 'upload',
+			'key'		=> '4',
+			'show'	=> 'type=alipay',
+		),
+
+		'alipayCertPath'		=> array
+		(
+			'type' 		=> 'varchar-150',
+			'name' 		=> '支付宝alipayCertPath',
+			'default' 	=> '',
+			'desc' 		=> '证书key文件',
+			'match' 	=> 'option',
+			'update'	=> 'upload',
+			'key'		=> '4',
+			'show'	=> 'type=alipay',
+		),
+
+		'rootCertPath'		=> array
+		(
+			'type' 		=> 'varchar-150',
+			'name' 		=> '支付宝rootCertPath',
+			'default' 	=> '',
+			'desc' 		=> '证书key文件',
+			'match' 	=> 'option',
+			'update'	=> 'upload',
+			'key'		=> '4',
+			'show'	=> 'type=alipay',
+		),
+
 		'file_cert'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '证书cert文件',
+			'name' 		=> '证书cert文件-微信支付需要退款时使用',
 			'default' 	=> '',
 			'desc' 		=> '证书cert文件',
 			'match' 	=> 'option',
@@ -169,7 +205,7 @@ return array
 		'file_key'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '证书key文件',
+			'name' 		=> '证书key文件-微信支付需要退款时使用',
 			'default' 	=> '',
 			'desc' 		=> '证书key文件',
 			'match' 	=> 'option',

+ 44 - 19
lib/Alipay.php

@@ -66,20 +66,6 @@ class Alipay extends Core
 	{
 		$order_id = $this->createOrder($uid, $username, $account_id, $project_id, $product_id, $name, $cash, $this->config['type'], $order_id);
 
-		$aop = new \AopClient();
-
-		$aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do';
-		if ($this->config['box'] == 2) {
-			$aop->gatewayUrl = 'https://openapi.alipaydev.com/gateway.do';
-		}
-		
-		$aop->appId = $this->config['appid'];
-		$aop->rsaPrivateKey = $this->config['private_key'];
-		$aop->alipayrsaPublicKey = $this->config['public_key'];
-		$aop->signType = $this->signType;
-		// 开启页面信息输出
-		$aop->debugInfo = true;
-
 		$request['out_trade_no'] = $order_id;
 		$request['body'] = $name;
 		$request['total_amount'] = $cash;
@@ -94,14 +80,55 @@ class Alipay extends Core
 		$request->setBizContent($content);
 
 		if ($type == 1) {
-			$result = $aop->pageExecute($request, 'post');
+			$result = $this->aop(2)->pageExecute($request, 'post');
 		} else {
-			$result = $aop->Execute($request);
+			$result = $this->aop(2)->Execute($request);
 		}
 
 		return $result;
 	}
 
+	private function aop()
+    {
+    	$type = 1;
+    	if ($this->config['appCertPath'] && $this->config['alipayCertPath'] && $this->config['rootCertPath']) {
+    		$type = 2;
+    	}
+        if ($type == 2) {
+            $this->aop = new \AopCertClient();
+        } else {
+            $this->aop = new \AopClient();
+        }
+
+        $this->aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do';
+        if ($this->config['box'] == 2) {
+            $this->aop->gatewayUrl = 'https://openapi.alipaydev.com/gateway.do';
+        }
+        
+        $this->aop->appId = $this->config['appid'];
+        $this->aop->signType = $this->signType;
+        // 开启页面信息输出
+        $this->aop->debugInfo = true;
+
+        if ($type == 2) {
+            $appCertPath = Dever::local($this->config['appCertPath']);
+            $alipayCertPath = Dever::local($this->config['alipayCertPath']);
+            $rootCertPath = Dever::local($this->config['rootCertPath']);
+
+            if (is_file($appCertPath)) {
+                $this->aop->alipayrsaPublicKey = $this->aop->getPublicKey($alipayCertPath);
+                $this->aop->isCheckAlipayPublicCert = true;//是否校验自动下载的支付宝公钥证书,如果开启校验要保证支付宝根证书在有效期内
+                $this->aop->appCertSN = $this->aop->getCertSN($appCertPath);//调用getCertSN获取证书序列号
+                $this->aop->alipayRootCertSN = $this->aop->getRootCertSN($rootCertPath);//调用getRootCertSN获取支付宝根证书序列号
+            }
+        } else {
+        	$this->aop->rsaPrivateKey = $this->config['private_key'];
+        	$this->aop->alipayrsaPublicKey = $this->config['public_key'];
+        }
+
+        return $this->aop;
+    }
+
 	/**
 	 * 获取二维码支付
 	 */
@@ -133,9 +160,7 @@ class Alipay extends Core
 
 	private function check($data)
 	{
-		$aop = new \AopClient();
-		$aop->alipayrsaPublicKey = $this->config['public_key'];
-		$result = $aop->rsaCheckV1($data, $this->config['public_key'], $this->signType);
+		$result = $this->aop()->rsaCheckV1($data, $this->config['public_key'], $this->signType);
 		return $result;
 	}
 }

+ 10 - 3
lib/Wechat.php

@@ -13,8 +13,8 @@ class Wechat extends Core
 		# 证书
 		$config['ssl'] = array
 		(
-			'cert' => $config['file_cert'],
-			'key' => $config['file_key'],
+			'cert' => Dever::local($config['file_cert']),
+			'key' => Dever::local($config['file_key']),
 		);
 
 		$config['ip'] = (isset($config['ip']) && $config['ip']) ? $config['ip'] : Dever::ip();
@@ -198,6 +198,13 @@ class Wechat extends Core
 			return '<script type="text/javascript">'.$location.'</script>';
 		}
 		$refer = urldecode($refer);
+
+		if (strstr($refer, 'callback.')) {
+			$callback = str_replace('callback.', '', $refer);
+			$callback = $callback . '()';
+		} else {
+			$callback = 'location.href = "'.$refer.'";';
+		}
 		$tools = new \JsApiPay($this->config);
 		$info = $tools->GetJsApiParameters($order);
 
@@ -211,7 +218,7 @@ class Wechat extends Core
 					//WeixinJSBridge.log(res.err_msg);
 					if(res.err_msg == "get_brand_wcpay_request:ok")
 					{
-						location.href = "'.$refer.'";
+						'.$callback.'
 					} else {
 						alert("支付失败");
 						//alert(res.err_code+res.err_desc+res.err_msg);

+ 176 - 189
sdk/alipay/aop/AlipayMobilePublicMultiMediaClient.php

@@ -11,221 +11,208 @@
 include("AlipayMobilePublicMultiMediaExecute.php");
 
 
-class AlipayMobilePublicMultiMediaClient{
-
-    private				$DEFAULT_CHARSET = 'UTF-8';
-    private				$METHOD_POST     = "POST";
-    private				$METHOD_GET      = "GET";
-	private				$SIGN			= 'sign'; //get name
-
-	private				$timeout = 10 ;// 超时时间
-    private				$serverUrl;
-    private				$appId;
-    private				$privateKey;
-    private				$prodCode;
-    private				$format          = 'json'; //todo
-    private				$sign_type       = 'RSA'; //todo
-
-	private				$charset;
-	private				$apiVersion    = "1.0";
-	private				$apiMethodName = "alipay.mobile.public.multimedia.download";
-	private				$media_id = "L21pZnMvVDFQV3hYWGJKWFhYYUNucHJYP3Q9YW13ZiZ4c2lnPTU0MzRhYjg1ZTZjNWJmZTMxZGJiNjIzNDdjMzFkNzkw575";
-	//此处写死的,实际开发中,请传入
-
-    private				$connectTimeout  = 3000;
-    private				$readTimeout     = 15000;
-
-
-
-	function __construct($serverUrl = '', $appId = '', $partner_private_key = '', $format = '', $charset = 'GBK'){
-		$this -> serverUrl = $serverUrl;
-		$this -> appId = $appId;
-		$this -> privateKey = $partner_private_key;
-		$this -> format = $format;
-		$this -> charset = $charset;
-	}
-
-	/**
-	 * getContents 获取网址内容
-	 * @param $request
-	 * @return text | bin
-	 */
-	public function getContents(){
-		//自己的服务器如果没有 curl,可用:fsockopen() 等
-
-
-		//1:
-		//2: 私钥格式
-		$datas = array(
-			"app_id" 		=> $this -> appId,
-			"method" 		=> $this -> METHOD_POST,
-			"sign_type" 	=> $this -> sign_type,
-			"version" 		=> $this -> apiVersion,
-			"timestamp" 	=> date('Y-m-d H:i:s')  ,//yyyy-MM-dd HH:mm:ss
-			"biz_content" 	=> '{"mediaId":"'. $this -> media_id  .'"}',
-			"charset" 		=> $this -> charset
-		);
-
-
-
-		//要提交的数据
-		$data_sign = $this -> buildGetUrl( $datas );
-
-		$post_data = $data_sign;
-		//初始化 curl
-		$ch = curl_init();
-		//设置目标服务器
-		curl_setopt($ch, CURLOPT_URL, $this -> serverUrl );
-		curl_setopt($ch, CURLOPT_HEADER, TRUE);
-		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
-		//超时时间
-		curl_setopt($ch, CURLOPT_TIMEOUT, $this-> timeout);
-
-		if( $this-> METHOD_POST == 'POST'){
-			// post数据
-			curl_setopt($ch, CURLOPT_POST, 1);
-			// post的变量
-			curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
-		}
-
-
-
-
-		$output = curl_exec($ch);
-		$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
-		curl_close($ch);
-
-		echo $output;
-
-		//分离头部
-		//list($header, $body) = explode("\r\n\r\n", $output, 2);
-		$datas = explode("\r\n\r\n", $output, 2);
-		$header = $datas[0];
-
-		if( $httpCode == '200'){
-			$body = $datas[1];
-		}else{
-			$body = '';
-
-		}
-
-
-
-
-		return $this -> execute( $header, $body, $httpCode );
-	}
-
-	/**
-	 *
-	 * @param $request
-	 * @return text | bin
-	 */
-	public function execute( $header = '', $body = '', $httpCode = '' ){
-		$exe = new AlipayMobilePublicMultiMediaExecute( $header, $body, $httpCode );
-		return $exe;
-	}
-
-	public function buildGetUrl( $query = array() ){
-
-		if( ! is_array( $query ) ){
-			//exit;
-		}
-
-		//排序参数,
-		$data = $this -> buildQuery( $query );
-
-
-
-		// 私钥密码
-		$passphrase = '';
-		$key_width = 64;
-
-		//私钥
-		$privateKey = $this -> privateKey;
-		$p_key = array();
-		//如果私钥是 1行
-		if( ! stripos( $privateKey, "\n" )  ){
-			$i = 0;
-			while( $key_str = substr( $privateKey , $i * $key_width , $key_width) ){
-				$p_key[] = $key_str;
-				$i ++ ;
-			}
-		}else{
-			//echo '一行?';
-		}
-		$privateKey = "-----BEGIN RSA PRIVATE KEY-----\n" . implode("\n", $p_key) ;
-		$privateKey = $privateKey ."\n-----END RSA PRIVATE KEY-----";
+class AlipayMobilePublicMultiMediaClient
+{
+
+    private $DEFAULT_CHARSET = 'UTF-8';
+    private $METHOD_POST = "POST";
+    private $METHOD_GET = "GET";
+    private $SIGN = 'sign'; //get name
+
+    private $timeout = 10;// 超时时间
+    private $serverUrl;
+    private $appId;
+    private $privateKey;
+    private $prodCode;
+    private $format = 'json'; //todo
+    private $sign_type = 'RSA'; //todo
+
+    private $charset;
+    private $apiVersion = "1.0";
+    private $apiMethodName = "alipay.mobile.public.multimedia.download";
+    private $media_id = "L21pZnMvVDFQV3hYWGJKWFhYYUNucHJYP3Q9YW13ZiZ4c2lnPTU0MzRhYjg1ZTZjNWJmZTMxZGJiNjIzNDdjMzFkNzkw575";
+    //此处写死的,实际开发中,请传入
+
+    private $connectTimeout = 3000;
+    private $readTimeout = 15000;
+
+
+    function __construct($serverUrl = '', $appId = '', $partner_private_key = '', $format = '', $charset = 'GBK')
+    {
+        $this->serverUrl = $serverUrl;
+        $this->appId = $appId;
+        $this->privateKey = $partner_private_key;
+        $this->format = $format;
+        $this->charset = $charset;
+    }
+
+    /**
+     * getContents 获取网址内容
+     * @param $request
+     * @return text | bin
+     */
+    public function getContents()
+    {
+        //自己的服务器如果没有 curl,可用:fsockopen() 等
+
+
+        //1:
+        //2: 私钥格式
+        $datas = array(
+            "app_id" => $this->appId,
+            "method" => $this->METHOD_POST,
+            "sign_type" => $this->sign_type,
+            "version" => $this->apiVersion,
+            "timestamp" => date('Y-m-d H:i:s'),//yyyy-MM-dd HH:mm:ss
+            "biz_content" => '{"mediaId":"' . $this->media_id . '"}',
+            "charset" => $this->charset
+        );
+
+
+        //要提交的数据
+        $data_sign = $this->buildGetUrl($datas);
+
+        $post_data = $data_sign;
+        //初始化 curl
+        $ch = curl_init();
+        //设置目标服务器
+        curl_setopt($ch, CURLOPT_URL, $this->serverUrl);
+        curl_setopt($ch, CURLOPT_HEADER, TRUE);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+        //超时时间
+        curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
+
+        if ($this->METHOD_POST == 'POST') {
+            // post数据
+            curl_setopt($ch, CURLOPT_POST, 1);
+            // post的变量
+            curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
+        }
+
+
+        $output = curl_exec($ch);
+        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+        curl_close($ch);
+
+        echo $output;
+
+        //分离头部
+        //list($header, $body) = explode("\r\n\r\n", $output, 2);
+        $datas = explode("\r\n\r\n", $output, 2);
+        $header = $datas[0];
+
+        if ($httpCode == '200') {
+            $body = $datas[1];
+        } else {
+            $body = '';
+
+        }
+
+
+        return $this->execute($header, $body, $httpCode);
+    }
+
+    /**
+     *
+     * @param $request
+     * @return text | bin
+     */
+    public function execute($header = '', $body = '', $httpCode = '')
+    {
+        $exe = new AlipayMobilePublicMultiMediaExecute($header, $body, $httpCode);
+        return $exe;
+    }
+
+    public function buildGetUrl($query = array())
+    {
+
+        if (!is_array($query)) {
+            //exit;
+        }
+
+        //排序参数,
+        $data = $this->buildQuery($query);
+
+
+        // 私钥密码
+        $passphrase = '';
+        $key_width = 64;
+
+        //私钥
+        $privateKey = $this->privateKey;
+        $p_key = array();
+        //如果私钥是 1行
+        if (!stripos($privateKey, "\n")) {
+            $i = 0;
+            while ($key_str = substr($privateKey, $i * $key_width, $key_width)) {
+                $p_key[] = $key_str;
+                $i++;
+            }
+        } else {
+            //echo '一行?';
+        }
+        $privateKey = "-----BEGIN RSA PRIVATE KEY-----\n" . implode("\n", $p_key);
+        $privateKey = $privateKey . "\n-----END RSA PRIVATE KEY-----";
 
 //		echo "\n\n私钥:\n";
 //		echo( $privateKey );
 //		echo "\n\n\n";
 
-		//私钥
-		$private_id = openssl_pkey_get_private( $privateKey , $passphrase);
+        //私钥
+        $private_id = openssl_pkey_get_private($privateKey, $passphrase);
 
 
-		// 签名
-		$signature = '';
+        // 签名
+        $signature = '';
 
-		if("RSA2"==$this->sign_type){
+        if ("RSA2" == $this->sign_type) {
 
-			openssl_sign($data, $signature, $private_id, OPENSSL_ALGO_SHA256 );
-		}else{
+            openssl_sign($data, $signature, $private_id, OPENSSL_ALGO_SHA256);
+        } else {
 
-			openssl_sign($data, $signature, $private_id, OPENSSL_ALGO_SHA1 );
-		}
+            openssl_sign($data, $signature, $private_id, OPENSSL_ALGO_SHA1);
+        }
 
-		openssl_free_key( $private_id );
+        openssl_free_key($private_id);
 
-		//加密后的内容通常含有特殊字符,需要编码转换下
-		$signature = base64_encode($signature);
+        //加密后的内容通常含有特殊字符,需要编码转换下
+        $signature = base64_encode($signature);
 
-		$signature = urlencode( $signature );
+        $signature = urlencode($signature);
 
-		//$signature = 'XjUN6YM1Mc9HXebKMv7GTLy7gmyhktyOgKk2/Jf+cz4DtP6udkzTdpkjW2j/Z4ZSD7xD6CNYI1Spz4yS93HPT0a5X9LgFWYY8SaADqe+ArXg+FBSiTwUz49SE//Xd9+LEiIRsSFkbpkuiGoO6mqJmB7vXjlD5lx6qCM3nb41wb8=';
+        //$signature = 'XjUN6YM1Mc9HXebKMv7GTLy7gmyhktyOgKk2/Jf+cz4DtP6udkzTdpkjW2j/Z4ZSD7xD6CNYI1Spz4yS93HPT0a5X9LgFWYY8SaADqe+ArXg+FBSiTwUz49SE//Xd9+LEiIRsSFkbpkuiGoO6mqJmB7vXjlD5lx6qCM3nb41wb8=';
 
-		$out = $data .'&'. $this -> SIGN .'='. $signature;
+        $out = $data . '&' . $this->SIGN . '=' . $signature;
 
 //		echo "\n\n 加密后:\n";
 //		echo( $out );
 //		echo "\n\n\n";
 
-		return $out ;
-	}
+        return $out;
+    }
 
-	/*
-	 * 查询参数排序 a-z
-	 * */
-	public function buildQuery( $query ){
-		if ( !$query ) {
-			return null;
-		}
+    /*
+     * 查询参数排序 a-z
+     * */
+    public function buildQuery($query)
+    {
+        if (!$query) {
+            return null;
+        }
 
 //将要 参数 排序
-		ksort( $query );
-
-		//重新组装参数
-		$params = array();
-		foreach($query as $key => $value){
-			$params[] = $key .'='. $value ;
-		}
-		$data = implode('&', $params);
-
-		return $data;
-
-	}
-
-
-
-
-
-
-
-
-
+        ksort($query);
 
+        //重新组装参数
+        $params = array();
+        foreach ($query as $key => $value) {
+            $params[] = $key . '=' . $value;
+        }
+        $data = implode('&', $params);
 
+        return $data;
 
+    }
 
 
 }

+ 101 - 94
sdk/alipay/aop/AlipayMobilePublicMultiMediaExecute.php

@@ -9,100 +9,107 @@
 //namespace alipay\api ;
 
 
-
-class AlipayMobilePublicMultiMediaExecute{
-
-	private $code = 200 ;
-	private $msg = '';
-	private $body = '';
-	private $params = '';
-
-	private $fileSuffix = array(
-		"image/jpeg" 		=> 'jpg', //+
-		"text/plain"		=> 'text'
-	);
-
-	/*
-	 * @$header : 头部
-	 * */
-	function __construct( $header, $body, $httpCode ){
-		$this -> code = $httpCode;
-		$this -> msg = '';
-		$this -> params = $header ;
-		$this -> body = $body;
-	}
-
-	/**
-	 *
-	 * @return text | bin
-	 */
-	public function getCode(){
-		return $this -> code ;
-	}
-
-	/**
-	 *
-	 * @return text | bin
-	 */
-	public function getMsg(){
-		return $this -> msg ;
-	}
-
-	/**
-	 *
-	 * @return text | bin
-	 */
-	public function getType(){
-		$subject = $this -> params ;
-		$pattern = '/Content\-Type:([^;]+)/';
-		preg_match($pattern, $subject, $matches);
-		if( $matches ){
-			$type = $matches[1];
-		}else{
-			$type = 'application/download';
-		}
-
-		return str_replace( ' ', '', $type );
-	}
-
-	/**
-	 *
-	 * @return text | bin
-	 */
-	public function getContentLength(){
-		$subject = $this -> params ;
-		$pattern = '/Content-Length:\s*([^\n]+)/';
-		preg_match($pattern, $subject, $matches);
-		return (int)( isset($matches[1] ) ? $matches[1]  : '' );
-	}
-
-
-	public function getFileSuffix( $fileType ){
-		$type = isset( $this -> fileSuffix[ $fileType ] ) ? $this -> fileSuffix[ $fileType ] : 'text/plain' ;
-		if( !$type ){
-			$type = 'json';
-		}
-		return $type;
-	}
-
-
-
-	/**
-	 *
-	 * @return text | bin
-	 */
-	public function getBody(){
-		//header('Content-type: image/jpeg');
-		return $this -> body ;
-	}
-
-	/**
-	 * 获取参数
-	 * @return text | bin
-	 */
-	public function getParams(){
-		return $this -> params ;
-	}
+class AlipayMobilePublicMultiMediaExecute
+{
+
+    private $code = 200;
+    private $msg = '';
+    private $body = '';
+    private $params = '';
+
+    private $fileSuffix = array(
+        "image/jpeg" => 'jpg', //+
+        "text/plain" => 'text'
+    );
+
+    /*
+     * @$header : 头部
+     * */
+    function __construct($header, $body, $httpCode)
+    {
+        $this->code = $httpCode;
+        $this->msg = '';
+        $this->params = $header;
+        $this->body = $body;
+    }
+
+    /**
+     *
+     * @return text | bin
+     */
+    public function getCode()
+    {
+        return $this->code;
+    }
+
+    /**
+     *
+     * @return text | bin
+     */
+    public function getMsg()
+    {
+        return $this->msg;
+    }
+
+    /**
+     *
+     * @return text | bin
+     */
+    public function getType()
+    {
+        $subject = $this->params;
+        $pattern = '/Content\-Type:([^;]+)/';
+        preg_match($pattern, $subject, $matches);
+        if ($matches) {
+            $type = $matches[1];
+        } else {
+            $type = 'application/download';
+        }
+
+        return str_replace(' ', '', $type);
+    }
+
+    /**
+     *
+     * @return text | bin
+     */
+    public function getContentLength()
+    {
+        $subject = $this->params;
+        $pattern = '/Content-Length:\s*([^\n]+)/';
+        preg_match($pattern, $subject, $matches);
+        return (int)(isset($matches[1]) ? $matches[1] : '');
+    }
+
+
+    public function getFileSuffix($fileType)
+    {
+        $type = isset($this->fileSuffix[$fileType]) ? $this->fileSuffix[$fileType] : 'text/plain';
+        if (!$type) {
+            $type = 'json';
+        }
+        return $type;
+    }
+
+
+    /**
+     *
+     * @return text | bin
+     */
+    public function getBody()
+    {
+        //header('Content-type: image/jpeg');
+        return $this->body;
+    }
+
+    /**
+     * 获取参数
+     * @return text | bin
+     */
+    public function getParams()
+    {
+        return $this->params;
+    }
 
 
 }

+ 1252 - 0
sdk/alipay/aop/AopCertClient.php

@@ -0,0 +1,1252 @@
+<?php
+
+require_once 'AopEncrypt.php';
+require_once 'AopCertification.php';
+require_once 'EncryptParseItem.php';
+require_once 'EncryptResponseData.php';
+require_once 'SignData.php';
+
+class AopCertClient
+{
+    //应用证书地址
+    public $appCertSN;
+
+    //支付宝公钥证书地址
+    public $alipayCertSN;
+
+    //支付宝根证书地址
+    public $alipayRootCertSN;
+
+    //支付宝根证书地址
+    public $alipayRootCertContent;
+
+    //是否校验支付宝公钥证书
+    public $isCheckAlipayPublicCert;
+
+    //应用ID
+    public $appId;
+
+    //私钥文件路径
+    public $rsaPrivateKeyFilePath;
+
+    //私钥值
+    public $rsaPrivateKey;
+
+    //网关
+    public $gatewayUrl = "https://openapi.alipay.com/gateway.do";
+    //返回数据格式
+    public $format = "json";
+
+    //api版本
+    public $apiVersion = "1.0";
+
+    // 表单提交字符集编码
+    public $postCharset = "UTF-8";
+
+    //使用文件读取文件格式,请只传递该值
+    public $alipayPublicKey = null;
+
+    //使用读取字符串格式,请只传递该值
+    public $alipayrsaPublicKey;
+
+    public $debugInfo = false;
+
+    //签名类型
+    public $signType = "RSA";
+
+    //加密密钥和类型
+    public $encryptKey;
+
+    public $encryptType = "AES";
+
+    protected $alipaySdkVersion = "alipay-sdk-php-easyalipay-20191227";
+
+    private $fileCharset = "UTF-8";
+
+    private $RESPONSE_SUFFIX = "_response";
+
+    private $ERROR_RESPONSE = "error_response";
+
+    private $SIGN_NODE_NAME = "sign";
+
+    private $ALIPAY_CERT_SN = "alipay_cert_sn";
+
+
+    //加密XML节点名称
+    private $ENCRYPT_XML_NODE_NAME = "response_encrypted";
+
+    private $needEncrypt = false;
+
+    private $targetServiceUrl = "";
+
+    /**
+     * 从证书中提取序列号
+     * @param $cert
+     * @return string
+     */
+    public function getCertSN($certPath)
+    {
+        $cert = file_get_contents($certPath);
+        $ssl = openssl_x509_parse($cert);
+        $SN = md5(array2string(array_reverse($ssl['issuer'])) . $ssl['serialNumber']);
+        return $SN;
+    }
+
+    /**
+     * 提取根证书序列号
+     * @param $cert  根证书
+     * @return string|null
+     */
+    public function getRootCertSN($certPath)
+    {
+        $cert = file_get_contents($certPath);
+        $this->alipayRootCertContent = $cert;
+        $array = explode("-----END CERTIFICATE-----", $cert);
+        $SN = null;
+        for ($i = 0; $i < count($array) - 1; $i++) {
+            $ssl[$i] = openssl_x509_parse($array[$i] . "-----END CERTIFICATE-----");
+            if (strpos($ssl[$i]['serialNumber'], '0x') === 0) {
+                $ssl[$i]['serialNumber'] = $this->hex2dec($ssl[$i]['serialNumber']);
+            }
+            if ($ssl[$i]['signatureTypeLN'] == "sha1WithRSAEncryption" || $ssl[$i]['signatureTypeLN'] == "sha256WithRSAEncryption") {
+                if ($SN == null) {
+                    $SN = md5(array2string(array_reverse($ssl[$i]['issuer'])) . $ssl[$i]['serialNumber']);
+                } else {
+
+                    $SN = $SN . "_" . md5(array2string(array_reverse($ssl[$i]['issuer'])) . $ssl[$i]['serialNumber']);
+                }
+            }
+        }
+        return $SN;
+    }
+
+    /**
+     * 0x转高精度数字
+     * @param $hex
+     * @return int|string
+     */
+    function hex2dec($hex)
+    {
+        $dec = 0;
+        $len = strlen($hex);
+        for ($i = 1; $i <= $len; $i++) {
+            $dec = bcadd($dec, bcmul(strval(hexdec($hex[$i - 1])), bcpow('16', strval($len - $i))));
+        }
+        return $dec;
+    }
+
+    /**
+     * 从证书中提取公钥
+     * @param $cert
+     * @return mixed
+     */
+    public function getPublicKey($certPath)
+    {
+        $cert = file_get_contents($certPath);
+        $pkey = openssl_pkey_get_public($cert);
+        $keyData = openssl_pkey_get_details($pkey);
+        $public_key = str_replace('-----BEGIN PUBLIC KEY-----', '', $keyData['key']);
+        $public_key = trim(str_replace('-----END PUBLIC KEY-----', '', $public_key));
+        return $public_key;
+    }
+
+
+    /**
+     * 验证签名
+     * 在使用本方法前,必须初始化AopCertClient且传入公钥参数。
+     * 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
+     *
+     * @param $params
+     * @param $rsaPublicKeyFilePath
+     * @param string $signType
+     * @return bool
+     */
+    public function rsaCheckV1($params, $rsaPublicKeyFilePath, $signType = 'RSA')
+    {
+        $sign = $params['sign'];
+        $params['sign_type'] = null;
+        $params['sign'] = null;
+        return $this->verify($this->getSignContent($params), $sign, $rsaPublicKeyFilePath, $signType);
+    }
+
+    /**
+     * 验证签名
+     * 在使用本方法前,必须初始化AopCertClient且传入公钥参数。
+     * 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
+     *
+     * @param $params
+     * @param $rsaPublicKeyFilePath
+     * @param string $signType
+     * @return bool
+     */
+    public function rsaCheckV2($params, $rsaPublicKeyFilePath, $signType = 'RSA')
+    {
+        $sign = $params['sign'];
+        $params['sign'] = null;
+        return $this->verify($this->getSignContent($params), $sign, $rsaPublicKeyFilePath, $signType);
+    }
+
+
+    /**
+     *  在使用本方法前,必须初始化AopCertClient且传入公私钥参数。
+     *  公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
+     **/
+    public function checkSignAndDecrypt($params, $rsaPublicKeyPem, $rsaPrivateKeyPem, $isCheckSign, $isDecrypt, $signType = 'RSA')
+    {
+        $charset = $params['charset'];
+        $bizContent = $params['biz_content'];
+        if ($isCheckSign) {
+            if (!$this->rsaCheckV2($params, $rsaPublicKeyPem, $signType)) {
+                echo "<br/>checkSign failure<br/>";
+                exit;
+            }
+        }
+        if ($isDecrypt) {
+            return $this->rsaDecrypt($bizContent, $rsaPrivateKeyPem, $charset);
+        }
+
+        return $bizContent;
+    }
+
+    /**
+     *  在使用本方法前,必须初始化AopCertClient且传入公私钥参数。
+     *  公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
+     **/
+    public function encryptAndSign($bizContent, $rsaPublicKeyPem, $rsaPrivateKeyPem, $charset, $isEncrypt, $isSign, $signType = 'RSA')
+    {
+        // 加密,并签名
+        if ($isEncrypt && $isSign) {
+            $encrypted = $this->rsaEncrypt($bizContent, $rsaPublicKeyPem, $charset);
+            $sign = $this->sign($encrypted, $signType);
+            $response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$encrypted</response><encryption_type>RSA</encryption_type><sign>$sign</sign><sign_type>$signType</sign_type></alipay>";
+            return $response;
+        }
+        // 加密,不签名
+        if ($isEncrypt && (!$isSign)) {
+            $encrypted = $this->rsaEncrypt($bizContent, $rsaPublicKeyPem, $charset);
+            $response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$encrypted</response><encryption_type>$signType</encryption_type></alipay>";
+            return $response;
+        }
+        // 不加密,但签名
+        if ((!$isEncrypt) && $isSign) {
+            $sign = $this->sign($bizContent, $signType);
+            $response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$bizContent</response><sign>$sign</sign><sign_type>$signType</sign_type></alipay>";
+            return $response;
+        }
+        // 不加密,不签名
+        $response = "<?xml version=\"1.0\" encoding=\"$charset\"?>$bizContent";
+        return $response;
+    }
+
+    /**
+     *  在使用本方法前,必须初始化AopCertClient且传入公私钥参数。
+     **/
+    public function rsaEncrypt($data, $rsaPublicKeyFilePath, $charset)
+    {
+        if ($this->checkEmpty($this->alipayPublicKey)) {
+            //读取字符串
+            $pubKey = $this->alipayrsaPublicKey;
+            $res = "-----BEGIN PUBLIC KEY-----\n" .
+                wordwrap($pubKey, 64, "\n", true) .
+                "\n-----END PUBLIC KEY-----";
+        } else {
+            //读取公钥文件
+            $pubKey = file_get_contents($rsaPublicKeyFilePath);
+            //转换为openssl格式密钥
+            $res = openssl_get_publickey($pubKey);
+        }
+
+        ($res) or die('支付宝RSA公钥错误。请检查公钥文件格式是否正确');
+        $blocks = $this->splitCN($data, 0, 30, $charset);
+        $chrtext  = null;
+        $encodes  = array();
+        foreach ($blocks as $n => $block) {
+            if (!openssl_public_encrypt($block, $chrtext , $res)) {
+                echo "<br/>" . openssl_error_string() . "<br/>";
+            }
+            $encodes[] = $chrtext ;
+        }
+        $chrtext = implode(",", $encodes);
+
+        return base64_encode($chrtext);
+    }
+
+    /**
+     *  在使用本方法前,必须初始化AopCertClient且传入公私钥参数。
+     *  公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
+     **/
+    public function rsaDecrypt($data, $rsaPrivateKeyPem, $charset)
+    {
+
+        if ($this->checkEmpty($this->rsaPrivateKeyFilePath)) {
+            //读字符串
+            $priKey = $this->rsaPrivateKey;
+            $res = "-----BEGIN RSA PRIVATE KEY-----\n" .
+                wordwrap($priKey, 64, "\n", true) .
+                "\n-----END RSA PRIVATE KEY-----";
+        } else {
+            $priKey = file_get_contents($this->rsaPrivateKeyFilePath);
+            $res = openssl_get_privatekey($priKey);
+        }
+        ($res) or die('您使用的私钥格式错误,请检查RSA私钥配置');
+        //转换为openssl格式密钥
+        $decodes = explode(',', $data);
+        $strnull = "";
+        $dcyCont = "";
+        foreach ($decodes as $n => $decode) {
+            if (!openssl_private_decrypt($decode, $dcyCont, $res)) {
+                echo "<br/>" . openssl_error_string() . "<br/>";
+            }
+            $strnull .= $dcyCont;
+        }
+        return $strnull;
+    }
+
+    function splitCN($cont, $n = 0, $subnum, $charset)
+    {
+        //$len = strlen($cont) / 3;
+        $arrr = array();
+        for ($i = $n; $i < strlen($cont); $i += $subnum) {
+            $res = $this->subCNchar($cont, $i, $subnum, $charset);
+            if (!empty ($res)) {
+                $arrr[] = $res;
+            }
+        }
+
+        return $arrr;
+    }
+
+    function subCNchar($str, $start = 0, $length, $charset = "gbk")
+    {
+        if (strlen($str) <= $length) {
+            return $str;
+        }
+        $re['utf-8'] = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xff][\x80-\xbf]{3}/";
+        $re['gb2312'] = "/[\x01-\x7f]|[\xb0-\xf7][\xa0-\xfe]/";
+        $re['gbk'] = "/[\x01-\x7f]|[\x81-\xfe][\x40-\xfe]/";
+        $re['big5'] = "/[\x01-\x7f]|[\x81-\xfe]([\x40-\x7e]|\xa1-\xfe])/";
+        preg_match_all($re[$charset], $str, $match);
+        $slice = join("", array_slice($match[0], $start, $length));
+        return $slice;
+    }
+
+    /**
+     * 生成用于调用收银台SDK的字符串
+     * @param $request SDK接口的请求参数对象
+     * @param $appAuthToken 三方应用授权token
+     * @return string
+     */
+    public function sdkExecute($request, $appAuthToken = null)
+    {
+
+        $this->setupCharsets($request);
+        $params['app_id'] = $this->appId;
+        $params['method'] = $request->getApiMethodName();
+        $params['format'] = $this->format;
+        $params['sign_type'] = $this->signType;
+        $params['timestamp'] = date("Y-m-d H:i:s");
+        $params['alipay_sdk'] = $this->alipaySdkVersion;
+        $params['charset'] = $this->postCharset;
+        $version = $request->getApiVersion();
+        $params['version'] = $this->checkEmpty($version) ? $this->apiVersion : $version;
+        $params["app_cert_sn"] = $this->appCertSN;
+        $params["alipay_root_cert_sn"] = $this->alipayRootCertSN;
+        if ($notify_url = $request->getNotifyUrl()) {
+            $params['notify_url'] = $notify_url;
+        }
+        $params['app_auth_token'] = $appAuthToken;
+        $dict = $request->getApiParas();
+        $params['biz_content'] = $dict['biz_content'];
+        ksort($params);
+        $params['sign'] = $this->generateSign($params, $this->signType);
+        foreach ($params as &$value) {
+            $value = $this->characet($value, $params['charset']);
+        }
+        return http_build_query($params);
+    }
+
+
+    /**
+     * 页面提交执行方法
+     * @param $request 跳转类接口的request
+     * @param string $httpmethod 提交方式,两个值可选:post、get;
+     * @param null $appAuthToken 三方应用授权token
+     * @return 构建好的、签名后的最终跳转URL(GET)或String形式的form(POST)
+     * @throws Exception
+     */
+    public function pageExecute($request, $httpmethod = "POST", $appAuthToken = null)
+    {
+
+        $this->setupCharsets($request);
+        if (strcasecmp($this->fileCharset, $this->postCharset)) {
+            throw new Exception("文件编码:[" . $this->fileCharset . "] 与表单提交编码:[" . $this->postCharset . "]两者不一致!");
+        }
+        $iv = null;
+        if (!$this->checkEmpty($request->getApiVersion())) {
+            $iv = $request->getApiVersion();
+        } else {
+            $iv = $this->apiVersion;
+        }
+
+        //组装系统参数
+        $sysParams["app_id"] = $this->appId;
+        $sysParams["version"] = $iv;
+        $sysParams["format"] = $this->format;
+        $sysParams["sign_type"] = $this->signType;
+        $sysParams["method"] = $request->getApiMethodName();
+        $sysParams["timestamp"] = date("Y-m-d H:i:s");
+        $sysParams["alipay_sdk"] = $this->alipaySdkVersion;
+        $sysParams["terminal_type"] = $request->getTerminalType();
+        $sysParams["terminal_info"] = $request->getTerminalInfo();
+        $sysParams["prod_code"] = $request->getProdCode();
+        $sysParams["notify_url"] = $request->getNotifyUrl();
+        $sysParams["return_url"] = $request->getReturnUrl();
+        $sysParams["charset"] = $this->postCharset;
+        $sysParams["app_auth_token"] = $appAuthToken;
+        $sysParams["app_cert_sn"] = $this->appCertSN;
+        $sysParams["alipay_root_cert_sn"] = $this->alipayRootCertSN;
+
+        //获取业务参数
+        $apiParams = $request->getApiParas();
+        if (method_exists($request, "getNeedEncrypt") && $request->getNeedEncrypt()) {
+            $sysParams["encrypt_type"] = $this->encryptType;
+            if ($this->checkEmpty($apiParams['biz_content'])) {
+                throw new Exception(" api request Fail! The reason : encrypt request is not supperted!");
+            }
+            if ($this->checkEmpty($this->encryptKey) || $this->checkEmpty($this->encryptType)) {
+                throw new Exception(" encryptType and encryptKey must not null! ");
+            }
+            if ("AES" != $this->encryptType) {
+                throw new Exception("加密类型只支持AES");
+            }
+            // 执行加密
+            $enCryptContent = encrypt($apiParams['biz_content'], $this->encryptKey);
+            $apiParams['biz_content'] = $enCryptContent;
+        }
+        $totalParams = array_merge($apiParams, $sysParams);
+        //待签名字符串
+        $preSignStr = $this->getSignContent($totalParams);
+        //签名
+        $totalParams["sign"] = $this->generateSign($totalParams, $this->signType);
+
+        if ("GET" == strtoupper($httpmethod)) {
+            //value做urlencode
+            $preString = $this->getSignContentUrlencode($totalParams);
+            //拼接GET请求串
+            $requestUrl = $this->gatewayUrl . "?" . $preString;
+            return $requestUrl;
+        } else {
+            //拼接表单字符串
+            return $this->buildRequestForm($totalParams);
+        }
+    }
+
+    //此方法对value做urlencode
+    public function getSignContentUrlencode($params)
+    {
+        ksort($params);
+        $stringToBeSigned = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->checkEmpty($v) && "@" != substr($v, 0, 1)) {
+
+                // 转换成目标字符集
+                $v = $this->characet($v, $this->postCharset);
+
+                if ($i == 0) {
+                    $stringToBeSigned .= "$k" . "=" . urlencode($v);
+                } else {
+                    $stringToBeSigned .= "&" . "$k" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+        unset ($k, $v);
+        return $stringToBeSigned;
+    }
+
+
+    /**
+     * 建立请求,以表单HTML形式构造(默认)
+     * @param $para_temp 请求参数数组
+     * @return 提交表单HTML文本
+     */
+    protected function buildRequestForm($para_temp)
+    {
+        $sHtml = "<form id='alipaysubmit' name='alipaysubmit' action='" . $this->gatewayUrl . "?charset=" . trim($this->postCharset) . "' method='POST'>";
+        while (list ($key, $val) = $this->fun_adm_each($para_temp)) {
+            if (false === $this->checkEmpty($val)) {
+                //$val = $this->characet($val, $this->postCharset);
+                $val = str_replace("'", "&apos;", $val);
+                //$val = str_replace("\"","&quot;",$val);
+                $sHtml .= "<input type='hidden' name='" . $key . "' value='" . $val . "'/>";
+            }
+        }
+        //submit按钮控件请不要含有name属性
+        $sHtml = $sHtml . "<input type='submit' value='ok' style='display:none;''></form>";
+        $sHtml = $sHtml . "<script>document.forms['alipaysubmit'].submit();</script>";
+        return $sHtml;
+    }
+
+    protected function fun_adm_each(&$array)
+    {
+        $res = array();
+        $key = key($array);
+        if ($key !== null) {
+            next($array);
+            $res[1] = $res['value'] = $array[$key];
+            $res[0] = $res['key'] = $key;
+        } else {
+            $res = false;
+        }
+        return $res;
+    }
+
+    public function execute($request, $authToken = null, $appInfoAuthtoken = null, $targetAppId = null)
+    {
+        $this->setupCharsets($request);
+        //如果两者编码不一致,会出现签名验签或者乱码
+        if (strcasecmp($this->fileCharset, $this->postCharset)) {
+            throw new Exception("文件编码:[" . $this->fileCharset . "] 与表单提交编码:[" . $this->postCharset . "]两者不一致!");
+        }
+        $iv = null;
+        if (!$this->checkEmpty($request->getApiVersion())) {
+            $iv = $request->getApiVersion();
+        } else {
+            $iv = $this->apiVersion;
+        }
+        //组装系统参数
+        $sysParams["app_id"] = $this->appId;
+        $sysParams["version"] = $iv;
+        $sysParams["format"] = $this->format;
+        $sysParams["sign_type"] = $this->signType;
+        $sysParams["method"] = $request->getApiMethodName();
+        $sysParams["timestamp"] = date("Y-m-d H:i:s");
+        $sysParams["auth_token"] = $authToken;
+        $sysParams["alipay_sdk"] = $this->alipaySdkVersion;
+        $sysParams["terminal_type"] = $request->getTerminalType();
+        $sysParams["terminal_info"] = $request->getTerminalInfo();
+        $sysParams["prod_code"] = $request->getProdCode();
+        $sysParams["notify_url"] = $request->getNotifyUrl();
+        $sysParams["charset"] = $this->postCharset;
+        $sysParams["app_auth_token"] = $appInfoAuthtoken;
+        $sysParams["app_cert_sn"] = $this->appCertSN;
+        $sysParams["alipay_root_cert_sn"] = $this->alipayRootCertSN;
+        $sysParams["target_app_id"] = $targetAppId;
+        if (!$this->checkEmpty($this->targetServiceUrl)) {
+            $sysParams["ws_service_url"] = $this->targetServiceUrl;
+        }
+
+        //获取业务参数
+        $apiParams = $request->getApiParas();
+
+        if (method_exists($request, "getNeedEncrypt") && $request->getNeedEncrypt()) {
+            $sysParams["encrypt_type"] = $this->encryptType;
+            if ($this->checkEmpty($apiParams['biz_content'])) {
+                throw new Exception(" api request Fail! The reason : encrypt request is not supperted!");
+            }
+            if ($this->checkEmpty($this->encryptKey) || $this->checkEmpty($this->encryptType)) {
+                throw new Exception(" encryptType and encryptKey must not null! ");
+            }
+            if ("AES" != $this->encryptType) {
+                throw new Exception("加密类型只支持AES");
+            }
+            // 执行加密
+            $enCryptContent = encrypt($apiParams['biz_content'], $this->encryptKey);
+            $apiParams['biz_content'] = $enCryptContent;
+        }
+
+        //签名
+        $sysParams["sign"] = $this->generateSign(array_merge($apiParams, $sysParams), $this->signType);
+
+        //系统参数放入GET请求串
+        $requestUrl = $this->gatewayUrl . "?";
+        foreach ($sysParams as $sysParamKey => $sysParamValue) {
+            $requestUrl .= "$sysParamKey=" . urlencode($this->characet($sysParamValue, $this->postCharset)) . "&";
+        }
+        $requestUrl = substr($requestUrl, 0, -1);
+
+        //发起HTTP请求
+        try {
+            $resp = $this->curl($requestUrl, $apiParams);
+        } catch (Exception $e) {
+            $this->logCommunicationError($sysParams["method"], $requestUrl, "HTTP_ERROR_" . $e->getCode(), $e->getMessage());
+            return false;
+        }
+
+        //解析AOP返回结果
+        $respWellFormed = false;
+
+        // 将返回结果转换本地文件编码
+        $r = @iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp);
+        $signData = null;
+
+        if ("json" == $this->format) {
+            $respObject = json_decode($r);
+            if (null !== $respObject) {
+                $respWellFormed = true;
+                $signData = $this->parserJSONSignData($request, $resp, $respObject);
+            }
+        } else if ("xml" == $this->format) {
+            $disableLibxmlEntityLoader = libxml_disable_entity_loader(true);
+            $respObject = @ simplexml_load_string($resp);
+            if (false !== $respObject) {
+                $respWellFormed = true;
+                $signData = $this->parserXMLSignData($request, $resp);
+            }
+            libxml_disable_entity_loader($disableLibxmlEntityLoader);
+        }
+
+        //返回的HTTP文本不是标准JSON或者XML,记下错误日志
+        if (false === $respWellFormed) {
+            $this->logCommunicationError($sysParams["method"], $requestUrl, "HTTP_RESPONSE_NOT_WELL_FORMED", $resp);
+            return false;
+        }
+
+        // 验签
+        $this->checkResponseSign($request, $signData, $resp, $respObject);
+
+        // 解密
+        if (method_exists($request, "getNeedEncrypt") && $request->getNeedEncrypt()) {
+
+            if ("json" == $this->format) {
+                $resp = $this->encryptJSONSignSource($request, $resp);
+                // 将返回结果转换本地文件编码
+                $r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp);
+                $respObject = json_decode($r);
+            } else {
+                $resp = $this->encryptXMLSignSource($request, $resp);
+                $r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp);
+                $disableLibxmlEntityLoader = libxml_disable_entity_loader(true);
+                $respObject = @ simplexml_load_string($r);
+                libxml_disable_entity_loader($disableLibxmlEntityLoader);
+            }
+        }
+        return $respObject;
+    }
+
+
+    /**
+     * 设置编码格式
+     * @param $request
+     */
+    private function setupCharsets($request)
+    {
+        if ($this->checkEmpty($this->postCharset)) {
+            $this->postCharset = 'UTF-8';
+        }
+        $str = preg_match('/[\x80-\xff]/', $this->appId) ? $this->appId : print_r($request, true);
+        $this->fileCharset = mb_detect_encoding($str, "UTF-8, GBK") == 'UTF-8' ? 'UTF-8' : 'GBK';
+    }
+
+    /**
+     * 校验$value是否非空
+     *  if not set ,return true;
+     *    if is null , return true;
+     **/
+    protected function checkEmpty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    /**
+     * 加签
+     * @param $params
+     * @param string $signType
+     * @return mixed
+     */
+    public function generateSign($params, $signType = "RSA")
+    {
+        return $this->sign($this->getSignContent($params), $signType);
+    }
+
+    public function rsaSign($params, $signType = "RSA")
+    {
+        return $this->sign($this->getSignContent($params), $signType);
+    }
+
+    protected function sign($data, $signType = "RSA")
+    {
+        if ($this->checkEmpty($this->rsaPrivateKeyFilePath)) {
+            $priKey = $this->rsaPrivateKey;
+            $res = "-----BEGIN RSA PRIVATE KEY-----\n" .
+                wordwrap($priKey, 64, "\n", true) .
+                "\n-----END RSA PRIVATE KEY-----";
+        } else {
+            $priKey = file_get_contents($this->rsaPrivateKeyFilePath);
+            $res = openssl_get_privatekey($priKey);
+        }
+
+        ($res) or die('您使用的私钥格式错误,请检查RSA私钥配置');
+
+        if ("RSA2" == $signType) {
+            openssl_sign($data, $sign, $res, OPENSSL_ALGO_SHA256);
+        } else {
+            openssl_sign($data, $sign, $res);
+        }
+
+        if (!$this->checkEmpty($this->rsaPrivateKeyFilePath)) {
+            openssl_free_key($res);
+        }
+        $sign = base64_encode($sign);
+        return $sign;
+    }
+
+    public function getSignContent($params)
+    {
+        ksort($params);
+        $stringToBeSigned = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->checkEmpty($v) && "@" != substr($v, 0, 1)) {
+
+                // 转换成目标字符集
+                $v = $this->characet($v, $this->postCharset);
+
+                if ($i == 0) {
+                    $stringToBeSigned .= "$k" . "=" . "$v";
+                } else {
+                    $stringToBeSigned .= "&" . "$k" . "=" . "$v";
+                }
+                $i++;
+            }
+        }
+        unset ($k, $v);
+        return $stringToBeSigned;
+    }
+
+
+    /**
+     * RSA单独签名方法,未做字符串处理,字符串处理见getSignContent()
+     * @param $data 待签名字符串
+     * @param $privatekey 商户私钥,根据keyfromfile来判断是读取字符串还是读取文件,false:填写私钥字符串去回车和空格 true:填写私钥文件路径
+     * @param $signType 签名方式,RSA:SHA1     RSA2:SHA256
+     * @param $keyfromfile 私钥获取方式,读取字符串还是读文件
+     * @return string
+     */
+    public function alonersaSign($data, $privatekey, $signType = "RSA", $keyfromfile = false)
+    {
+        if (!$keyfromfile) {
+            $priKey = $privatekey;
+            $res = "-----BEGIN RSA PRIVATE KEY-----\n" .
+                wordwrap($priKey, 64, "\n", true) .
+                "\n-----END RSA PRIVATE KEY-----";
+        } else {
+            $priKey = file_get_contents($privatekey);
+            $res = openssl_get_privatekey($priKey);
+        }
+        ($res) or die('您使用的私钥格式错误,请检查RSA私钥配置');
+        if ("RSA2" == $signType) {
+            openssl_sign($data, $sign, $res, OPENSSL_ALGO_SHA256);
+        } else {
+            openssl_sign($data, $sign, $res);
+        }
+        if ($keyfromfile) {
+            openssl_free_key($res);
+        }
+        $sign = base64_encode($sign);
+        return $sign;
+    }
+
+    /**
+     * 转换字符集编码
+     * @param $data
+     * @param $targetCharset
+     * @return string
+     */
+    function characet($data, $targetCharset)
+    {
+
+        if (!empty($data)) {
+            $fileType = $this->fileCharset;
+            if (strcasecmp($fileType, $targetCharset) != 0) {
+                $data = mb_convert_encoding($data, $targetCharset, $fileType);
+            }
+        }
+        return $data;
+    }
+
+    /**
+     * 发送curl请求
+     * @param $url
+     * @param null $postFields
+     * @return bool|string
+     * @throws Exception
+     */
+    protected function curl($url, $postFields = null)
+    {
+        $ch = curl_init();
+        curl_setopt($ch, CURLOPT_URL, $url);
+        curl_setopt($ch, CURLOPT_FAILONERROR, false);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
+        $postBodyString = "";
+        $encodeArray = Array();
+        $postMultipart = false;
+
+        if (is_array($postFields) && 0 < count($postFields)) {
+            foreach ($postFields as $k => $v) {
+                if ("@" != substr($v, 0, 1)) //判断是不是文件上传
+                {
+                    $postBodyString .= "$k=" . urlencode($this->characet($v, $this->postCharset)) . "&";
+                    $encodeArray[$k] = $this->characet($v, $this->postCharset);
+                } else //文件上传用multipart/form-data,否则用www-form-urlencoded
+                {
+                    $postMultipart = true;
+                    $encodeArray[$k] = new \CURLFile(substr($v, 1));
+                }
+            }
+            unset ($k, $v);
+            curl_setopt($ch, CURLOPT_POST, true);
+            if ($postMultipart) {
+                curl_setopt($ch, CURLOPT_POSTFIELDS, $encodeArray);
+            } else {
+                curl_setopt($ch, CURLOPT_POSTFIELDS, substr($postBodyString, 0, -1));
+            }
+        }
+
+        if (!$postMultipart) {
+            $headers = array('content-type: application/x-www-form-urlencoded;charset=' . $this->postCharset);
+            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
+        }
+        $reponse = curl_exec($ch);
+        if (curl_errno($ch)) {
+            throw new Exception(curl_error($ch), 0);
+        } else {
+            $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+            if (200 !== $httpStatusCode) {
+                throw new Exception($reponse, $httpStatusCode);
+            }
+        }
+        curl_close($ch);
+        return $reponse;
+    }
+
+    protected function getMillisecond()
+    {
+        list($s1, $s2) = explode(' ', microtime());
+        return (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000);
+    }
+
+    /**
+     * 打印日志信息
+     * @param $apiName
+     * @param $requestUrl
+     * @param $errorCode
+     * @param $responseTxt
+     */
+    protected function logCommunicationError($apiName, $requestUrl, $errorCode, $responseTxt)
+    {
+        $logData = array(
+            date("Y-m-d H:i:s"),
+            $apiName,
+            $this->appId,
+            PHP_OS,
+            $this->alipaySdkVersion,
+            $requestUrl,
+            $errorCode,
+            str_replace("\n", "", $responseTxt)
+        );
+        echo json_encode($logData);
+    }
+
+    /**
+     * Json格式签名内容
+     * @param $request
+     * @param $responseContent
+     * @param $responseJSON
+     * @return SignData
+     */
+    function parserJSONSignData($request, $responseContent, $responseJSON)
+    {
+        $signData = new SignData();
+        $signData->sign = $this->parserJSONSign($responseJSON);
+        $signData->signSourceData = $this->parserJSONSignSource($request, $responseContent);
+        return $signData;
+    }
+
+    function parserJSONSign($responseJSon)
+    {
+        return $responseJSon->sign;
+    }
+
+    function parserJSONSignSource($request, $responseContent)
+    {
+        $apiName = $request->getApiMethodName();
+        $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
+        $rootIndex = strpos($responseContent, $rootNodeName);
+        $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE);
+        if ($rootIndex > 0) {
+            return $this->parserJSONSource($responseContent, $rootNodeName, $rootIndex);
+        } else if ($errorIndex > 0) {
+            return $this->parserJSONSource($responseContent, $this->ERROR_RESPONSE, $errorIndex);
+        } else {
+            return null;
+        }
+    }
+
+    function parserJSONSource($responseContent, $nodeName, $nodeIndex)
+    {
+        $signDataStartIndex = $nodeIndex + strlen($nodeName) + 2;
+        if (strrpos($responseContent, $this->ALIPAY_CERT_SN)) {
+            $signIndex = strrpos($responseContent, "\"" . $this->ALIPAY_CERT_SN . "\"");
+        } else {
+            $signIndex = strrpos($responseContent, "\"" . $this->SIGN_NODE_NAME . "\"");
+        }
+        // 签名前-逗号
+        $signDataEndIndex = $signIndex - 1;
+        $indexLen = $signDataEndIndex - $signDataStartIndex;
+        if ($indexLen < 0) {
+            return null;
+        }
+        return substr($responseContent, $signDataStartIndex, $indexLen);
+    }
+
+    /**
+     * XML格式签名内容
+     * @param $request
+     * @param $responseContent
+     * @return SignData
+     */
+    function parserXMLSignData($request, $responseContent)
+    {
+        $signData = new SignData();
+        $signData->sign = $this->parserXMLSign($responseContent);
+        $signData->signSourceData = $this->parserXMLSignSource($request, $responseContent);
+        return $signData;
+    }
+
+    function parserXMLSign($responseContent)
+    {
+        if (strrpos($responseContent, $this->ALIPAY_CERT_SN)) {
+            $signNodeName = "<" . $this->ALIPAY_CERT_SN . ">";
+            $signEndNodeName = "</" . $this->ALIPAY_CERT_SN . ">";
+        } else {
+            $signNodeName = "<" . $this->SIGN_NODE_NAME . ">";
+            $signEndNodeName = "</" . $this->SIGN_NODE_NAME . ">";
+        }
+
+        $indexOfSignNode = strpos($responseContent, $signNodeName);
+        $indexOfSignEndNode = strpos($responseContent, $signEndNodeName);
+        if ($indexOfSignNode < 0 || $indexOfSignEndNode < 0) {
+            return null;
+        }
+        $nodeIndex = ($indexOfSignNode + strlen($signNodeName));
+        $indexLen = $indexOfSignEndNode - $nodeIndex;
+        if ($indexLen < 0) {
+            return null;
+        }
+        // 签名
+        return substr($responseContent, $nodeIndex, $indexLen);
+    }
+
+    function parserXMLSignSource($request, $responseContent)
+    {
+        $apiName = $request->getApiMethodName();
+        $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
+        $rootIndex = strpos($responseContent, $rootNodeName);
+        $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE);
+        if ($rootIndex > 0) {
+            return $this->parserXMLSource($responseContent, $rootNodeName, $rootIndex);
+        } else if ($errorIndex > 0) {
+            return $this->parserXMLSource($responseContent, $this->ERROR_RESPONSE, $errorIndex);
+        } else {
+            return null;
+        }
+    }
+
+
+    function parserXMLSource($responseContent, $nodeName, $nodeIndex)
+    {
+        $signDataStartIndex = $nodeIndex + strlen($nodeName) + 1;
+        if (strrpos($responseContent, $this->ALIPAY_CERT_SN)) {
+            $signIndex = strrpos($responseContent, "<" . $this->ALIPAY_CERT_SN . ">");
+        } else {
+            $signIndex = strrpos($responseContent, "<" . $this->SIGN_NODE_NAME . ">");
+        }
+
+        // 签名前-逗号
+        $signDataEndIndex = $signIndex - 1;
+        $indexLen = $signDataEndIndex - $signDataStartIndex + 1;
+
+        if ($indexLen < 0) {
+            return null;
+        }
+        return substr($responseContent, $signDataStartIndex, $indexLen);
+    }
+
+
+    /**
+     * 验签
+     * @param $request
+     * @param $signData
+     * @param $resp
+     * @param $respObject
+     * @throws Exception
+     */
+    public function checkResponseSign($request, $signData, $resp, $respObject)
+    {
+        if (!$this->checkEmpty($this->alipayPublicKey) || !$this->checkEmpty($this->alipayrsaPublicKey)) {
+            if ($signData == null || $this->checkEmpty($signData->sign) || $this->checkEmpty($signData->signSourceData)) {
+                throw new Exception(" check sign Fail! The reason : signData is Empty");
+            }
+            // 获取结果sub_code
+            $responseSubCode = $this->parserResponseSubCode($request, $resp, $respObject, $this->format);
+            if (!$this->checkEmpty($responseSubCode) || ($this->checkEmpty($responseSubCode) && !$this->checkEmpty($signData->sign))) {
+                $checkResult = $this->verify($signData->signSourceData, $signData->sign, $this->alipayPublicKey, $this->signType);
+
+                if (!$checkResult) {
+
+                    //请求网关下载新的支付宝公钥证书
+                    if (!$respObject->alipay_cert_sn && ($request->getApiMethodName() == "alipay.open.app.alipaycert.download")) {
+                        throw new Exception(" check sign Fail! The reason : alipay_cert_sn is Empty");
+                    }
+                    //组装系统参数
+                    $sysParams["app_id"] = $this->appId;
+                    $sysParams["format"] = $this->format;
+                    $sysParams["sign_type"] = $this->signType;
+                    $sysParams["method"] = "alipay.open.app.alipaycert.download";
+                    $sysParams["timestamp"] = date("Y-m-d H:i:s");
+                    $sysParams["alipay_sdk"] = $this->alipaySdkVersion;
+                    $sysParams["terminal_type"] = $request->getTerminalType();
+                    $sysParams["terminal_info"] = $request->getTerminalInfo();
+                    $sysParams["prod_code"] = $request->getProdCode();
+                    $sysParams["notify_url"] = $request->getNotifyUrl();
+                    $sysParams["charset"] = $this->postCharset;
+                    $sysParams["app_cert_sn"] = $this->appCertSN;
+                    $sysParams["alipay_root_cert_sn"] = $this->alipayRootCertSN;
+                    //获取业务参数
+                    $apiParas = array();
+                    $apiParas["biz_content"] = "{\"alipay_cert_sn\":\"" . $respObject->alipay_cert_sn . "\"}";
+                    $apiParams = $apiParas;
+
+                    //签名
+                    $sysParams["sign"] = $this->generateSign(array_merge($apiParams, $sysParams), $this->signType);
+
+                    //系统参数放入GET请求串
+                    $requestUrl = $this->gatewayUrl . "?";
+                    foreach ($sysParams as $sysParamKey => $sysParamValue) {
+                        $requestUrl .= "$sysParamKey=" . urlencode($this->characet($sysParamValue, $this->postCharset)) . "&";
+                    }
+                    $requestUrl = substr($requestUrl, 0, -1);
+                    //发起HTTP请求
+                    try {
+                        $resp = $this->curl($requestUrl, $apiParams);
+                    } catch (Exception $e) {
+                        $this->logCommunicationError($sysParams["method"], $requestUrl, "HTTP_ERROR_" . $e->getCode(), $e->getMessage());
+                        return false;
+                    }
+
+                    // 将返回结果转换本地文件编码
+                    $r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp);
+
+                    $respObject = json_decode($r);
+                    $resultCode = $respObject->alipay_open_app_alipaycert_download_response->code;
+                    $certContent = $respObject->alipay_open_app_alipaycert_download_response->alipay_cert_content;
+
+                    if (!empty($resultCode) && $resultCode == 10000 && !empty($certContent)) {
+                        $cert = base64_decode($certContent);
+                        $certCheck = true;
+                        if (!empty($this->alipayRootCertContent) && $this->isCheckAlipayPublicCert) {
+                            $certCheck = isTrusted($cert, $this->alipayRootCertContent);
+                        }
+                        if ($certCheck) {
+                            $pkey = openssl_pkey_get_public($cert);
+                            $keyData = openssl_pkey_get_details($pkey);
+                            $public_key = str_replace('-----BEGIN PUBLIC KEY-----', '', $keyData['key']);
+                            $public_key = trim(str_replace('-----END PUBLIC KEY-----', '', $public_key));
+                            $this->alipayrsaPublicKey = $public_key;
+                            $checkResult = $this->verify($signData->signSourceData, $signData->sign, $this->alipayrsaPublicKey, $this->signType);
+                        } else {
+                            //如果下载下来的支付宝公钥证书使用根证书检查失败直接抛异常
+                            throw new Exception("check sign Fail! [sign=" . $signData->sign . ", signSourceData=" . $signData->signSourceData . "]");
+                        }
+                    }
+
+                    if (!$checkResult) {
+                        if (strpos($signData->signSourceData, "\\/") > 0) {
+                            $signData->signSourceData = str_replace("\\/", "/", $signData->signSourceData);
+                            $checkResult = $this->verify($signData->signSourceData, $signData->sign, $this->alipayPublicKey, $this->signType);
+                            if (!$checkResult) {
+                                throw new Exception("check sign Fail! [sign=" . $signData->sign . ", signSourceData=" . $signData->signSourceData . "]");
+                            }
+                        } else {
+                            throw new Exception("check sign Fail! [sign=" . $signData->sign . ", signSourceData=" . $signData->signSourceData . "]");
+                        }
+                    }
+
+                }
+            }
+        }
+    }
+
+
+    function parserResponseSubCode($request, $responseContent, $respObject, $format)
+    {
+        if ("json" == $format) {
+            $apiName = $request->getApiMethodName();
+            $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
+            $errorNodeName = $this->ERROR_RESPONSE;
+            $rootIndex = strpos($responseContent, $rootNodeName);
+            $errorIndex = strpos($responseContent, $errorNodeName);
+            if ($rootIndex > 0) {
+                // 内部节点对象
+                $rInnerObject = $respObject->$rootNodeName;
+            } elseif ($errorIndex > 0) {
+                $rInnerObject = $respObject->$errorNodeName;
+            } else {
+                return null;
+            }
+            // 存在属性则返回对应值
+            if (isset($rInnerObject->sub_code)) {
+                return $rInnerObject->sub_code;
+            } else {
+                return null;
+            }
+        } elseif ("xml" == $format) {
+            // xml格式sub_code在同一层级
+            return $respObject->sub_code;
+        }
+    }
+
+    function verify($data, $sign, $rsaPublicKeyFilePath, $signType = 'RSA')
+    {
+        if ($this->checkEmpty($this->alipayPublicKey)) {
+            $pubKey = $this->alipayrsaPublicKey;
+            $res = "-----BEGIN PUBLIC KEY-----\n" .
+                wordwrap($pubKey, 64, "\n", true) .
+                "\n-----END PUBLIC KEY-----";
+        } else {
+            //读取公钥文件
+            $pubKey = file_get_contents($rsaPublicKeyFilePath);
+            //转换为openssl格式密钥
+            $res = openssl_get_publickey($pubKey);
+        }
+        ($res) or die('支付宝RSA公钥错误。请检查公钥文件格式是否正确');
+        //调用openssl内置方法验签,返回bool值
+        $result = FALSE;
+        if ("RSA2" == $signType) {
+            $result = (openssl_verify($data, base64_decode($sign), $res, OPENSSL_ALGO_SHA256) === 1);
+        } else {
+            $result = (openssl_verify($data, base64_decode($sign), $res) === 1);
+        }
+        if (!$this->checkEmpty($this->alipayPublicKey)) {
+            //释放资源
+            openssl_free_key($res);
+        }
+        return $result;
+    }
+
+
+    // 获取加密内容
+    private function encryptJSONSignSource($request, $responseContent)
+    {
+        $parsetItem = $this->parserEncryptJSONSignSource($request, $responseContent);
+        $bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex);
+        $bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) + 1 - $parsetItem->endIndex);
+        $bizContent = decrypt($parsetItem->encryptContent, $this->encryptKey);
+        return $bodyIndexContent . $bizContent . $bodyEndContent;
+    }
+
+
+    private function parserEncryptJSONSignSource($request, $responseContent)
+    {
+        $apiName = $request->getApiMethodName();
+        $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
+        $rootIndex = strpos($responseContent, $rootNodeName);
+        $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE);
+        if ($rootIndex > 0) {
+            return $this->parserEncryptJSONItem($responseContent, $rootNodeName, $rootIndex);
+        } else if ($errorIndex > 0) {
+            return $this->parserEncryptJSONItem($responseContent, $this->ERROR_RESPONSE, $errorIndex);
+        } else {
+            return null;
+        }
+    }
+
+    private function parserEncryptJSONItem($responseContent, $nodeName, $nodeIndex)
+    {
+        $signDataStartIndex = $nodeIndex + strlen($nodeName) + 2;
+        if (strrpos($responseContent, $this->ALIPAY_CERT_SN)) {
+            $signIndex = strpos($responseContent, "\"" . $this->ALIPAY_CERT_SN . "\"");
+        } else {
+            $signIndex = strpos($responseContent, "\"" . $this->SIGN_NODE_NAME . "\"");
+        }
+
+        // 签名前-逗号
+        $signDataEndIndex = $signIndex - 1;
+        if ($signDataEndIndex < 0) {
+            $signDataEndIndex = strlen($responseContent) - 1;
+        }
+        $indexLen = $signDataEndIndex - $signDataStartIndex;
+        $encContent = substr($responseContent, $signDataStartIndex + 1, $indexLen - 2);
+        $encryptParseItem = new EncryptParseItem();
+        $encryptParseItem->encryptContent = $encContent;
+        $encryptParseItem->startIndex = $signDataStartIndex;
+        $encryptParseItem->endIndex = $signDataEndIndex;
+        return $encryptParseItem;
+    }
+
+    // 获取加密内容
+    private function encryptXMLSignSource($request, $responseContent)
+    {
+        $parsetItem = $this->parserEncryptXMLSignSource($request, $responseContent);
+        $bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex);
+        $bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) + 1 - $parsetItem->endIndex);
+        $bizContent = decrypt($parsetItem->encryptContent, $this->encryptKey);
+        return $bodyIndexContent . $bizContent . $bodyEndContent;
+
+    }
+
+    private function parserEncryptXMLSignSource($request, $responseContent)
+    {
+        $apiName = $request->getApiMethodName();
+        $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
+        $rootIndex = strpos($responseContent, $rootNodeName);
+        $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE);
+        if ($rootIndex > 0) {
+            return $this->parserEncryptXMLItem($responseContent, $rootNodeName, $rootIndex);
+        } else if ($errorIndex > 0) {
+            return $this->parserEncryptXMLItem($responseContent, $this->ERROR_RESPONSE, $errorIndex);
+        } else {
+            return null;
+        }
+    }
+
+    private function parserEncryptXMLItem($responseContent, $nodeName, $nodeIndex)
+    {
+        $signDataStartIndex = $nodeIndex + strlen($nodeName) + 1;
+        $xmlStartNode = "<" . $this->ENCRYPT_XML_NODE_NAME . ">";
+        $xmlEndNode = "</" . $this->ENCRYPT_XML_NODE_NAME . ">";
+        $indexOfXmlNode = strpos($responseContent, $xmlEndNode);
+        if ($indexOfXmlNode < 0) {
+            $item = new EncryptParseItem();
+            $item->encryptContent = null;
+            $item->startIndex = 0;
+            $item->endIndex = 0;
+            return $item;
+        }
+        $startIndex = $signDataStartIndex + strlen($xmlStartNode);
+        $bizContentLen = $indexOfXmlNode - $startIndex;
+        $bizContent = substr($responseContent, $startIndex, $bizContentLen);
+        $encryptParseItem = new EncryptParseItem();
+        $encryptParseItem->encryptContent = $bizContent;
+        $encryptParseItem->startIndex = $signDataStartIndex;
+        $encryptParseItem->endIndex = $indexOfXmlNode + strlen($xmlEndNode);
+        return $encryptParseItem;
+    }
+
+    function echoDebug($content)
+    {
+        if ($this->debugInfo) {
+            echo "<br/>" . $content;
+        }
+    }
+}

+ 527 - 0
sdk/alipay/aop/AopCertification.php

@@ -0,0 +1,527 @@
+<?php
+
+/**
+ * 验证支付宝公钥证书是否可信
+ * @param $alipayCert 支付宝公钥证书
+ * @param $rootCert 支付宝根证书
+ */
+function isTrusted($alipayCert, $rootCert)
+{
+    $alipayCerts = readPemCertChain($alipayCert);
+    $rootCerts = readPemCertChain($rootCert);
+    if (verifyCertChain($alipayCerts, $rootCerts)) {
+        return verifySignature($alipayCert, $rootCert);
+    } else {
+        return false;
+    }
+
+}
+
+function verifySignature($alipayCert, $rootCert)
+{
+    $alipayCertArray = explode("-----END CERTIFICATE-----", $alipayCert);
+    $rootCertArray = explode("-----END CERTIFICATE-----", $rootCert);
+    $length = count($rootCertArray) - 1;
+    $checkSign = isCertSigner($alipayCertArray[0] . "-----END CERTIFICATE-----", $alipayCertArray[1] . "-----END CERTIFICATE-----");
+    if (!$checkSign) {
+        $checkSign = isCertSigner($alipayCertArray[1] . "-----END CERTIFICATE-----", $alipayCertArray[0] . "-----END CERTIFICATE-----");
+        if ($checkSign) {
+            $issuer = openssl_x509_parse($alipayCertArray[0] . "-----END CERTIFICATE-----")['issuer'];
+            for ($i = 0; $i < $length; $i++) {
+                $subject = openssl_x509_parse($rootCertArray[$i] . "-----END CERTIFICATE-----")['subject'];
+                if ($issuer == $subject) {
+                    isCertSigner($alipayCertArray[0] . "-----END CERTIFICATE-----", $rootCertArray[$i] . $rootCertArray);
+                    return $checkSign;
+                }
+            }
+        } else {
+            return $checkSign;
+        }
+    } else {
+        $issuer = openssl_x509_parse($alipayCertArray[1] . "-----END CERTIFICATE-----")['issuer'];
+        for ($i = 0; $i < $length; $i++) {
+            $subject = openssl_x509_parse($rootCertArray[$i] . "-----END CERTIFICATE-----")['subject'];
+            if ($issuer == $subject) {
+                $checkSign = isCertSigner($alipayCertArray[1] . "-----END CERTIFICATE-----", $rootCertArray[$i] . "-----END CERTIFICATE-----");
+                return $checkSign;
+            }
+        }
+        return $checkSign;
+    }
+}
+
+function readPemCertChain($cert)
+{
+    $array = explode("-----END CERTIFICATE-----", $cert);
+    $certs[] = null;
+    for ($i = 0; $i < count($array) - 1; $i++) {
+        $certs[$i] = openssl_x509_parse($array[$i] . "-----END CERTIFICATE-----");
+    }
+    return $certs;
+}
+
+function verifyCert($prev, $rootCerts)
+{
+    $nowTime = time();
+    if ($nowTime < $prev['validFrom_time_t']) {
+        echo "证书未激活";
+        return false;
+    }
+    if ($nowTime > $prev['validTo_time_t']) {
+        echo "证书已经过期";
+        return false;
+    }
+    $subjectMap = null;
+    for ($i = 0; $i < count($rootCerts); $i++) {
+        $subjectDN = array2string($rootCerts[$i]['subject']);
+        $subjectMap[$subjectDN] = $rootCerts[$i];
+    }
+    $issuerDN = array2string(($prev['issuer']));
+    if (!array_key_exists($issuerDN, $subjectMap)) {
+        echo "证书链验证失败";
+        return false;
+    }
+    return true;
+}
+
+/**
+ * 验证证书链是否是信任证书库中证书签发的
+ * @param $alipayCerts 目标验证证书列表
+ * @param $rootCerts 可信根证书列表
+ */
+function verifyCertChain($alipayCerts, $rootCerts)
+{
+    $sorted = sortByDn($alipayCerts);
+    if (!$sorted) {
+        echo "证书链验证失败:不是完整的证书链";
+        return false;
+    }
+    //先验证第一个证书是不是信任库中证书签发的
+    $prev = $alipayCerts[0];
+    $firstOK = verifyCert($prev, $rootCerts);
+    $length = count($alipayCerts);
+    if (!$firstOK || $length == 1) {
+        return $firstOK;
+    }
+
+    $nowTime = time();
+    //验证证书链
+    for ($i = 1; $i < $length; $i++) {
+        $cert = $alipayCerts[$i];
+        if ($nowTime < $cert['validFrom_time_t']) {
+            echo "证书未激活";
+            return false;
+        }
+        if ($nowTime > $cert['validTo_time_t']) {
+            echo "证书已经过期";
+            return false;
+        }
+    }
+    return true;
+}
+
+/**
+ * 将证书链按照完整的签发顺序进行排序,排序后证书链为:[issuerA, subjectA]-[issuerA, subjectB]-[issuerB, subjectC]-[issuerC, subjectD]...
+ * @param $certs 证书链
+ */
+function sortByDn(&$certs)
+{
+    //是否包含自签名证书
+    $hasSelfSignedCert = false;
+    $subjectMap = null;
+    $issuerMap = null;
+    for ($i = 0; $i < count($certs); $i++) {
+        if (isSelfSigned($certs[$i])) {
+            if ($hasSelfSignedCert) {
+                return false;
+            }
+            $hasSelfSignedCert = true;
+        }
+        $subjectDN = array2string($certs[$i]['subject']);
+        $issuerDN = array2string(($certs[$i]['issuer']));
+        $subjectMap[$subjectDN] = $certs[$i];
+        $issuerMap[$issuerDN] = $certs[$i];
+    }
+    $certChain = null;
+    addressingUp($subjectMap, $certChain, $certs[0]);
+    addressingDown($issuerMap, $certChain, $certs[0]);
+
+    //说明证书链不完整
+    if (count($certs) != count($certChain)) {
+        return false;
+    }
+    //将证书链复制到原先的数据
+    for ($i = 0; $i < count($certs); $i++) {
+        $certs[$i] = $certChain[count($certs) - $i - 1];
+    }
+    return true;
+}
+
+/**
+ * 验证证书是否是自签发的
+ * @param $cert 目标证书
+ */
+function isSelfSigned($cert)
+{
+    $subjectDN = array2string($cert['subject']);
+    $issuerDN = array2string($cert['issuer']);
+    return ($subjectDN == $issuerDN);
+}
+
+
+function array2string($array)
+{
+    $string = [];
+    if ($array && is_array($array)) {
+        foreach ($array as $key => $value) {
+            $string[] = $key . '=' . $value;
+        }
+    }
+    return implode(',', $string);
+}
+
+/**
+ * 向上构造证书链
+ * @param $subjectMap 主题和证书的映射
+ * @param $certChain 证书链
+ * @param $current 当前需要插入证书链的证书,include
+ */
+function addressingUp($subjectMap, &$certChain, $current)
+{
+    $certChain[] = $current;
+    if (isSelfSigned($current)) {
+        return;
+    }
+    $issuerDN = array2string($current['issuer']);
+
+    if (!array_key_exists($issuerDN, $subjectMap)) {
+        return;
+    }
+    addressingUp($subjectMap, $certChain, $subjectMap[$issuerDN]);
+}
+
+/**
+ * 向下构造证书链
+ * @param $issuerMap 签发者和证书的映射
+ * @param $certChain 证书链
+ * @param $current 当前需要插入证书链的证书,exclude
+ */
+function addressingDown($issuerMap, &$certChain, $current)
+{
+    $subjectDN = array2string($current['subject']);
+    if (!array_key_exists($subjectDN, $issuerMap)) {
+        return $certChain;
+    }
+    $certChain[] = $issuerMap[$subjectDN];
+    addressingDown($issuerMap, $certChain, $issuerMap[$subjectDN]);
+}
+
+
+/**
+ * Extract signature from der encoded cert.
+ * Expects x509 der encoded certificate consisting of a section container
+ * containing 2 sections and a bitstream.  The bitstream contains the
+ * original encrypted signature, encrypted by the public key of the issuing
+ * signer.
+ * @param string $der
+ * @return string on success
+ * @return bool false on failures
+ */
+function extractSignature($der = false)
+{
+    if (strlen($der) < 5) {
+        return false;
+    }
+    // skip container sequence
+    $der = substr($der, 4);
+    // now burn through two sequences and the return the final bitstream
+    while (strlen($der) > 1) {
+        $class = ord($der[0]);
+        $classHex = dechex($class);
+        switch ($class) {
+            // BITSTREAM
+            case 0x03:
+                $len = ord($der[1]);
+                $bytes = 0;
+                if ($len & 0x80) {
+                    $bytes = $len & 0x0f;
+                    $len = 0;
+                    for ($i = 0; $i < $bytes; $i++) {
+                        $len = ($len << 8) | ord($der[$i + 2]);
+                    }
+                }
+                return substr($der, 3 + $bytes, $len);
+                break;
+            // SEQUENCE
+            case 0x30:
+                $len = ord($der[1]);
+                $bytes = 0;
+                if ($len & 0x80) {
+                    $bytes = $len & 0x0f;
+                    $len = 0;
+                    for ($i = 0; $i < $bytes; $i++) {
+                        $len = ($len << 8) | ord($der[$i + 2]);
+                    }
+                }
+                $contents = substr($der, 2 + $bytes, $len);
+                $der = substr($der, 2 + $bytes + $len);
+                break;
+            default:
+                return false;
+                break;
+        }
+    }
+    return false;
+}
+
+/**
+ * Get signature algorithm oid from der encoded signature data.
+ * Expects decrypted signature data from a certificate in der format.
+ * This ASN1 data should contain the following structure:
+ * SEQUENCE
+ *    SEQUENCE
+ *       OID    (signature algorithm)
+ *       NULL
+ * OCTET STRING (signature hash)
+ * @return bool false on failures
+ * @return string oid
+ */
+function getSignatureAlgorithmOid($der = null)
+{
+    // Validate this is the der we need...
+    if (!is_string($der) or strlen($der) < 5) {
+        return false;
+    }
+    $bit_seq1 = 0;
+    $bit_seq2 = 2;
+    $bit_oid = 4;
+    if (ord($der[$bit_seq1]) !== 0x30) {
+        die('Invalid DER passed to getSignatureAlgorithmOid()');
+    }
+    if (ord($der[$bit_seq2]) !== 0x30) {
+        die('Invalid DER passed to getSignatureAlgorithmOid()');
+    }
+    if (ord($der[$bit_oid]) !== 0x06) {
+        die('Invalid DER passed to getSignatureAlgorithmOid');
+    }
+    // strip out what we don't need and get the oid
+    $der = substr($der, $bit_oid);
+    // Get the oid
+    $len = ord($der[1]);
+    $bytes = 0;
+    if ($len & 0x80) {
+        $bytes = $len & 0x0f;
+        $len = 0;
+        for ($i = 0; $i < $bytes; $i++) {
+            $len = ($len << 8) | ord($der[$i + 2]);
+        }
+    }
+    $oid_data = substr($der, 2 + $bytes, $len);
+    // Unpack the OID
+    $oid = floor(ord($oid_data[0]) / 40);
+    $oid .= '.' . ord($oid_data[0]) % 40;
+    $value = 0;
+    $i = 1;
+    while ($i < strlen($oid_data)) {
+        $value = $value << 7;
+        $value = $value | (ord($oid_data[$i]) & 0x7f);
+        if (!(ord($oid_data[$i]) & 0x80)) {
+            $oid .= '.' . $value;
+            $value = 0;
+        }
+        $i++;
+    }
+    return $oid;
+}
+
+/**
+ * Get signature hash from der encoded signature data.
+ * Expects decrypted signature data from a certificate in der format.
+ * This ASN1 data should contain the following structure:
+ * SEQUENCE
+ *    SEQUENCE
+ *       OID    (signature algorithm)
+ *       NULL
+ * OCTET STRING (signature hash)
+ * @return bool false on failures
+ * @return string hash
+ */
+function getSignatureHash($der = null)
+{
+    // Validate this is the der we need...
+    if (!is_string($der) or strlen($der) < 5) {
+        return false;
+    }
+    if (ord($der[0]) !== 0x30) {
+        die('Invalid DER passed to getSignatureHash()');
+    }
+    // strip out the container sequence
+    $der = substr($der, 2);
+    if (ord($der[0]) !== 0x30) {
+        die('Invalid DER passed to getSignatureHash()');
+    }
+    // Get the length of the first sequence so we can strip it out.
+    $len = ord($der[1]);
+    $bytes = 0;
+    if ($len & 0x80) {
+        $bytes = $len & 0x0f;
+        $len = 0;
+        for ($i = 0; $i < $bytes; $i++) {
+            $len = ($len << 8) | ord($der[$i + 2]);
+        }
+    }
+    $der = substr($der, 2 + $bytes + $len);
+    // Now we should have an octet string
+    if (ord($der[0]) !== 0x04) {
+        die('Invalid DER passed to getSignatureHash()');
+    }
+    $len = ord($der[1]);
+    $bytes = 0;
+    if ($len & 0x80) {
+        $bytes = $len & 0x0f;
+        $len = 0;
+        for ($i = 0; $i < $bytes; $i++) {
+            $len = ($len << 8) | ord($der[$i + 2]);
+        }
+    }
+    return bin2hex(substr($der, 2 + $bytes, $len));
+}
+
+/**
+ * Determine if one cert was used to sign another
+ * Note that more than one CA cert can give a positive result, some certs
+ * re-issue signing certs after having only changed the expiration dates.
+ * @param string $cert - PEM encoded cert
+ * @param string $caCert - PEM encoded cert that possibly signed $cert
+ * @return bool
+ */
+function isCertSigner($certPem = null, $caCertPem = null)
+{
+    if (!function_exists('openssl_pkey_get_public')) {
+        die('Need the openssl_pkey_get_public() function.');
+    }
+    if (!function_exists('openssl_public_decrypt')) {
+        die('Need the openssl_public_decrypt() function.');
+    }
+    if (!function_exists('hash')) {
+        die('Need the php hash() function.');
+    }
+    if (empty($certPem) or empty($caCertPem)) {
+        return false;
+    }
+    // Convert the cert to der for feeding to extractSignature.
+    $certDer = pemToDer($certPem);
+    if (!is_string($certDer)) {
+        die('invalid certPem');
+    }
+    // Grab the encrypted signature from the der encoded cert.
+    $encryptedSig = extractSignature($certDer);
+    if (!is_string($encryptedSig)) {
+        die('Failed to extract encrypted signature from certPem.');
+    }
+    // Extract the public key from the ca cert, which is what has
+    // been used to encrypt the signature in the cert.
+    $pubKey = openssl_pkey_get_public($caCertPem);
+    if ($pubKey === false) {
+        die('Failed to extract the public key from the ca cert.');
+    }
+    // Attempt to decrypt the encrypted signature using the CA's public
+    // key, returning the decrypted signature in $decryptedSig.  If
+    // it can't be decrypted, this ca was not used to sign it for sure...
+    $rc = openssl_public_decrypt($encryptedSig, $decryptedSig, $pubKey);
+    if ($rc === false) {
+        return false;
+    }
+    // We now have the decrypted signature, which is der encoded
+    // asn1 data containing the signature algorithm and signature hash.
+    // Now we need what was originally hashed by the issuer, which is
+    // the original DER encoded certificate without the issuer and
+    // signature information.
+    $origCert = stripSignerAsn($certDer);
+    if ($origCert === false) {
+        die('Failed to extract unsigned cert.');
+    }
+    // Get the oid of the signature hash algorithm, which is required
+    // to generate our own hash of the original cert.  This hash is
+    // what will be compared to the issuers hash.
+    $oid = getSignatureAlgorithmOid($decryptedSig);
+    if ($oid === false) {
+        die('Failed to determine the signature algorithm.');
+    }
+    switch ($oid) {
+        case '1.2.840.113549.2.2':
+            $algo = 'md2';
+            break;
+        case '1.2.840.113549.2.4':
+            $algo = 'md4';
+            break;
+        case '1.2.840.113549.2.5':
+            $algo = 'md5';
+            break;
+        case '1.3.14.3.2.18':
+            $algo = 'sha';
+            break;
+        case '1.3.14.3.2.26':
+            $algo = 'sha1';
+            break;
+        case '2.16.840.1.101.3.4.2.1':
+            $algo = 'sha256';
+            break;
+        case '2.16.840.1.101.3.4.2.2':
+            $algo = 'sha384';
+            break;
+        case '2.16.840.1.101.3.4.2.3':
+            $algo = 'sha512';
+            break;
+        default:
+            die('Unknown signature hash algorithm oid: ' . $oid);
+            break;
+    }
+    // Get the issuer generated hash from the decrypted signature.
+    $decryptedHash = getSignatureHash($decryptedSig);
+    // Ok, hash the original unsigned cert with the same algorithm
+    // and if it matches $decryptedHash we have a winner.
+    $certHash = hash($algo, $origCert);
+    return ($decryptedHash === $certHash);
+}
+
+/**
+ * Convert pem encoded certificate to DER encoding
+ * @return string $derEncoded on success
+ * @return bool false on failures
+ */
+function pemToDer($pem = null)
+{
+    if (!is_string($pem)) {
+        return false;
+    }
+    $cert_split = preg_split('/(-----((BEGIN)|(END)) CERTIFICATE-----)/', $pem);
+    if (!isset($cert_split[1])) {
+        return false;
+    }
+    return base64_decode($cert_split[1]);
+}
+
+/**
+ * Obtain der cert with issuer and signature sections stripped.
+ * @param string $der - der encoded certificate
+ * @return string $der on success
+ * @return bool false on failures.
+ */
+function stripSignerAsn($der = null)
+{
+    if (!is_string($der) or strlen($der) < 8) {
+        return false;
+    }
+    $bit = 4;
+    $len = ord($der[($bit + 1)]);
+    $bytes = 0;
+    if ($len & 0x80) {
+        $bytes = $len & 0x0f;
+        $len = 0;
+        for ($i = 0; $i < $bytes; $i++) {
+            $len = ($len << 8) | ord($der[$bit + $i + 2]);
+        }
+    }
+    return substr($der, 4, $len + 4);
+}

+ 985 - 818
sdk/alipay/aop/AopClient.php

@@ -1,1110 +1,1277 @@
 <?php
 
 require_once 'AopEncrypt.php';
+require_once 'EncryptParseItem.php';
+require_once 'EncryptResponseData.php';
+require_once 'SignData.php';
 
-class AopClient {
-	//应用ID
-	public $appId;
-	//私钥文件路径
-	public $rsaPrivateKeyFilePath;
+class AopClient
+{
+    //应用ID
+    public $appId;
 
-	//私钥值
-	public $rsaPrivateKey;
-	//网关
-	public $gatewayUrl = "https://openapi.alipay.com/gateway.do";
-	//返回数据格式
-	public $format = "json";
-	//api版本
-	public $apiVersion = "1.0";
+    //私钥文件路径
+    public $rsaPrivateKeyFilePath;
 
-	// 表单提交字符集编码
-	public $postCharset = "UTF-8";
+    //私钥值
+    public $rsaPrivateKey;
 
+    //网关
+    public $gatewayUrl = "https://openapi.alipay.com/gateway.do";
+    //返回数据格式
+    public $format = "json";
+    //api版本
+    public $apiVersion = "1.0";
 
-	public $alipayPublicKey = null;
+    // 表单提交字符集编码
+    public $postCharset = "UTF-8";
 
-	public $alipayrsaPublicKey;
+    //使用文件读取文件格式,请只传递该值
+    public $alipayPublicKey = null;
 
+    //使用读取字符串格式,请只传递该值
+    public $alipayrsaPublicKey;
 
-	public $debugInfo = false;
 
-	private $fileCharset = "UTF-8";
+    public $debugInfo = false;
 
-	private $RESPONSE_SUFFIX = "_response";
+    private $fileCharset = "UTF-8";
 
-	private $ERROR_RESPONSE = "error_response";
+    private $RESPONSE_SUFFIX = "_response";
 
-	private $SIGN_NODE_NAME = "sign";
+    private $ERROR_RESPONSE = "error_response";
 
+    private $SIGN_NODE_NAME = "sign";
 
-	//加密XML节点名称
-	private $ENCRYPT_XML_NODE_NAME = "response_encrypted";
 
-	private $needEncrypt = false;
+    //加密XML节点名称
+    private $ENCRYPT_XML_NODE_NAME = "response_encrypted";
 
+    private $needEncrypt = false;
 
-	//签名类型
-	public $signType = "RSA";
 
+    //签名类型
+    public $signType = "RSA";
 
-	//加密密钥和类型
 
-	public $encryptKey;
+    //加密密钥和类型
 
-	public $encryptType = "AES";
+    public $encryptKey;
 
-	protected $alipaySdkVersion = "alipay-sdk-php-20161101";
+    public $encryptType = "AES";
 
-	public function generateSign($params, $signType = "RSA") {
-		return $this->sign($this->getSignContent($params), $signType);
-	}
+    private $targetServiceUrl = "";
 
-	public function rsaSign($params, $signType = "RSA") {
-		return $this->sign($this->getSignContent($params), $signType);
-	}
+    protected $alipaySdkVersion = "alipay-sdk-php-easyalipay-20191227";
 
-	protected function getSignContent($params) {
-		ksort($params);
+    public function generateSign($params, $signType = "RSA")
+    {
+        return $this->sign($this->getSignContent($params), $signType);
+    }
 
-		$stringToBeSigned = "";
-		$i = 0;
-		foreach ($params as $k => $v) {
-			if (false === $this->checkEmpty($v) && "@" != substr($v, 0, 1)) {
+    public function rsaSign($params, $signType = "RSA")
+    {
+        return $this->sign($this->getSignContent($params), $signType);
+    }
 
-				// 转换成目标字符集
-				$v = $this->characet($v, $this->postCharset);
+    public function getSignContent($params)
+    {
+        ksort($params);
 
-				if ($i == 0) {
-					$stringToBeSigned .= "$k" . "=" . "$v";
-				} else {
-					$stringToBeSigned .= "&" . "$k" . "=" . "$v";
-				}
-				$i++;
-			}
-		}
+        $stringToBeSigned = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->checkEmpty($v) && "@" != substr($v, 0, 1)) {
 
-		unset ($k, $v);
-		return $stringToBeSigned;
-	}
+                // 转换成目标字符集
+                $v = $this->characet($v, $this->postCharset);
 
-	protected function sign($data, $signType = "RSA") {
-		if($this->checkEmpty($this->rsaPrivateKeyFilePath)){
-			$priKey=$this->rsaPrivateKey;
-			$res = "-----BEGIN RSA PRIVATE KEY-----\n" .
-				wordwrap($priKey, 64, "\n", true) .
-				"\n-----END RSA PRIVATE KEY-----";
-		}else {
-			$priKey = file_get_contents($this->rsaPrivateKeyFilePath);
-			$res = openssl_get_privatekey($priKey);
-		}
+                if ($i == 0) {
+                    $stringToBeSigned .= "$k" . "=" . "$v";
+                } else {
+                    $stringToBeSigned .= "&" . "$k" . "=" . "$v";
+                }
+                $i++;
+            }
+        }
+
+        unset ($k, $v);
+        return $stringToBeSigned;
+    }
+
+
+    //此方法对value做urlencode
+    public function getSignContentUrlencode($params)
+    {
+        ksort($params);
+
+        $stringToBeSigned = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->checkEmpty($v) && "@" != substr($v, 0, 1)) {
+
+                // 转换成目标字符集
+                $v = $this->characet($v, $this->postCharset);
+
+                if ($i == 0) {
+                    $stringToBeSigned .= "$k" . "=" . urlencode($v);
+                } else {
+                    $stringToBeSigned .= "&" . "$k" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        unset ($k, $v);
+        return $stringToBeSigned;
+    }
+
+    protected function sign($data, $signType = "RSA")
+    {
+        if ($this->checkEmpty($this->rsaPrivateKeyFilePath)) {
+            $priKey = $this->rsaPrivateKey;
+            $res = "-----BEGIN RSA PRIVATE KEY-----\n" .
+                wordwrap($priKey, 64, "\n", true) .
+                "\n-----END RSA PRIVATE KEY-----";
+        } else {
+            $priKey = file_get_contents($this->rsaPrivateKeyFilePath);
+            $res = openssl_get_privatekey($priKey);
+        }
 
-		($res) or die('您使用的私钥格式错误,请检查RSA私钥配置'); 
+        ($res) or die('您使用的私钥格式错误,请检查RSA私钥配置');
 
-		if ("RSA2" == $signType) {
-			openssl_sign($data, $sign, $res, OPENSSL_ALGO_SHA256);
-		} else {
-			openssl_sign($data, $sign, $res);
-		}
+        if ("RSA2" == $signType) {
+            openssl_sign($data, $sign, $res, OPENSSL_ALGO_SHA256);
+        } else {
+            openssl_sign($data, $sign, $res);
+        }
 
-		if(!$this->checkEmpty($this->rsaPrivateKeyFilePath)){
-			openssl_free_key($res);
-		}
-		$sign = base64_encode($sign);
-		return $sign;
-	}
+        if (!$this->checkEmpty($this->rsaPrivateKeyFilePath)) {
+            openssl_free_key($res);
+        }
+        $sign = base64_encode($sign);
+        return $sign;
+    }
+
+    /**
+     * RSA单独签名方法,未做字符串处理,字符串处理见getSignContent()
+     * @param $data 待签名字符串
+     * @param $privatekey 商户私钥,根据keyfromfile来判断是读取字符串还是读取文件,false:填写私钥字符串去回车和空格 true:填写私钥文件路径
+     * @param $signType 签名方式,RSA:SHA1     RSA2:SHA256
+     * @param $keyfromfile 私钥获取方式,读取字符串还是读文件
+     * @return string
+     */
+    public function alonersaSign($data, $privatekey, $signType = "RSA", $keyfromfile = false)
+    {
+
+        if (!$keyfromfile) {
+            $priKey = $privatekey;
+            $res = "-----BEGIN RSA PRIVATE KEY-----\n" .
+                wordwrap($priKey, 64, "\n", true) .
+                "\n-----END RSA PRIVATE KEY-----";
+        } else {
+            $priKey = file_get_contents($privatekey);
+            $res = openssl_get_privatekey($priKey);
+        }
 
+        ($res) or die('您使用的私钥格式错误,请检查RSA私钥配置');
 
-	protected function curl($url, $postFields = null) {
-		$ch = curl_init();
-		curl_setopt($ch, CURLOPT_URL, $url);
-		curl_setopt($ch, CURLOPT_FAILONERROR, false);
-		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+        if ("RSA2" == $signType) {
+            openssl_sign($data, $sign, $res, OPENSSL_ALGO_SHA256);
+        } else {
+            openssl_sign($data, $sign, $res);
+        }
 
-		$postBodyString = "";
-		$encodeArray = Array();
-		$postMultipart = false;
+        if ($keyfromfile) {
+            openssl_free_key($res);
+        }
+        $sign = base64_encode($sign);
+        return $sign;
+    }
+
+
+    protected function curl($url, $postFields = null)
+    {
+        $ch = curl_init();
+        curl_setopt($ch, CURLOPT_URL, $url);
+        curl_setopt($ch, CURLOPT_FAILONERROR, false);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+
+        $postBodyString = "";
+        $encodeArray = Array();
+        $postMultipart = false;
+
+
+        if (is_array($postFields) && 0 < count($postFields)) {
+
+            foreach ($postFields as $k => $v) {
+                if ("@" != substr($v, 0, 1)) //判断是不是文件上传
+                {
+
+                    $postBodyString .= "$k=" . urlencode($this->characet($v, $this->postCharset)) . "&";
+                    $encodeArray[$k] = $this->characet($v, $this->postCharset);
+                } else //文件上传用multipart/form-data,否则用www-form-urlencoded
+                {
+                    $postMultipart = true;
+                    $encodeArray[$k] = new \CURLFile(substr($v, 1));
+                }
+
+            }
+            unset ($k, $v);
+            curl_setopt($ch, CURLOPT_POST, true);
+            if ($postMultipart) {
+                curl_setopt($ch, CURLOPT_POSTFIELDS, $encodeArray);
+            } else {
+                curl_setopt($ch, CURLOPT_POSTFIELDS, substr($postBodyString, 0, -1));
+            }
+        }
 
+        if (!$postMultipart) {
+            $headers = array('content-type: application/x-www-form-urlencoded;charset=' . $this->postCharset);
+            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
+        }
 
-		if (is_array($postFields) && 0 < count($postFields)) {
+        $reponse = curl_exec($ch);
 
-			foreach ($postFields as $k => $v) {
-				if ("@" != substr($v, 0, 1)) //判断是不是文件上传
-				{
+        if (curl_errno($ch)) {
 
-					$postBodyString .= "$k=" . urlencode($this->characet($v, $this->postCharset)) . "&";
-					$encodeArray[$k] = $this->characet($v, $this->postCharset);
-				} else //文件上传用multipart/form-data,否则用www-form-urlencoded
-				{
-					$postMultipart = true;
-					$encodeArray[$k] = new \CURLFile(substr($v, 1));
-				}
+            throw new Exception(curl_error($ch), 0);
+        } else {
+            $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+            if (200 !== $httpStatusCode) {
+                throw new Exception($reponse, $httpStatusCode);
+            }
+        }
 
-			}
-			unset ($k, $v);
-			curl_setopt($ch, CURLOPT_POST, true);
-			if ($postMultipart) {
-				curl_setopt($ch, CURLOPT_POSTFIELDS, $encodeArray);
-			} else {
-				curl_setopt($ch, CURLOPT_POSTFIELDS, substr($postBodyString, 0, -1));
-			}
-		}
-
-		if ($postMultipart) {
-
-			$headers = array('content-type: multipart/form-data;charset=' . $this->postCharset . ';boundary=' . $this->getMillisecond());
-		} else {
-
-			$headers = array('content-type: application/x-www-form-urlencoded;charset=' . $this->postCharset);
-		}
-		curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
-
-
-
-
-		$reponse = curl_exec($ch);
-
-		if (curl_errno($ch)) {
-
-			throw new Exception(curl_error($ch), 0);
-		} else {
-			$httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
-			if (200 !== $httpStatusCode) {
-				throw new Exception($reponse, $httpStatusCode);
-			}
-		}
-
-		curl_close($ch);
-		return $reponse;
-	}
-
-	protected function getMillisecond() {
-		list($s1, $s2) = explode(' ', microtime());
-		return (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000);
-	}
-
-
-	protected function logCommunicationError($apiName, $requestUrl, $errorCode, $responseTxt) {
-		$localIp = isset ($_SERVER["SERVER_ADDR"]) ? $_SERVER["SERVER_ADDR"] : "CLI";
-		$logger = new LtLogger;
-		$logger->conf["log_file"] = rtrim(AOP_SDK_WORK_DIR, '\\/') . '/' . "logs/aop_comm_err_" . $this->appId . "_" . date("Y-m-d") . ".log";
-		$logger->conf["separator"] = "^_^";
-		$logData = array(
-			date("Y-m-d H:i:s"),
-			$apiName,
-			$this->appId,
-			$localIp,
-			PHP_OS,
-			$this->alipaySdkVersion,
-			$requestUrl,
-			$errorCode,
-			str_replace("\n", "", $responseTxt)
-		);
-		$logger->log($logData);
-	}
+        curl_close($ch);
+        return $reponse;
+    }
+
+    protected function getMillisecond()
+    {
+        list($s1, $s2) = explode(' ', microtime());
+        return (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000);
+    }
+
+
+    protected function logCommunicationError($apiName, $requestUrl, $errorCode, $responseTxt)
+    {
+        $logData = array(
+            date("Y-m-d H:i:s"),
+            $apiName,
+            $this->appId,
+            PHP_OS,
+            $this->alipaySdkVersion,
+            $requestUrl,
+            $errorCode,
+            str_replace("\n", "", $responseTxt)
+        );
+
+        echo json_encode($logData);
+    }
 
     /**
      * 生成用于调用收银台SDK的字符串
      * @param $request SDK接口的请求参数对象
-     * @return string 
-     * @author guofa.tgf
+     * @param $appAuthToken 三方应用授权token
+     * @return string
      */
-	public function sdkExecute($request) {
-		
-		$this->setupCharsets($request);
+    public function sdkExecute($request, $appAuthToken = null)
+    {
 
-		$params['app_id'] = $this->appId;
-		$params['method'] = $request->getApiMethodName();
-		$params['format'] = $this->format; 
-		$params['sign_type'] = $this->signType;
-		$params['timestamp'] = date("Y-m-d H:i:s");
-		$params['alipay_sdk'] = $this->alipaySdkVersion;
-		$params['charset'] = $this->postCharset;
+        $this->setupCharsets($request);
 
-		$version = $request->getApiVersion();
-		$params['version'] = $this->checkEmpty($version) ? $this->apiVersion : $version;
+        $params['app_id'] = $this->appId;
+        $params['method'] = $request->getApiMethodName();
+        $params['format'] = $this->format;
+        $params['sign_type'] = $this->signType;
+        $params['timestamp'] = date("Y-m-d H:i:s");
+        $params['alipay_sdk'] = $this->alipaySdkVersion;
+        $params['charset'] = $this->postCharset;
 
-		if ($notify_url = $request->getNotifyUrl()) {
-			$params['notify_url'] = $notify_url;
-		}
+        $version = $request->getApiVersion();
+        $params['version'] = $this->checkEmpty($version) ? $this->apiVersion : $version;
 
-		$dict = $request->getApiParas();
-		$params['biz_content'] = $dict['biz_content'];
+        if ($notify_url = $request->getNotifyUrl()) {
+            $params['notify_url'] = $notify_url;
+        }
 
-		ksort($params);
+        $params['app_auth_token'] = $appAuthToken;
 
-		$params['sign'] = $this->generateSign($params, $this->signType);
+        $dict = $request->getApiParas();
+        $params['biz_content'] = $dict['biz_content'];
 
-		foreach ($params as &$value) {
-			$value = $this->characet($value, $params['charset']);
-		}
-		
-		return http_build_query($params);
-	}
+        ksort($params);
 
-	/*
-		页面提交执行方法
-		@param:跳转类接口的request; $httpmethod 提交方式。两个值可选:post、get
-		@return:构建好的、签名后的最终跳转URL(GET)或String形式的form(POST)
-		auther:笙默
-	*/
-	public function pageExecute($request,$httpmethod = "POST") {
+        $params['sign'] = $this->generateSign($params, $this->signType);
 
-		$this->setupCharsets($request);
+        foreach ($params as &$value) {
+            $value = $this->characet($value, $params['charset']);
+        }
 
-		if (strcasecmp($this->fileCharset, $this->postCharset)) {
+        return http_build_query($params);
+    }
 
-			// writeLog("本地文件字符集编码与表单提交编码不一致,请务必设置成一样,属性名分别为postCharset!");
-			throw new Exception("文件编码:[" . $this->fileCharset . "] 与表单提交编码:[" . $this->postCharset . "]两者不一致!");
-		}
+    /**
+     * 页面提交执行方法
+     * @param $request 跳转类接口的request
+     * @param string $httpmethod 提交方式,两个值可选:post、get;
+     * @param null $appAuthToken 三方应用授权token
+     * @return 构建好的、签名后的最终跳转URL(GET)或String形式的form(POST)
+     * @throws Exception
+     */
+    public function pageExecute($request, $httpmethod = "POST", $appAuthToken = null)
+    {
 
-		$iv=null;
+        $this->setupCharsets($request);
 
-		if(!$this->checkEmpty($request->getApiVersion())){
-			$iv=$request->getApiVersion();
-		}else{
-			$iv=$this->apiVersion;
-		}
+        if (strcasecmp($this->fileCharset, $this->postCharset)) {
 
-		//组装系统参数
-		$sysParams["app_id"] = $this->appId;
-		$sysParams["version"] = $iv;
-		$sysParams["format"] = $this->format;
-		$sysParams["sign_type"] = $this->signType;
-		$sysParams["method"] = $request->getApiMethodName();
-		$sysParams["timestamp"] = date("Y-m-d H:i:s");
-		$sysParams["alipay_sdk"] = $this->alipaySdkVersion;
-		$sysParams["terminal_type"] = $request->getTerminalType();
-		$sysParams["terminal_info"] = $request->getTerminalInfo();
-		$sysParams["prod_code"] = $request->getProdCode();
-		$sysParams["notify_url"] = $request->getNotifyUrl();
-		$sysParams["return_url"] = $request->getReturnUrl();
-		$sysParams["charset"] = $this->postCharset;
+            // writeLog("本地文件字符集编码与表单提交编码不一致,请务必设置成一样,属性名分别为postCharset!");
+            throw new Exception("文件编码:[" . $this->fileCharset . "] 与表单提交编码:[" . $this->postCharset . "]两者不一致!");
+        }
 
-		//获取业务参数
-		$apiParams = $request->getApiParas();
+        $iv = null;
 
-		if (method_exists($request,"getNeedEncrypt") &&$request->getNeedEncrypt()){
+        if (!$this->checkEmpty($request->getApiVersion())) {
+            $iv = $request->getApiVersion();
+        } else {
+            $iv = $this->apiVersion;
+        }
 
-			$sysParams["encrypt_type"] = $this->encryptType;
+        //组装系统参数
+        $sysParams["app_id"] = $this->appId;
+        $sysParams["version"] = $iv;
+        $sysParams["format"] = $this->format;
+        $sysParams["sign_type"] = $this->signType;
+        $sysParams["method"] = $request->getApiMethodName();
+        $sysParams["timestamp"] = date("Y-m-d H:i:s");
+        $sysParams["alipay_sdk"] = $this->alipaySdkVersion;
+        $sysParams["terminal_type"] = $request->getTerminalType();
+        $sysParams["terminal_info"] = $request->getTerminalInfo();
+        $sysParams["prod_code"] = $request->getProdCode();
+        $sysParams["notify_url"] = $request->getNotifyUrl();
+        $sysParams["return_url"] = $request->getReturnUrl();
+        $sysParams["charset"] = $this->postCharset;
+        $sysParams["app_auth_token"] = $appAuthToken;
 
-			if ($this->checkEmpty($apiParams['biz_content'])) {
+        //获取业务参数
+        $apiParams = $request->getApiParas();
 
-				throw new Exception(" api request Fail! The reason : encrypt request is not supperted!");
-			}
+        if (method_exists($request, "getNeedEncrypt") && $request->getNeedEncrypt()) {
 
-			if ($this->checkEmpty($this->encryptKey) || $this->checkEmpty($this->encryptType)) {
+            $sysParams["encrypt_type"] = $this->encryptType;
 
-				throw new Exception(" encryptType and encryptKey must not null! ");
-			}
+            if ($this->checkEmpty($apiParams['biz_content'])) {
 
-			if ("AES" != $this->encryptType) {
+                throw new Exception(" api request Fail! The reason : encrypt request is not supperted!");
+            }
 
-				throw new Exception("加密类型只支持AES");
-			}
+            if ($this->checkEmpty($this->encryptKey) || $this->checkEmpty($this->encryptType)) {
 
-			// 执行加密
-			$enCryptContent = encrypt($apiParams['biz_content'], $this->encryptKey);
-			$apiParams['biz_content'] = $enCryptContent;
+                throw new Exception(" encryptType and encryptKey must not null! ");
+            }
 
-		}
+            if ("AES" != $this->encryptType) {
 
-		//print_r($apiParams);
-		$totalParams = array_merge($apiParams, $sysParams);
-		
-		//待签名字符串
-		$preSignStr = $this->getSignContent($totalParams);
+                throw new Exception("加密类型只支持AES");
+            }
 
-		//签名
-		$totalParams["sign"] = $this->generateSign($totalParams, $this->signType);
+            // 执行加密
+            $enCryptContent = encrypt($apiParams['biz_content'], $this->encryptKey);
+            $apiParams['biz_content'] = $enCryptContent;
 
-		if ("GET" == $httpmethod) {
+        }
 
-			//拼接GET请求串
-			$requestUrl = $this->gatewayUrl."?".$preSignStr."&sign=".urlencode($totalParams["sign"]);
-			
-			return $requestUrl;
-		} else {
-			//拼接表单字符串
-			return $this->buildRequestForm($totalParams);
-		}
+        //print_r($apiParams);
+        $totalParams = array_merge($apiParams, $sysParams);
 
+        //待签名字符串
+        $preSignStr = $this->getSignContent($totalParams);
 
-	}
+        //签名
+        $totalParams["sign"] = $this->generateSign($totalParams, $this->signType);
 
-	/**
+        if ("GET" == strtoupper($httpmethod)) {
+
+            //value做urlencode
+            $preString = $this->getSignContentUrlencode($totalParams);
+            //拼接GET请求串
+            $requestUrl = $this->gatewayUrl . "?" . $preString;
+
+            return $requestUrl;
+        } else {
+            //拼接表单字符串
+            return $this->buildRequestForm($totalParams);
+        }
+
+
+    }
+
+
+    /**
      * 建立请求,以表单HTML形式构造(默认)
      * @param $para_temp 请求参数数组
      * @return 提交表单HTML文本
      */
-	protected function buildRequestForm($para_temp) {
-		
-		$sHtml = "<form id='alipaysubmit' name='alipaysubmit' action='".$this->gatewayUrl."?charset=".trim($this->postCharset)."' method='POST'>";
-		while (list ($key, $val) = each ($para_temp)) {
-			if (false === $this->checkEmpty($val)) {
-				//$val = $this->characet($val, $this->postCharset);
-				$val = str_replace("'","&apos;",$val);
-				//$val = str_replace("\"","&quot;",$val);
-				$sHtml.= "<input type='hidden' name='".$key."' value='".$val."'/>";
-			}
+    protected function buildRequestForm($para_temp)
+    {
+
+        $sHtml = "<form id='alipaysubmit' name='alipaysubmit' action='" . $this->gatewayUrl . "?charset=" . trim($this->postCharset) . "' method='POST'>";
+        while (list ($key, $val) = $this->fun_adm_each($para_temp)) {
+            if (false === $this->checkEmpty($val)) {
+                //$val = $this->characet($val, $this->postCharset);
+                $val = str_replace("'", "&apos;", $val);
+                //$val = str_replace("\"","&quot;",$val);
+                $sHtml .= "<input type='hidden' name='" . $key . "' value='" . $val . "'/>";
+            }
         }
 
-		//submit按钮控件请不要含有name属性
-        $sHtml = $sHtml."<input type='submit' value='ok' style='display:none;''></form>";
-		
-		$sHtml = $sHtml."<script>document.forms['alipaysubmit'].submit();</script>";
-		
-		return $sHtml;
-	}
+        //submit按钮控件请不要含有name属性
+        $sHtml = $sHtml . "<input type='submit' value='ok' style='display:none;''></form>";
 
+        $sHtml = $sHtml . "<script>document.forms['alipaysubmit'].submit();</script>";
 
-	public function execute($request, $authToken = null, $appInfoAuthtoken = null) {
+        return $sHtml;
+    }
 
-		$this->setupCharsets($request);
+    protected function fun_adm_each(&$array)
+    {
+        $res = array();
+        $key = key($array);
+        if ($key !== null) {
+            next($array);
+            $res[1] = $res['value'] = $array[$key];
+            $res[0] = $res['key'] = $key;
+        } else {
+            $res = false;
+        }
+        return $res;
+    }
 
-		//		//  如果两者编码不一致,会出现签名验签或者乱码
-		if (strcasecmp($this->fileCharset, $this->postCharset)) {
 
-			// writeLog("本地文件字符集编码与表单提交编码不一致,请务必设置成一样,属性名分别为postCharset!");
-			throw new Exception("文件编码:[" . $this->fileCharset . "] 与表单提交编码:[" . $this->postCharset . "]两者不一致!");
-		}
+    public function execute($request, $authToken = null, $appInfoAuthtoken = null, $targetAppId = null)
+    {
 
-		$iv = null;
+        $this->setupCharsets($request);
 
-		if (!$this->checkEmpty($request->getApiVersion())) {
-			$iv = $request->getApiVersion();
-		} else {
-			$iv = $this->apiVersion;
-		}
+        //如果两者编码不一致,会出现签名验签或者乱码
+        if (strcasecmp($this->fileCharset, $this->postCharset)) {
 
+            // writeLog("本地文件字符集编码与表单提交编码不一致,请务必设置成一样,属性名分别为postCharset!");
+            throw new Exception("文件编码:[" . $this->fileCharset . "] 与表单提交编码:[" . $this->postCharset . "]两者不一致!");
+        }
 
-		//组装系统参数
-		$sysParams["app_id"] = $this->appId;
-		$sysParams["version"] = $iv;
-		$sysParams["format"] = $this->format;
-		$sysParams["sign_type"] = $this->signType;
-		$sysParams["method"] = $request->getApiMethodName();
-		$sysParams["timestamp"] = date("Y-m-d H:i:s");
-		$sysParams["auth_token"] = $authToken;
-		$sysParams["alipay_sdk"] = $this->alipaySdkVersion;
-		$sysParams["terminal_type"] = $request->getTerminalType();
-		$sysParams["terminal_info"] = $request->getTerminalInfo();
-		$sysParams["prod_code"] = $request->getProdCode();
-		$sysParams["notify_url"] = $request->getNotifyUrl();
-		$sysParams["charset"] = $this->postCharset;
-		$sysParams["app_auth_token"] = $appInfoAuthtoken;
+        $iv = null;
 
+        if (!$this->checkEmpty($request->getApiVersion())) {
+            $iv = $request->getApiVersion();
+        } else {
+            $iv = $this->apiVersion;
+        }
 
-		//获取业务参数
-		$apiParams = $request->getApiParas();
 
-			if (method_exists($request,"getNeedEncrypt") &&$request->getNeedEncrypt()){
+        //组装系统参数
+        $sysParams["app_id"] = $this->appId;
+        $sysParams["version"] = $iv;
+        $sysParams["format"] = $this->format;
+        $sysParams["sign_type"] = $this->signType;
+        $sysParams["method"] = $request->getApiMethodName();
+        $sysParams["timestamp"] = date("Y-m-d H:i:s");
+        $sysParams["auth_token"] = $authToken;
+        $sysParams["alipay_sdk"] = $this->alipaySdkVersion;
+        $sysParams["terminal_type"] = $request->getTerminalType();
+        $sysParams["terminal_info"] = $request->getTerminalInfo();
+        $sysParams["prod_code"] = $request->getProdCode();
+        $sysParams["notify_url"] = $request->getNotifyUrl();
+        $sysParams["charset"] = $this->postCharset;
+        $sysParams["app_auth_token"] = $appInfoAuthtoken;
+        $sysParams["target_app_id"] = $targetAppId;
+        if (!$this->checkEmpty($this->targetServiceUrl)) {
+            $sysParams["ws_service_url"] = $this->targetServiceUrl;
+        }
 
-			$sysParams["encrypt_type"] = $this->encryptType;
 
-			if ($this->checkEmpty($apiParams['biz_content'])) {
+        //获取业务参数
+        $apiParams = $request->getApiParas();
 
-				throw new Exception(" api request Fail! The reason : encrypt request is not supperted!");
-			}
+        if (method_exists($request, "getNeedEncrypt") && $request->getNeedEncrypt()) {
 
-			if ($this->checkEmpty($this->encryptKey) || $this->checkEmpty($this->encryptType)) {
+            $sysParams["encrypt_type"] = $this->encryptType;
 
-				throw new Exception(" encryptType and encryptKey must not null! ");
-			}
+            if ($this->checkEmpty($apiParams['biz_content'])) {
 
-			if ("AES" != $this->encryptType) {
+                throw new Exception(" api request Fail! The reason : encrypt request is not supperted!");
+            }
 
-				throw new Exception("加密类型只支持AES");
-			}
+            if ($this->checkEmpty($this->encryptKey) || $this->checkEmpty($this->encryptType)) {
 
-			// 执行加密
-			$enCryptContent = encrypt($apiParams['biz_content'], $this->encryptKey);
-			$apiParams['biz_content'] = $enCryptContent;
+                throw new Exception(" encryptType and encryptKey must not null! ");
+            }
 
-		}
+            if ("AES" != $this->encryptType) {
 
+                throw new Exception("加密类型只支持AES");
+            }
 
-		//签名
-		$sysParams["sign"] = $this->generateSign(array_merge($apiParams, $sysParams), $this->signType);
+            // 执行加密
+            $enCryptContent = encrypt($apiParams['biz_content'], $this->encryptKey);
+            $apiParams['biz_content'] = $enCryptContent;
 
+        }
 
-		//系统参数放入GET请求串
-		$requestUrl = $this->gatewayUrl . "?";
-		foreach ($sysParams as $sysParamKey => $sysParamValue) {
-			$requestUrl .= "$sysParamKey=" . urlencode($this->characet($sysParamValue, $this->postCharset)) . "&";
-		}
-		$requestUrl = substr($requestUrl, 0, -1);
 
+        //签名
+        $sysParams["sign"] = $this->generateSign(array_merge($apiParams, $sysParams), $this->signType);
 
-		//发起HTTP请求
-		try {
-			$resp = $this->curl($requestUrl, $apiParams);
-		} catch (Exception $e) {
 
-			$this->logCommunicationError($sysParams["method"], $requestUrl, "HTTP_ERROR_" . $e->getCode(), $e->getMessage());
-			return false;
-		}
+        //系统参数放入GET请求串
+        $requestUrl = $this->gatewayUrl . "?";
+        foreach ($sysParams as $sysParamKey => $sysParamValue) {
+            $requestUrl .= "$sysParamKey=" . urlencode($this->characet($sysParamValue, $this->postCharset)) . "&";
+        }
+        $requestUrl = substr($requestUrl, 0, -1);
 
-		//解析AOP返回结果
-		$respWellFormed = false;
 
+        //发起HTTP请求
+        try {
+            $resp = $this->curl($requestUrl, $apiParams);
+        } catch (Exception $e) {
 
-		// 将返回结果转换本地文件编码
-		$r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp);
+            $this->logCommunicationError($sysParams["method"], $requestUrl, "HTTP_ERROR_" . $e->getCode(), $e->getMessage());
+            return false;
+        }
 
+        //解析AOP返回结果
+        $respWellFormed = false;
 
 
-		$signData = null;
+        // 将返回结果转换本地文件编码
+        $r = @iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp);
 
-		if ("json" == $this->format) {
 
-			$respObject = json_decode($r);
-			if (null !== $respObject) {
-				$respWellFormed = true;
-				$signData = $this->parserJSONSignData($request, $resp, $respObject);
-			}
-		} else if ("xml" == $this->format) {
+        $signData = null;
 
-			$respObject = @ simplexml_load_string($resp);
-			if (false !== $respObject) {
-				$respWellFormed = true;
+        if ("json" == $this->format) {
 
-				$signData = $this->parserXMLSignData($request, $resp);
-			}
-		}
+            $respObject = json_decode($r);
+            if (null !== $respObject) {
+                $respWellFormed = true;
+                $signData = $this->parserJSONSignData($request, $resp, $respObject);
+            }
+        } else if ("xml" == $this->format) {
+            $disableLibxmlEntityLoader = libxml_disable_entity_loader(true);
+            $respObject = @ simplexml_load_string($resp);
+            if (false !== $respObject) {
+                $respWellFormed = true;
 
+                $signData = $this->parserXMLSignData($request, $resp);
+            }
+            libxml_disable_entity_loader($disableLibxmlEntityLoader);
+        }
 
-		//返回的HTTP文本不是标准JSON或者XML,记下错误日志
-		if (false === $respWellFormed) {
-			$this->logCommunicationError($sysParams["method"], $requestUrl, "HTTP_RESPONSE_NOT_WELL_FORMED", $resp);
-			return false;
-		}
 
-		// 验签
-		$this->checkResponseSign($request, $signData, $resp, $respObject);
+        //返回的HTTP文本不是标准JSON或者XML,记下错误日志
+        if (false === $respWellFormed) {
+            $this->logCommunicationError($sysParams["method"], $requestUrl, "HTTP_RESPONSE_NOT_WELL_FORMED", $resp);
+            return false;
+        }
 
-		// 解密
-		if (method_exists($request,"getNeedEncrypt") &&$request->getNeedEncrypt()){
+        // 验签
+        $this->checkResponseSign($request, $signData, $resp, $respObject);
 
-			if ("json" == $this->format) {
+        // 解密
+        if (method_exists($request, "getNeedEncrypt") && $request->getNeedEncrypt()) {
 
+            if ("json" == $this->format) {
 
-				$resp = $this->encryptJSONSignSource($request, $resp);
 
-				// 将返回结果转换本地文件编码
-				$r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp);
-				$respObject = json_decode($r);
-			}else{
+                $resp = $this->encryptJSONSignSource($request, $resp);
 
-				$resp = $this->encryptXMLSignSource($request, $resp);
+                // 将返回结果转换本地文件编码
+                $r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp);
+                $respObject = json_decode($r);
+            } else {
 
-				$r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp);
-				$respObject = @ simplexml_load_string($r);
+                $resp = $this->encryptXMLSignSource($request, $resp);
 
-			}
-		}
+                $r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp);
+                $disableLibxmlEntityLoader = libxml_disable_entity_loader(true);
+                $respObject = @ simplexml_load_string($r);
+                libxml_disable_entity_loader($disableLibxmlEntityLoader);
 
-		return $respObject;
-	}
+            }
+        }
 
-	/**
-	 * 转换字符集编码
-	 * @param $data
-	 * @param $targetCharset
-	 * @return string
-	 */
-	function characet($data, $targetCharset) {
-		
-		if (!empty($data)) {
-			$fileType = $this->fileCharset;
-			if (strcasecmp($fileType, $targetCharset) != 0) {
-				$data = mb_convert_encoding($data, $targetCharset, $fileType);
-				//				$data = iconv($fileType, $targetCharset.'//IGNORE', $data);
-			}
-		}
-
-
-		return $data;
-	}
-
-	public function exec($paramsArray) {
-		if (!isset ($paramsArray["method"])) {
-			trigger_error("No api name passed");
-		}
-		$inflector = new LtInflector;
-		$inflector->conf["separator"] = ".";
-		$requestClassName = ucfirst($inflector->camelize(substr($paramsArray["method"], 7))) . "Request";
-		if (!class_exists($requestClassName)) {
-			trigger_error("No such api: " . $paramsArray["method"]);
-		}
-
-		$session = isset ($paramsArray["session"]) ? $paramsArray["session"] : null;
-
-		$req = new $requestClassName;
-		foreach ($paramsArray as $paraKey => $paraValue) {
-			$inflector->conf["separator"] = "_";
-			$setterMethodName = $inflector->camelize($paraKey);
-			$inflector->conf["separator"] = ".";
-			$setterMethodName = "set" . $inflector->camelize($setterMethodName);
-			if (method_exists($req, $setterMethodName)) {
-				$req->$setterMethodName ($paraValue);
-			}
-		}
-		return $this->execute($req, $session);
-	}
-
-	/**
-	 * 校验$value是否非空
-	 *  if not set ,return true;
-	 *    if is null , return true;
-	 **/
-	protected function checkEmpty($value) {
-		if (!isset($value))
-			return true;
-		if ($value === null)
-			return true;
-		if (trim($value) === "")
-			return true;
-
-		return false;
-	}
-
-	/** rsaCheckV1 & rsaCheckV2
-	 *  验证签名
-	 *  在使用本方法前,必须初始化AopClient且传入公钥参数。
-	 *  公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
-	 **/
-	public function rsaCheckV1($params, $rsaPublicKeyFilePath,$signType='RSA') {
-		$sign = $params['sign'];
-		$params['sign_type'] = null;
-		$params['sign'] = null;
-		return $this->verify($this->getSignContent($params), $sign, $rsaPublicKeyFilePath,$signType);
-	}
-	public function rsaCheckV2($params, $rsaPublicKeyFilePath, $signType='RSA') {
-		$sign = $params['sign'];
-		$params['sign'] = null;
-		return $this->verify($this->getSignContent($params), $sign, $rsaPublicKeyFilePath, $signType);
-	}
-
-	function verify($data, $sign, $rsaPublicKeyFilePath, $signType = 'RSA') {
-
-		if($this->checkEmpty($this->alipayPublicKey)){
-
-			$pubKey= $this->alipayrsaPublicKey;
-			$res = "-----BEGIN PUBLIC KEY-----\n" .
-				wordwrap($pubKey, 64, "\n", true) .
-				"\n-----END PUBLIC KEY-----";
-		}else {
-			//读取公钥文件
-			$pubKey = file_get_contents($rsaPublicKeyFilePath);
-			//转换为openssl格式密钥
-			$res = openssl_get_publickey($pubKey);
-		}
-
-		($res) or die('支付宝RSA公钥错误。请检查公钥文件格式是否正确');  
-
-		//调用openssl内置方法验签,返回bool值
-
-		if ("RSA2" == $signType) {
-			$result = (bool)openssl_verify($data, base64_decode($sign), $res, OPENSSL_ALGO_SHA256);
-		} else {
-			$result = (bool)openssl_verify($data, base64_decode($sign), $res);
-		}
-
-		if(!$this->checkEmpty($this->alipayPublicKey)) {
-			//释放资源
-			openssl_free_key($res);
-		}
-
-		return $result;
-	}
-
-	public function checkSignAndDecrypt($params, $rsaPublicKeyPem, $rsaPrivateKeyPem, $isCheckSign, $isDecrypt) {
-		$charset = $params['charset'];
-		$bizContent = $params['biz_content'];
-		if ($isCheckSign) {
-			if (!$this->rsaCheckV2($params, $rsaPublicKeyPem)) {
-				echo "<br/>checkSign failure<br/>";
-				exit;
-			}
-		}
-		if ($isDecrypt) {
-			return $this->rsaDecrypt($bizContent, $rsaPrivateKeyPem, $charset);
-		}
-
-		return $bizContent;
-	}
-
-	public function encryptAndSign($bizContent, $rsaPublicKeyPem, $rsaPrivateKeyPem, $charset, $isEncrypt, $isSign) {
-		// 加密,并签名
-		if ($isEncrypt && $isSign) {
-			$encrypted = $this->rsaEncrypt($bizContent, $rsaPublicKeyPem, $charset);
-			$sign = $this->sign($bizContent);
-			$response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$encrypted</response><encryption_type>RSA</encryption_type><sign>$sign</sign><sign_type>RSA</sign_type></alipay>";
-			return $response;
-		}
-		// 加密,不签名
-		if ($isEncrypt && (!$isSign)) {
-			$encrypted = $this->rsaEncrypt($bizContent, $rsaPublicKeyPem, $charset);
-			$response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$encrypted</response><encryption_type>RSA</encryption_type></alipay>";
-			return $response;
-		}
-		// 不加密,但签名
-		if ((!$isEncrypt) && $isSign) {
-			$sign = $this->sign($bizContent);
-			$response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$bizContent</response><sign>$sign</sign><sign_type>RSA</sign_type></alipay>";
-			return $response;
-		}
-		// 不加密,不签名
-		$response = "<?xml version=\"1.0\" encoding=\"$charset\"?>$bizContent";
-		return $response;
-	}
-
-	public function rsaEncrypt($data, $rsaPublicKeyPem, $charset) {
-		//读取公钥文件
-		$pubKey = file_get_contents($rsaPublicKeyPem);
-		//转换为openssl格式密钥
-		$res = openssl_get_publickey($pubKey);
-		$blocks = $this->splitCN($data, 0, 30, $charset);
-		$chrtext  = null;
-		$encodes  = array();
-		foreach ($blocks as $n => $block) {
-			if (!openssl_public_encrypt($block, $chrtext , $res)) {
-				echo "<br/>" . openssl_error_string() . "<br/>";
-			}
-			$encodes[] = $chrtext ;
-		}
-		$chrtext = implode(",", $encodes);
-
-		return $chrtext;
-	}
-
-	public function rsaDecrypt($data, $rsaPrivateKeyPem, $charset) {
-		//读取私钥文件
-		$priKey = file_get_contents($rsaPrivateKeyPem);
-		//转换为openssl格式密钥
-		$res = openssl_get_privatekey($priKey);
-		$decodes = explode(',', $data);
-		$strnull = "";
-		$dcyCont = "";
-		foreach ($decodes as $n => $decode) {
-			if (!openssl_private_decrypt($decode, $dcyCont, $res)) {
-				echo "<br/>" . openssl_error_string() . "<br/>";
-			}
-			$strnull .= $dcyCont;
-		}
-		return $strnull;
-	}
-
-	function splitCN($cont, $n = 0, $subnum, $charset) {
-		//$len = strlen($cont) / 3;
-		$arrr = array();
-		for ($i = $n; $i < strlen($cont); $i += $subnum) {
-			$res = $this->subCNchar($cont, $i, $subnum, $charset);
-			if (!empty ($res)) {
-				$arrr[] = $res;
-			}
-		}
-
-		return $arrr;
-	}
-
-	function subCNchar($str, $start = 0, $length, $charset = "gbk") {
-		if (strlen($str) <= $length) {
-			return $str;
-		}
-		$re['utf-8'] = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xff][\x80-\xbf]{3}/";
-		$re['gb2312'] = "/[\x01-\x7f]|[\xb0-\xf7][\xa0-\xfe]/";
-		$re['gbk'] = "/[\x01-\x7f]|[\x81-\xfe][\x40-\xfe]/";
-		$re['big5'] = "/[\x01-\x7f]|[\x81-\xfe]([\x40-\x7e]|\xa1-\xfe])/";
-		preg_match_all($re[$charset], $str, $match);
-		$slice = join("", array_slice($match[0], $start, $length));
-		return $slice;
-	}
-
-	function parserResponseSubCode($request, $responseContent, $respObject, $format) {
-
-		if ("json" == $format) {
+        return $respObject;
+    }
 
-			$apiName = $request->getApiMethodName();
-			$rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
-			$errorNodeName = $this->ERROR_RESPONSE;
+    /**
+     * 转换字符集编码
+     * @param $data
+     * @param $targetCharset
+     * @return string
+     */
+    function characet($data, $targetCharset)
+    {
+
+        if (!empty($data)) {
+            $fileType = $this->fileCharset;
+            if (strcasecmp($fileType, $targetCharset) != 0) {
+                $data = mb_convert_encoding($data, $targetCharset, $fileType);
+                //				$data = iconv($fileType, $targetCharset.'//IGNORE', $data);
+            }
+        }
 
-			$rootIndex = strpos($responseContent, $rootNodeName);
-			$errorIndex = strpos($responseContent, $errorNodeName);
 
-			if ($rootIndex > 0) {
-				// 内部节点对象
-				$rInnerObject = $respObject->$rootNodeName;
-			} elseif ($errorIndex > 0) {
+        return $data;
+    }
 
-				$rInnerObject = $respObject->$errorNodeName;
-			} else {
-				return null;
-			}
+    public function exec($paramsArray)
+    {
+        if (!isset ($paramsArray["method"])) {
+            trigger_error("No api name passed");
+        }
+        $inflector = new LtInflector;
+        $inflector->conf["separator"] = ".";
+        $requestClassName = ucfirst($inflector->camelize(substr($paramsArray["method"], 7))) . "Request";
+        if (!class_exists($requestClassName)) {
+            trigger_error("No such api: " . $paramsArray["method"]);
+        }
 
-			// 存在属性则返回对应值
-			if (isset($rInnerObject->sub_code)) {
+        $session = isset ($paramsArray["session"]) ? $paramsArray["session"] : null;
+
+        $req = new $requestClassName;
+        foreach ($paramsArray as $paraKey => $paraValue) {
+            $inflector->conf["separator"] = "_";
+            $setterMethodName = $inflector->camelize($paraKey);
+            $inflector->conf["separator"] = ".";
+            $setterMethodName = "set" . $inflector->camelize($setterMethodName);
+            if (method_exists($req, $setterMethodName)) {
+                $req->$setterMethodName ($paraValue);
+            }
+        }
+        return $this->execute($req, $session);
+    }
 
-				return $rInnerObject->sub_code;
-			} else {
+    /**
+     * 校验$value是否非空
+     *  if not set ,return true;
+     *    if is null , return true;
+     **/
+    protected function checkEmpty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    /** rsaCheckV1 & rsaCheckV2
+     *  验证签名
+     *  在使用本方法前,必须初始化AopClient且传入公钥参数。
+     *  公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
+     **/
+    public function rsaCheckV1($params, $rsaPublicKeyFilePath, $signType = 'RSA')
+    {
+        $sign = $params['sign'];
+        $params['sign_type'] = null;
+        $params['sign'] = null;
+        return $this->verify($this->getSignContent($params), $sign, $rsaPublicKeyFilePath, $signType);
+    }
+
+    public function rsaCheckV2($params, $rsaPublicKeyFilePath, $signType = 'RSA')
+    {
+        $sign = $params['sign'];
+        $params['sign'] = null;
+        return $this->verify($this->getSignContent($params), $sign, $rsaPublicKeyFilePath, $signType);
+    }
+
+    function verify($data, $sign, $rsaPublicKeyFilePath, $signType = 'RSA')
+    {
+
+        if ($this->checkEmpty($this->alipayPublicKey)) {
+
+            $pubKey = $this->alipayrsaPublicKey;
+            $res = "-----BEGIN PUBLIC KEY-----\n" .
+                wordwrap($pubKey, 64, "\n", true) .
+                "\n-----END PUBLIC KEY-----";
+        } else {
+            //读取公钥文件
+            $pubKey = file_get_contents($rsaPublicKeyFilePath);
+            //转换为openssl格式密钥
+            $res = openssl_get_publickey($pubKey);
+        }
 
-				return null;
-			}
+        ($res) or die('支付宝RSA公钥错误。请检查公钥文件格式是否正确');
 
+        //调用openssl内置方法验签,返回bool值
 
-		} elseif ("xml" == $format) {
+        $result = FALSE;
+        if ("RSA2" == $signType) {
+            $result = (openssl_verify($data, base64_decode($sign), $res, OPENSSL_ALGO_SHA256) === 1);
+        } else {
+            $result = (openssl_verify($data, base64_decode($sign), $res) === 1);
+        }
 
-			// xml格式sub_code在同一层级
-			return $respObject->sub_code;
+        if (!$this->checkEmpty($this->alipayPublicKey)) {
+            //释放资源
+            openssl_free_key($res);
+        }
+
+        return $result;
+    }
+
+    /**
+     *  在使用本方法前,必须初始化AopClient且传入公私钥参数。
+     *  公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
+     **/
+    public function checkSignAndDecrypt($params, $rsaPublicKeyPem, $rsaPrivateKeyPem, $isCheckSign, $isDecrypt, $signType = 'RSA')
+    {
+        $charset = $params['charset'];
+        $bizContent = $params['biz_content'];
+        if ($isCheckSign) {
+            if (!$this->rsaCheckV2($params, $rsaPublicKeyPem, $signType)) {
+                echo "<br/>checkSign failure<br/>";
+                exit;
+            }
+        }
+        if ($isDecrypt) {
+            return $this->rsaDecrypt($bizContent, $rsaPrivateKeyPem, $charset);
+        }
+
+        return $bizContent;
+    }
+
+    /**
+     *  在使用本方法前,必须初始化AopClient且传入公私钥参数。
+     *  公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
+     **/
+    public function encryptAndSign($bizContent, $rsaPublicKeyPem, $rsaPrivateKeyPem, $charset, $isEncrypt, $isSign, $signType = 'RSA')
+    {
+        // 加密,并签名
+        if ($isEncrypt && $isSign) {
+            $encrypted = $this->rsaEncrypt($bizContent, $rsaPublicKeyPem, $charset);
+            $sign = $this->sign($encrypted, $signType);
+            $response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$encrypted</response><encryption_type>RSA</encryption_type><sign>$sign</sign><sign_type>$signType</sign_type></alipay>";
+            return $response;
+        }
+        // 加密,不签名
+        if ($isEncrypt && (!$isSign)) {
+            $encrypted = $this->rsaEncrypt($bizContent, $rsaPublicKeyPem, $charset);
+            $response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$encrypted</response><encryption_type>$signType</encryption_type></alipay>";
+            return $response;
+        }
+        // 不加密,但签名
+        if ((!$isEncrypt) && $isSign) {
+            $sign = $this->sign($bizContent, $signType);
+            $response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$bizContent</response><sign>$sign</sign><sign_type>$signType</sign_type></alipay>";
+            return $response;
+        }
+        // 不加密,不签名
+        $response = "<?xml version=\"1.0\" encoding=\"$charset\"?>$bizContent";
+        return $response;
+    }
+
+    /**
+     *  在使用本方法前,必须初始化AopClient且传入公私钥参数。
+     *  公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
+     **/
+    public function rsaEncrypt($data, $rsaPublicKeyFilePath, $charset)
+    {
+        if ($this->checkEmpty($this->alipayPublicKey)) {
+            //读取字符串
+            $pubKey = $this->alipayrsaPublicKey;
+            $res = "-----BEGIN PUBLIC KEY-----\n" .
+                wordwrap($pubKey, 64, "\n", true) .
+                "\n-----END PUBLIC KEY-----";
+        } else {
+            //读取公钥文件
+            $pubKey = file_get_contents($rsaPublicKeyFilePath);
+            //转换为openssl格式密钥
+            $res = openssl_get_publickey($pubKey);
+        }
+
+        ($res) or die('支付宝RSA公钥错误。请检查公钥文件格式是否正确');
+        $blocks = $this->splitCN($data, 0, 30, $charset);
+        $chrtext  = null;
+        $encodes  = array();
+        foreach ($blocks as $n => $block) {
+            if (!openssl_public_encrypt($block, $chrtext , $res)) {
+                echo "<br/>" . openssl_error_string() . "<br/>";
+            }
+            $encodes[] = $chrtext ;
+        }
+        $chrtext = implode(",", $encodes);
+
+        return base64_encode($chrtext);
+    }
+
+    /**
+     *  在使用本方法前,必须初始化AopClient且传入公私钥参数。
+     *  公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
+     **/
+    public function rsaDecrypt($data, $rsaPrivateKeyPem, $charset)
+    {
+
+        if ($this->checkEmpty($this->rsaPrivateKeyFilePath)) {
+            //读字符串
+            $priKey = $this->rsaPrivateKey;
+            $res = "-----BEGIN RSA PRIVATE KEY-----\n" .
+                wordwrap($priKey, 64, "\n", true) .
+                "\n-----END RSA PRIVATE KEY-----";
+        } else {
+            $priKey = file_get_contents($this->rsaPrivateKeyFilePath);
+            $res = openssl_get_privatekey($priKey);
+        }
+        ($res) or die('您使用的私钥格式错误,请检查RSA私钥配置');
+        //转换为openssl格式密钥
+        $decodes = explode(',', $data);
+        $strnull = "";
+        $dcyCont = "";
+        foreach ($decodes as $n => $decode) {
+            if (!openssl_private_decrypt($decode, $dcyCont, $res)) {
+                echo "<br/>" . openssl_error_string() . "<br/>";
+            }
+            $strnull .= $dcyCont;
+        }
+        return $strnull;
+    }
+
+    function splitCN($cont, $n = 0, $subnum, $charset)
+    {
+        //$len = strlen($cont) / 3;
+        $arrr = array();
+        for ($i = $n; $i < strlen($cont); $i += $subnum) {
+            $res = $this->subCNchar($cont, $i, $subnum, $charset);
+            if (!empty ($res)) {
+                $arrr[] = $res;
+            }
+        }
+
+        return $arrr;
+    }
+
+    function subCNchar($str, $start = 0, $length, $charset = "gbk")
+    {
+        if (strlen($str) <= $length) {
+            return $str;
+        }
+        $re['utf-8'] = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xff][\x80-\xbf]{3}/";
+        $re['gb2312'] = "/[\x01-\x7f]|[\xb0-\xf7][\xa0-\xfe]/";
+        $re['gbk'] = "/[\x01-\x7f]|[\x81-\xfe][\x40-\xfe]/";
+        $re['big5'] = "/[\x01-\x7f]|[\x81-\xfe]([\x40-\x7e]|\xa1-\xfe])/";
+        preg_match_all($re[$charset], $str, $match);
+        $slice = join("", array_slice($match[0], $start, $length));
+        return $slice;
+    }
+
+    function parserResponseSubCode($request, $responseContent, $respObject, $format)
+    {
 
-		}
+        if ("json" == $format) {
 
+            $apiName = $request->getApiMethodName();
+            $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
+            $errorNodeName = $this->ERROR_RESPONSE;
 
-	}
+            $rootIndex = strpos($responseContent, $rootNodeName);
+            $errorIndex = strpos($responseContent, $errorNodeName);
 
-	function parserJSONSignData($request, $responseContent, $responseJSON) {
+            if ($rootIndex > 0) {
+                // 内部节点对象
+                $rInnerObject = $respObject->$rootNodeName;
+            } elseif ($errorIndex > 0) {
 
-		$signData = new SignData();
+                $rInnerObject = $respObject->$errorNodeName;
+            } else {
+                return null;
+            }
 
-		$signData->sign = $this->parserJSONSign($responseJSON);
-		$signData->signSourceData = $this->parserJSONSignSource($request, $responseContent);
+            // 存在属性则返回对应值
+            if (isset($rInnerObject->sub_code)) {
 
+                return $rInnerObject->sub_code;
+            } else {
 
-		return $signData;
+                return null;
+            }
 
-	}
 
-	function parserJSONSignSource($request, $responseContent) {
+        } elseif ("xml" == $format) {
 
-		$apiName = $request->getApiMethodName();
-		$rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
+            // xml格式sub_code在同一层级
+            return $respObject->sub_code;
 
-		$rootIndex = strpos($responseContent, $rootNodeName);
-		$errorIndex = strpos($responseContent, $this->ERROR_RESPONSE);
+        }
 
 
-		if ($rootIndex > 0) {
+    }
 
-			return $this->parserJSONSource($responseContent, $rootNodeName, $rootIndex);
-		} else if ($errorIndex > 0) {
+    function parserJSONSignData($request, $responseContent, $responseJSON)
+    {
 
-			return $this->parserJSONSource($responseContent, $this->ERROR_RESPONSE, $errorIndex);
-		} else {
+        $signData = new SignData();
 
-			return null;
-		}
+        $signData->sign = $this->parserJSONSign($responseJSON);
+        $signData->signSourceData = $this->parserJSONSignSource($request, $responseContent);
 
 
-	}
+        return $signData;
 
-	function parserJSONSource($responseContent, $nodeName, $nodeIndex) {
-		$signDataStartIndex = $nodeIndex + strlen($nodeName) + 2;
-		$signIndex = strpos($responseContent, "\"" . $this->SIGN_NODE_NAME . "\"");
-		// 签名前-逗号
-		$signDataEndIndex = $signIndex - 1;
-		$indexLen = $signDataEndIndex - $signDataStartIndex;
-		if ($indexLen < 0) {
+    }
 
-			return null;
-		}
+    function parserJSONSignSource($request, $responseContent)
+    {
 
-		return substr($responseContent, $signDataStartIndex, $indexLen);
+        $apiName = $request->getApiMethodName();
+        $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
 
-	}
+        $rootIndex = strpos($responseContent, $rootNodeName);
+        $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE);
 
-	function parserJSONSign($responseJSon) {
 
-		return $responseJSon->sign;
-	}
+        if ($rootIndex > 0) {
 
-	function parserXMLSignData($request, $responseContent) {
+            return $this->parserJSONSource($responseContent, $rootNodeName, $rootIndex);
+        } else if ($errorIndex > 0) {
 
+            return $this->parserJSONSource($responseContent, $this->ERROR_RESPONSE, $errorIndex);
+        } else {
 
-		$signData = new SignData();
+            return null;
+        }
 
-		$signData->sign = $this->parserXMLSign($responseContent);
-		$signData->signSourceData = $this->parserXMLSignSource($request, $responseContent);
 
+    }
 
-		return $signData;
+    function parserJSONSource($responseContent, $nodeName, $nodeIndex)
+    {
+        $signDataStartIndex = $nodeIndex + strlen($nodeName) + 2;
+        $signIndex = strrpos($responseContent, "\"" . $this->SIGN_NODE_NAME . "\"");
+        // 签名前-逗号
+        $signDataEndIndex = $signIndex - 1;
+        $indexLen = $signDataEndIndex - $signDataStartIndex;
+        if ($indexLen < 0) {
 
+            return null;
+        }
 
-	}
+        return substr($responseContent, $signDataStartIndex, $indexLen);
 
-	function parserXMLSignSource($request, $responseContent) {
+    }
 
+    function parserJSONSign($responseJSon)
+    {
 
-		$apiName = $request->getApiMethodName();
-		$rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
+        return $responseJSon->sign;
+    }
 
+    function parserXMLSignData($request, $responseContent)
+    {
 
-		$rootIndex = strpos($responseContent, $rootNodeName);
-		$errorIndex = strpos($responseContent, $this->ERROR_RESPONSE);
-		//		$this->echoDebug("<br/>rootNodeName:" . $rootNodeName);
-		//		$this->echoDebug("<br/> responseContent:<xmp>" . $responseContent . "</xmp>");
 
+        $signData = new SignData();
 
-		if ($rootIndex > 0) {
+        $signData->sign = $this->parserXMLSign($responseContent);
+        $signData->signSourceData = $this->parserXMLSignSource($request, $responseContent);
 
-			return $this->parserXMLSource($responseContent, $rootNodeName, $rootIndex);
-		} else if ($errorIndex > 0) {
 
-			return $this->parserXMLSource($responseContent, $this->ERROR_RESPONSE, $errorIndex);
-		} else {
+        return $signData;
 
-			return null;
-		}
 
+    }
 
-	}
+    function parserXMLSignSource($request, $responseContent)
+    {
 
-	function parserXMLSource($responseContent, $nodeName, $nodeIndex) {
-		$signDataStartIndex = $nodeIndex + strlen($nodeName) + 1;
-		$signIndex = strpos($responseContent, "<" . $this->SIGN_NODE_NAME . ">");
-		// 签名前-逗号
-		$signDataEndIndex = $signIndex - 1;
-		$indexLen = $signDataEndIndex - $signDataStartIndex + 1;
 
-		if ($indexLen < 0) {
-			return null;
-		}
+        $apiName = $request->getApiMethodName();
+        $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
 
 
-		return substr($responseContent, $signDataStartIndex, $indexLen);
+        $rootIndex = strpos($responseContent, $rootNodeName);
+        $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE);
+        //		$this->echoDebug("<br/>rootNodeName:" . $rootNodeName);
+        //		$this->echoDebug("<br/> responseContent:<xmp>" . $responseContent . "</xmp>");
 
 
-	}
+        if ($rootIndex > 0) {
 
-	function parserXMLSign($responseContent) {
-		$signNodeName = "<" . $this->SIGN_NODE_NAME . ">";
-		$signEndNodeName = "</" . $this->SIGN_NODE_NAME . ">";
+            return $this->parserXMLSource($responseContent, $rootNodeName, $rootIndex);
+        } else if ($errorIndex > 0) {
 
-		$indexOfSignNode = strpos($responseContent, $signNodeName);
-		$indexOfSignEndNode = strpos($responseContent, $signEndNodeName);
+            return $this->parserXMLSource($responseContent, $this->ERROR_RESPONSE, $errorIndex);
+        } else {
 
+            return null;
+        }
 
-		if ($indexOfSignNode < 0 || $indexOfSignEndNode < 0) {
-			return null;
-		}
 
-		$nodeIndex = ($indexOfSignNode + strlen($signNodeName));
+    }
 
-		$indexLen = $indexOfSignEndNode - $nodeIndex;
+    function parserXMLSource($responseContent, $nodeName, $nodeIndex)
+    {
+        $signDataStartIndex = $nodeIndex + strlen($nodeName) + 1;
+        $signIndex = strrpos($responseContent, "<" . $this->SIGN_NODE_NAME . ">");
+        // 签名前-逗号
+        $signDataEndIndex = $signIndex - 1;
+        $indexLen = $signDataEndIndex - $signDataStartIndex + 1;
 
-		if ($indexLen < 0) {
-			return null;
-		}
+        if ($indexLen < 0) {
+            return null;
+        }
 
-		// 签名
-		return substr($responseContent, $nodeIndex, $indexLen);
 
-	}
+        return substr($responseContent, $signDataStartIndex, $indexLen);
 
-	/**
-	 * 验签
-	 * @param $request
-	 * @param $signData
-	 * @param $resp
-	 * @param $respObject
-	 * @throws Exception
-	 */
-	public function checkResponseSign($request, $signData, $resp, $respObject) {
 
-		if (!$this->checkEmpty($this->alipayPublicKey) || !$this->checkEmpty($this->alipayrsaPublicKey)) {
+    }
 
+    function parserXMLSign($responseContent)
+    {
+        $signNodeName = "<" . $this->SIGN_NODE_NAME . ">";
+        $signEndNodeName = "</" . $this->SIGN_NODE_NAME . ">";
 
-			if ($signData == null || $this->checkEmpty($signData->sign) || $this->checkEmpty($signData->signSourceData)) {
+        $indexOfSignNode = strpos($responseContent, $signNodeName);
+        $indexOfSignEndNode = strpos($responseContent, $signEndNodeName);
 
-				throw new Exception(" check sign Fail! The reason : signData is Empty");
-			}
 
+        if ($indexOfSignNode < 0 || $indexOfSignEndNode < 0) {
+            return null;
+        }
 
-			// 获取结果sub_code
-			$responseSubCode = $this->parserResponseSubCode($request, $resp, $respObject, $this->format);
+        $nodeIndex = ($indexOfSignNode + strlen($signNodeName));
 
+        $indexLen = $indexOfSignEndNode - $nodeIndex;
 
-			if (!$this->checkEmpty($responseSubCode) || ($this->checkEmpty($responseSubCode) && !$this->checkEmpty($signData->sign))) {
+        if ($indexLen < 0) {
+            return null;
+        }
 
-				$checkResult = $this->verify($signData->signSourceData, $signData->sign, $this->alipayPublicKey, $this->signType);
+        // 签名
+        return substr($responseContent, $nodeIndex, $indexLen);
 
+    }
 
-				if (!$checkResult) {
+    /**
+     * 验签
+     * @param $request
+     * @param $signData
+     * @param $resp
+     * @param $respObject
+     * @throws Exception
+     */
+    public function checkResponseSign($request, $signData, $resp, $respObject)
+    {
 
-					if (strpos($signData->signSourceData, "\\/") > 0) {
+        if (!$this->checkEmpty($this->alipayPublicKey) || !$this->checkEmpty($this->alipayrsaPublicKey)) {
 
-						$signData->signSourceData = str_replace("\\/", "/", $signData->signSourceData);
 
-						$checkResult = $this->verify($signData->signSourceData, $signData->sign, $this->alipayPublicKey, $this->signType);
+            if ($signData == null || $this->checkEmpty($signData->sign) || $this->checkEmpty($signData->signSourceData)) {
 
-						if (!$checkResult) {
-							throw new Exception("check sign Fail! [sign=" . $signData->sign . ", signSourceData=" . $signData->signSourceData . "]");
-						}
+                throw new Exception(" check sign Fail! The reason : signData is Empty");
+            }
 
-					} else {
 
-						throw new Exception("check sign Fail! [sign=" . $signData->sign . ", signSourceData=" . $signData->signSourceData . "]");
-					}
+            // 获取结果sub_code
+            $responseSubCode = $this->parserResponseSubCode($request, $resp, $respObject, $this->format);
 
-				}
-			}
 
+            if (!$this->checkEmpty($responseSubCode) || ($this->checkEmpty($responseSubCode) && !$this->checkEmpty($signData->sign))) {
 
-		}
-	}
+                $checkResult = $this->verify($signData->signSourceData, $signData->sign, $this->alipayPublicKey, $this->signType);
 
-	private function setupCharsets($request) {
-		if ($this->checkEmpty($this->postCharset)) {
-			$this->postCharset = 'UTF-8';
-		}
-		$str = preg_match('/[\x80-\xff]/', $this->appId) ? $this->appId : print_r($request, true);
-		$this->fileCharset = mb_detect_encoding($str, "UTF-8, GBK") == 'UTF-8' ? 'UTF-8' : 'GBK';
-	}
 
-	// 获取加密内容
+                if (!$checkResult) {
 
-	private function encryptJSONSignSource($request, $responseContent) {
+                    if (strpos($signData->signSourceData, "\\/") > 0) {
 
-		$parsetItem = $this->parserEncryptJSONSignSource($request, $responseContent);
+                        $signData->signSourceData = str_replace("\\/", "/", $signData->signSourceData);
 
-		$bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex);
-		$bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) + 1 - $parsetItem->endIndex);
+                        $checkResult = $this->verify($signData->signSourceData, $signData->sign, $this->alipayPublicKey, $this->signType);
 
-		$bizContent = decrypt($parsetItem->encryptContent, $this->encryptKey);
-		return $bodyIndexContent . $bizContent . $bodyEndContent;
+                        if (!$checkResult) {
+                            throw new Exception("check sign Fail! [sign=" . $signData->sign . ", signSourceData=" . $signData->signSourceData . "]");
+                        }
 
-	}
+                    } else {
 
+                        throw new Exception("check sign Fail! [sign=" . $signData->sign . ", signSourceData=" . $signData->signSourceData . "]");
+                    }
 
-	private function parserEncryptJSONSignSource($request, $responseContent) {
+                }
+            }
 
-		$apiName = $request->getApiMethodName();
-		$rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
 
-		$rootIndex = strpos($responseContent, $rootNodeName);
-		$errorIndex = strpos($responseContent, $this->ERROR_RESPONSE);
+        }
+    }
 
+    private function setupCharsets($request)
+    {
+        if ($this->checkEmpty($this->postCharset)) {
+            $this->postCharset = 'UTF-8';
+        }
+        $str = preg_match('/[\x80-\xff]/', $this->appId) ? $this->appId : print_r($request, true);
+        $this->fileCharset = mb_detect_encoding($str, "UTF-8, GBK") == 'UTF-8' ? 'UTF-8' : 'GBK';
+    }
 
-		if ($rootIndex > 0) {
+    // 获取加密内容
 
-			return $this->parserEncryptJSONItem($responseContent, $rootNodeName, $rootIndex);
-		} else if ($errorIndex > 0) {
+    private function encryptJSONSignSource($request, $responseContent)
+    {
 
-			return $this->parserEncryptJSONItem($responseContent, $this->ERROR_RESPONSE, $errorIndex);
-		} else {
+        $parsetItem = $this->parserEncryptJSONSignSource($request, $responseContent);
 
-			return null;
-		}
+        $bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex);
+        $bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) + 1 - $parsetItem->endIndex);
 
+        $bizContent = decrypt($parsetItem->encryptContent, $this->encryptKey);
+        return $bodyIndexContent . $bizContent . $bodyEndContent;
 
-	}
+    }
 
 
-	private function parserEncryptJSONItem($responseContent, $nodeName, $nodeIndex) {
-		$signDataStartIndex = $nodeIndex + strlen($nodeName) + 2;
-		$signIndex = strpos($responseContent, "\"" . $this->SIGN_NODE_NAME . "\"");
-		// 签名前-逗号
-		$signDataEndIndex = $signIndex - 1;
+    private function parserEncryptJSONSignSource($request, $responseContent)
+    {
 
-		if ($signDataEndIndex < 0) {
+        $apiName = $request->getApiMethodName();
+        $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
 
-			$signDataEndIndex = strlen($responseContent)-1 ;
-		}
+        $rootIndex = strpos($responseContent, $rootNodeName);
+        $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE);
 
-		$indexLen = $signDataEndIndex - $signDataStartIndex;
 
-		$encContent = substr($responseContent, $signDataStartIndex+1, $indexLen-2);
+        if ($rootIndex > 0) {
 
+            return $this->parserEncryptJSONItem($responseContent, $rootNodeName, $rootIndex);
+        } else if ($errorIndex > 0) {
 
-		$encryptParseItem = new EncryptParseItem();
+            return $this->parserEncryptJSONItem($responseContent, $this->ERROR_RESPONSE, $errorIndex);
+        } else {
 
-		$encryptParseItem->encryptContent = $encContent;
-		$encryptParseItem->startIndex = $signDataStartIndex;
-		$encryptParseItem->endIndex = $signDataEndIndex;
+            return null;
+        }
 
-		return $encryptParseItem;
 
-	}
+    }
 
-	// 获取加密内容
 
-	private function encryptXMLSignSource($request, $responseContent) {
+    private function parserEncryptJSONItem($responseContent, $nodeName, $nodeIndex)
+    {
+        $signDataStartIndex = $nodeIndex + strlen($nodeName) + 2;
+        $signIndex = strpos($responseContent, "\"" . $this->SIGN_NODE_NAME . "\"");
+        // 签名前-逗号
+        $signDataEndIndex = $signIndex - 1;
 
-		$parsetItem = $this->parserEncryptXMLSignSource($request, $responseContent);
+        if ($signDataEndIndex < 0) {
 
-		$bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex);
-		$bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) + 1 - $parsetItem->endIndex);
-		$bizContent = decrypt($parsetItem->encryptContent, $this->encryptKey);
+            $signDataEndIndex = strlen($responseContent) - 1;
+        }
 
-		return $bodyIndexContent . $bizContent . $bodyEndContent;
+        $indexLen = $signDataEndIndex - $signDataStartIndex;
 
-	}
+        $encContent = substr($responseContent, $signDataStartIndex + 1, $indexLen - 2);
 
-	private function parserEncryptXMLSignSource($request, $responseContent) {
 
+        $encryptParseItem = new EncryptParseItem();
 
-		$apiName = $request->getApiMethodName();
-		$rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
+        $encryptParseItem->encryptContent = $encContent;
+        $encryptParseItem->startIndex = $signDataStartIndex;
+        $encryptParseItem->endIndex = $signDataEndIndex;
 
+        return $encryptParseItem;
 
-		$rootIndex = strpos($responseContent, $rootNodeName);
-		$errorIndex = strpos($responseContent, $this->ERROR_RESPONSE);
-		//		$this->echoDebug("<br/>rootNodeName:" . $rootNodeName);
-		//		$this->echoDebug("<br/> responseContent:<xmp>" . $responseContent . "</xmp>");
+    }
 
+    // 获取加密内容
 
-		if ($rootIndex > 0) {
+    private function encryptXMLSignSource($request, $responseContent)
+    {
 
-			return $this->parserEncryptXMLItem($responseContent, $rootNodeName, $rootIndex);
-		} else if ($errorIndex > 0) {
+        $parsetItem = $this->parserEncryptXMLSignSource($request, $responseContent);
 
-			return $this->parserEncryptXMLItem($responseContent, $this->ERROR_RESPONSE, $errorIndex);
-		} else {
+        $bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex);
+        $bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) + 1 - $parsetItem->endIndex);
+        $bizContent = decrypt($parsetItem->encryptContent, $this->encryptKey);
 
-			return null;
-		}
+        return $bodyIndexContent . $bizContent . $bodyEndContent;
 
+    }
 
-	}
+    private function parserEncryptXMLSignSource($request, $responseContent)
+    {
 
-	private function parserEncryptXMLItem($responseContent, $nodeName, $nodeIndex) {
 
-		$signDataStartIndex = $nodeIndex + strlen($nodeName) + 1;
+        $apiName = $request->getApiMethodName();
+        $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX;
 
-		$xmlStartNode="<".$this->ENCRYPT_XML_NODE_NAME.">";
-		$xmlEndNode="</".$this->ENCRYPT_XML_NODE_NAME.">";
 
-		$indexOfXmlNode=strpos($responseContent,$xmlEndNode);
-		if($indexOfXmlNode<0){
+        $rootIndex = strpos($responseContent, $rootNodeName);
+        $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE);
+        //		$this->echoDebug("<br/>rootNodeName:" . $rootNodeName);
+        //		$this->echoDebug("<br/> responseContent:<xmp>" . $responseContent . "</xmp>");
 
-			$item = new EncryptParseItem();
-			$item->encryptContent = null;
-			$item->startIndex = 0;
-			$item->endIndex = 0;
-			return $item;
-		}
 
-		$startIndex=$signDataStartIndex+strlen($xmlStartNode);
-		$bizContentLen=$indexOfXmlNode-$startIndex;
-		$bizContent=substr($responseContent,$startIndex,$bizContentLen);
+        if ($rootIndex > 0) {
 
-		$encryptParseItem = new EncryptParseItem();
-		$encryptParseItem->encryptContent = $bizContent;
-		$encryptParseItem->startIndex = $signDataStartIndex;
-		$encryptParseItem->endIndex = $indexOfXmlNode+strlen($xmlEndNode);
+            return $this->parserEncryptXMLItem($responseContent, $rootNodeName, $rootIndex);
+        } else if ($errorIndex > 0) {
 
-		return $encryptParseItem;
+            return $this->parserEncryptXMLItem($responseContent, $this->ERROR_RESPONSE, $errorIndex);
+        } else {
 
-	}
+            return null;
+        }
 
 
-	function echoDebug($content) {
+    }
 
-		if ($this->debugInfo) {
-			echo "<br/>" . $content;
-		}
+    private function parserEncryptXMLItem($responseContent, $nodeName, $nodeIndex)
+    {
+
+        $signDataStartIndex = $nodeIndex + strlen($nodeName) + 1;
+
+        $xmlStartNode = "<" . $this->ENCRYPT_XML_NODE_NAME . ">";
+        $xmlEndNode = "</" . $this->ENCRYPT_XML_NODE_NAME . ">";
+
+        $indexOfXmlNode = strpos($responseContent, $xmlEndNode);
+        if ($indexOfXmlNode < 0) {
+
+            $item = new EncryptParseItem();
+            $item->encryptContent = null;
+            $item->startIndex = 0;
+            $item->endIndex = 0;
+            return $item;
+        }
+
+        $startIndex = $signDataStartIndex + strlen($xmlStartNode);
+        $bizContentLen = $indexOfXmlNode - $startIndex;
+        $bizContent = substr($responseContent, $startIndex, $bizContentLen);
+
+        $encryptParseItem = new EncryptParseItem();
+        $encryptParseItem->encryptContent = $bizContent;
+        $encryptParseItem->startIndex = $signDataStartIndex;
+        $encryptParseItem->endIndex = $indexOfXmlNode + strlen($xmlEndNode);
+
+        return $encryptParseItem;
+
+    }
+
+
+    function echoDebug($content)
+    {
+
+        if ($this->debugInfo) {
+            echo "<br/>" . $content;
+        }
 
-	}
+    }
 
 
 }

+ 43 - 33
sdk/alipay/aop/AopEncrypt.php

@@ -7,19 +7,25 @@
  * Time: 下午3:25
  */
 
+
 /**
  * 加密方法
  * @param string $str
  * @return string
  */
- function encrypt($str,$screct_key){
-	//AES, 128 模式加密数据 CBC
-	$screct_key = base64_decode($screct_key);
-	$str = trim($str);
-	$str = addPKCS7Padding($str);
-	$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128,MCRYPT_MODE_CBC),1);
-	$encrypt_str =  mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $screct_key, $str, MCRYPT_MODE_CBC);
-	return base64_encode($encrypt_str);
+function encrypt($str, $screct_key)
+{
+    //AES, 128 模式加密数据 CBC
+    $screct_key = base64_decode($screct_key);
+    $str = trim($str);
+    $str = addPKCS7Padding($str);
+
+    //设置全0的IV
+    $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
+    $iv = str_repeat("\0", $iv_size);
+
+    $encrypt_str = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $screct_key, $str, MCRYPT_MODE_CBC, $iv);
+    return base64_encode($encrypt_str);
 }
 
 /**
@@ -27,17 +33,19 @@
  * @param string $str
  * @return string
  */
- function decrypt($str,$screct_key){
-	//AES, 128 模式加密数据 CBC
-	$str = base64_decode($str);
-	$screct_key = base64_decode($screct_key);
-	$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128,MCRYPT_MODE_CBC),1);
-	$encrypt_str =  mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $screct_key, $str, MCRYPT_MODE_CBC);
-	$encrypt_str = trim($encrypt_str);
+function decrypt($str, $screct_key)
+{
+    //AES, 128 模式加密数据 CBC
+    $str = base64_decode($str);
+    $screct_key = base64_decode($screct_key);
 
-	$encrypt_str = stripPKSC7Padding($encrypt_str);
-	return $encrypt_str;
+    //设置全0的IV
+    $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
+    $iv = str_repeat("\0", $iv_size);
 
+    $decrypt_str = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $screct_key, $str, MCRYPT_MODE_CBC, $iv);
+    $decrypt_str = stripPKSC7Padding($decrypt_str);
+    return $decrypt_str;
 }
 
 /**
@@ -45,27 +53,29 @@
  * @param string $source
  * @return string
  */
-function addPKCS7Padding($source){
-	$source = trim($source);
-	$block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
+function addPKCS7Padding($source)
+{
+    $source = trim($source);
+    $block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
 
-	$pad = $block - (strlen($source) % $block);
-	if ($pad <= $block) {
-		$char = chr($pad);
-		$source .= str_repeat($char, $pad);
-	}
-	return $source;
+    $pad = $block - (strlen($source) % $block);
+    if ($pad <= $block) {
+        $char = chr($pad);
+        $source .= str_repeat($char, $pad);
+    }
+    return $source;
 }
+
 /**
  * 移去填充算法
  * @param string $source
  * @return string
  */
-function stripPKSC7Padding($source){
-	$source = trim($source);
-	$char = substr($source, -1);
-	$num = ord($char);
-	if($num==62)return $source;
-	$source = substr($source,0,-$num);
-	return $source;
+function stripPKSC7Padding($source)
+{
+    $char = substr($source, -1);
+    $num = ord($char);
+    if ($num == 62) return $source;
+    $source = substr($source, 0, -$num);
+    return $source;
 }

+ 6 - 5
sdk/alipay/aop/EncryptParseItem.php

@@ -1,19 +1,20 @@
 <?php
 /**
- *  TODO 补充说明 
+ *  TODO 补充说明
  *
  * User: jiehua
  * Date: 16/3/30
  * Time: 下午8:55
  */
 
-class EncryptParseItem {
+class EncryptParseItem
+{
 
 
-	public $startIndex;
+    public $startIndex;
 
-	public $endIndex;
+    public $endIndex;
 
-	public $encryptContent;
+    public $encryptContent;
 
 } 

+ 5 - 4
sdk/alipay/aop/EncryptResponseData.php

@@ -1,18 +1,19 @@
 <?php
 /**
- *  TODO 补充说明 
+ *  TODO 补充说明
  *
  * User: jiehua
  * Date: 16/3/30
  * Time: 下午8:51
  */
 
-class EncryptResponseData {
+class EncryptResponseData
+{
 
 
-	public $realContent;
+    public $realContent;
 
-	public $returnContent;
+    public $returnContent;
 
 
 } 

+ 4 - 3
sdk/alipay/aop/SignData.php

@@ -6,11 +6,12 @@
  * Time: 下午6:21
  */
 
-class SignData {
+class SignData
+{
 
-    public $signSourceData=null;
+    public $signSourceData = null;
 
 
-    public $sign=null;
+    public $sign = null;
 
 } 

+ 12 - 0
sdk/alipay/aop/readme

@@ -0,0 +1,12 @@
+SDK版本升级说明
+1、去除已经放弃维护的lotusphp框架
+2、公私钥模式开发者请直接初始化AopClient,使用方法详见:aop/test/AopClientTest.php
+3、证书模式开发者请直接初始化AopCertClient,使用方法详见:aop/test/AopCertClientTest.php
+4、兼容PHP7.2以上版本
+
+更新时间:2019-12-27
+
+备注:
+使用证书模式本地必须开始SSL
+如果出现SSL certificate: unable to get local issuer certificate错误信息
+解决办法:到http://curl.haxx.se/ca/cacert.pem下载pem文件,并将文件拷贝到D:\phpStudy\PHPTutorial\cacert.pem 在php.ini 增加curl.cainfo = "D:\phpStudy\PHPTutorial\cacert.pem"

+ 4 - 4
sdk/alipay/aop/request/AlipayOfflineMaterialImageQueryRequest.php → sdk/alipay/aop/request/AftAifinAddddQueryRequest.php

@@ -1,11 +1,11 @@
 <?php
 /**
- * ALIPAY API: alipay.offline.material.image.query request
+ * ALIPAY API: aft.aifin.adddd.query request
  *
  * @author auto create
- * @since 1.0, 2015-10-15 13:59:49
+ * @since 1.0, 2019-02-18 11:06:39
  */
-class AlipayOfflineMaterialImageQueryRequest
+class AftAifinAddddQueryRequest
 {
 
 	private $apiParas = array();
@@ -20,7 +20,7 @@ class AlipayOfflineMaterialImageQueryRequest
 	
 	public function getApiMethodName()
 	{
-		return "alipay.offline.material.image.query";
+		return "aft.aifin.adddd.query";
 	}
 
 	public function setNotifyUrl($notifyUrl)

+ 118 - 0
sdk/alipay/aop/request/AftAifinFireeyeMytestImageQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: aft.aifin.fireeye.mytest.image.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-03-11 15:11:06
+ */
+class AftAifinFireeyeMytestImageQueryRequest
+{
+	/** 
+	 * 誉少金融云接口预发验证
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "aft.aifin.fireeye.mytest.image.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 5 - 5
sdk/alipay/aop/request/AlipayOfflineMarketReportGetRequest.php → sdk/alipay/aop/request/AftAifinFireeyeOcrImageQueryRequest.php

@@ -1,14 +1,14 @@
 <?php
 /**
- * ALIPAY API: alipay.offline.market.report.get request
+ * ALIPAY API: aft.aifin.fireeye.ocr.image.query request
  *
  * @author auto create
- * @since 1.0, 2016-05-16 16:13:16
+ * @since 1.0, 2019-01-07 20:51:15
  */
-class AlipayOfflineMarketReportGetRequest
+class AftAifinFireeyeOcrImageQueryRequest
 {
 	/** 
-	 * 获取店铺信息
+	 * OCR火眼识别
 	 **/
 	private $bizContent;
 
@@ -35,7 +35,7 @@ class AlipayOfflineMarketReportGetRequest
 
 	public function getApiMethodName()
 	{
-		return "alipay.offline.market.report.get";
+		return "aft.aifin.fireeye.ocr.image.query";
 	}
 
 	public function setNotifyUrl($notifyUrl)

+ 118 - 0
sdk/alipay/aop/request/AftAifinFireeyeTestModifyRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: aft.aifin.fireeye.test.modify request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-18 16:41:31
+ */
+class AftAifinFireeyeTestModifyRequest
+{
+	/** 
+	 * 测试金融科技火眼内部调用服务端update
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "aft.aifin.fireeye.test.modify";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 4 - 4
sdk/alipay/aop/request/AlipayOfflineMaterialImageModifyRequest.php → sdk/alipay/aop/request/AftAifinNewtestQueryRequest.php

@@ -1,11 +1,11 @@
 <?php
 /**
- * ALIPAY API: alipay.offline.material.image.modify request
+ * ALIPAY API: aft.aifin.newtest.query request
  *
  * @author auto create
- * @since 1.0, 2015-10-15 14:00:09
+ * @since 1.0, 2019-06-13 10:21:33
  */
-class AlipayOfflineMaterialImageModifyRequest
+class AftAifinNewtestQueryRequest
 {
 
 	private $apiParas = array();
@@ -20,7 +20,7 @@ class AlipayOfflineMaterialImageModifyRequest
 	
 	public function getApiMethodName()
 	{
-		return "alipay.offline.material.image.modify";
+		return "aft.aifin.newtest.query";
 	}
 
 	public function setNotifyUrl($notifyUrl)

+ 4 - 4
sdk/alipay/aop/request/AlipayOfflineMarketShopAlbumBindRequest.php → sdk/alipay/aop/request/AftBlockchainBaasAccountCreateRequest.php

@@ -1,11 +1,11 @@
 <?php
 /**
- * ALIPAY API: alipay.offline.market.shop.album.bind request
+ * ALIPAY API: aft.blockchain.baas.account.create request
  *
  * @author auto create
- * @since 1.0, 2015-10-14 21:56:30
+ * @since 1.0, 2019-08-06 16:45:18
  */
-class AlipayOfflineMarketShopAlbumBindRequest
+class AftBlockchainBaasAccountCreateRequest
 {
 
 	private $apiParas = array();
@@ -20,7 +20,7 @@ class AlipayOfflineMarketShopAlbumBindRequest
 	
 	public function getApiMethodName()
 	{
-		return "alipay.offline.market.shop.album.bind";
+		return "aft.blockchain.baas.account.create";
 	}
 
 	public function setNotifyUrl($notifyUrl)

+ 118 - 0
sdk/alipay/aop/request/AftFinsecureFaceverifyzolozFaceauthFaceInitializeRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: aft.finsecure.faceverifyzoloz.faceauth.face.initialize request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AftFinsecureFaceverifyzolozFaceauthFaceInitializeRequest
+{
+	/** 
+	 * 刷炼认证-实人认证初始化
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "aft.finsecure.faceverifyzoloz.faceauth.face.initialize";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AftFinsecureFaceverifyzolozFaceauthFaceQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: aft.finsecure.faceverifyzoloz.faceauth.face.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AftFinsecureFaceverifyzolozFaceauthFaceQueryRequest
+{
+	/** 
+	 * 刷脸认证-实人认证查询
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "aft.finsecure.faceverifyzoloz.faceauth.face.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AftFinsecureFaceverifyzolozFaceauthWebInitializeRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: aft.finsecure.faceverifyzoloz.faceauth.web.initialize request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AftFinsecureFaceverifyzolozFaceauthWebInitializeRequest
+{
+	/** 
+	 * H5实人认证初始化
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "aft.finsecure.faceverifyzoloz.faceauth.web.initialize";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AftFinsecureFaceverifyzolozFaceauthWebQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: aft.finsecure.faceverifyzoloz.faceauth.web.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AftFinsecureFaceverifyzolozFaceauthWebQueryRequest
+{
+	/** 
+	 * H5实人认证查询
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "aft.finsecure.faceverifyzoloz.faceauth.web.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 5 - 5
sdk/alipay/aop/request/KoubeiMarketingDataCustomtagDetailQueryRequest.php → sdk/alipay/aop/request/AftFinsecureRiskplusSecurityPolicyQueryRequest.php

@@ -1,14 +1,14 @@
 <?php
 /**
- * ALIPAY API: koubei.marketing.data.customtag.detail.query request
+ * ALIPAY API: aft.finsecure.riskplus.security.policy.query request
  *
  * @author auto create
- * @since 1.0, 2016-08-29 14:52:40
+ * @since 1.0, 2019-01-07 20:51:15
  */
-class KoubeiMarketingDataCustomtagDetailQueryRequest
+class AftFinsecureRiskplusSecurityPolicyQueryRequest
 {
 	/** 
-	 * 自定义标签详情查询
+	 * 策略咨询服务输出
 	 **/
 	private $bizContent;
 
@@ -35,7 +35,7 @@ class KoubeiMarketingDataCustomtagDetailQueryRequest
 
 	public function getApiMethodName()
 	{
-		return "koubei.marketing.data.customtag.detail.query";
+		return "aft.finsecure.riskplus.security.policy.query";
 	}
 
 	public function setNotifyUrl($notifyUrl)

+ 5 - 5
sdk/alipay/aop/request/AlipayOfflineSaleleadsModifyRequest.php → sdk/alipay/aop/request/AliosOpenAutoInfoQueryRequest.php

@@ -1,14 +1,14 @@
 <?php
 /**
- * ALIPAY API: alipay.offline.saleleads.modify request
+ * ALIPAY API: alios.open.auto.info.query request
  *
  * @author auto create
- * @since 1.0, 2016-05-16 16:13:30
+ * @since 1.0, 2019-12-17 12:20:59
  */
-class AlipayOfflineSaleleadsModifyRequest
+class AliosOpenAutoInfoQueryRequest
 {
 	/** 
-	 * leads信息修改
+	 * 查询阿里车的车辆信息
 	 **/
 	private $bizContent;
 
@@ -35,7 +35,7 @@ class AlipayOfflineSaleleadsModifyRequest
 
 	public function getApiMethodName()
 	{
-		return "alipay.offline.saleleads.modify";
+		return "alios.open.auto.info.query";
 	}
 
 	public function setNotifyUrl($notifyUrl)

+ 1 - 1
sdk/alipay/aop/request/AlipayAccountExrateAdviceAcceptRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.account.exrate.advice.accept request
  *
  * @author auto create
- * @since 1.0, 2016-05-23 14:55:42
+ * @since 1.0, 2019-01-07 20:51:15
  */
 class AlipayAccountExrateAdviceAcceptRequest
 {

+ 1 - 1
sdk/alipay/aop/request/AlipayAccountExrateAllclientrateQueryRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.account.exrate.allclientrate.query request
  *
  * @author auto create
- * @since 1.0, 2016-05-23 14:55:48
+ * @since 1.0, 2019-09-27 17:03:52
  */
 class AlipayAccountExrateAllclientrateQueryRequest
 {

+ 118 - 0
sdk/alipay/aop/request/AlipayAccountExrateCollectcoreDataSendRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.collectcore.data.send request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AlipayAccountExrateCollectcoreDataSendRequest
+{
+	/** 
+	 * 金融信息受理接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.collectcore.data.send";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 5 - 5
sdk/alipay/aop/request/AlipayOfflineMarketShopAssignstaffRequest.php → sdk/alipay/aop/request/AlipayAccountExratePricingNotifyRequest.php

@@ -1,14 +1,14 @@
 <?php
 /**
- * ALIPAY API: alipay.offline.market.shop.assignstaff request
+ * ALIPAY API: alipay.account.exrate.pricing.notify request
  *
  * @author auto create
- * @since 1.0, 2016-05-16 16:13:37
+ * @since 1.0, 2019-01-07 20:51:15
  */
-class AlipayOfflineMarketShopAssignstaffRequest
+class AlipayAccountExratePricingNotifyRequest
 {
 	/** 
-	 * 分配门店给员工
+	 * 源汇率受理通知接口
 	 **/
 	private $bizContent;
 
@@ -35,7 +35,7 @@ class AlipayOfflineMarketShopAssignstaffRequest
 
 	public function getApiMethodName()
 	{
-		return "alipay.offline.market.shop.assignstaff";
+		return "alipay.account.exrate.pricing.notify";
 	}
 
 	public function setNotifyUrl($notifyUrl)

+ 1 - 1
sdk/alipay/aop/request/AlipayAccountExrateRatequeryRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.account.exrate.ratequery request
  *
  * @author auto create
- * @since 1.0, 2016-05-23 14:55:56
+ * @since 1.0, 2019-01-07 20:51:15
  */
 class AlipayAccountExrateRatequeryRequest
 {

+ 118 - 0
sdk/alipay/aop/request/AlipayAccountExrateSentimentDataSendRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.sentiment.data.send request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AlipayAccountExrateSentimentDataSendRequest
+{
+	/** 
+	 * 国家制裁数据受理接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.sentiment.data.send";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAccountExrateSourcerateQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.sourcerate.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-07-08 00:55:01
+ */
+class AlipayAccountExrateSourcerateQueryRequest
+{
+	/** 
+	 * 源汇率查询
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.sourcerate.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAccountExrateTraderequestCreateRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.traderequest.create request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AlipayAccountExrateTraderequestCreateRequest
+{
+	/** 
+	 * 受理外汇交易请求
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.traderequest.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAccountFinriskCompanyVerifyCreateRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.finrisk.company.verify.create request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-22 12:15:00
+ */
+class AlipayAccountFinriskCompanyVerifyCreateRequest
+{
+	/** 
+	 * 商户验证受理接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.finrisk.company.verify.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAccountFinriskCompanyVerifyGetRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.finrisk.company.verify.get request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-22 15:10:01
+ */
+class AlipayAccountFinriskCompanyVerifyGetRequest
+{
+	/** 
+	 * 商户验真接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.finrisk.company.verify.get";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAccountFinriskGiriskrequestCreateRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.finrisk.giriskrequest.create request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AlipayAccountFinriskGiriskrequestCreateRequest
+{
+	/** 
+	 * 全面风险评价与监控平台风险请求受理接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.finrisk.giriskrequest.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAccountFinriskInstriskmonitorKeywordsBatchqueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.finrisk.instriskmonitor.keywords.batchquery request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AlipayAccountFinriskInstriskmonitorKeywordsBatchqueryRequest
+{
+	/** 
+	 * 查询关键词接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.finrisk.instriskmonitor.keywords.batchquery";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAccountFinriskMarkriskDatafactorQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.finrisk.markrisk.datafactor.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-07-25 11:38:03
+ */
+class AlipayAccountFinriskMarkriskDatafactorQueryRequest
+{
+	/** 
+	 * 市场风险平台风险因子计算
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.finrisk.markrisk.datafactor.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 1 - 1
sdk/alipay/aop/request/AlipayAcquireCancelRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.acquire.cancel request
  *
  * @author auto create
- * @since 1.0, 2014-06-12 17:17:06
+ * @since 1.0, 2019-03-08 15:29:11
  */
 class AlipayAcquireCancelRequest
 {

+ 1 - 1
sdk/alipay/aop/request/AlipayAcquireCloseRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.acquire.close request
  *
  * @author auto create
- * @since 1.0, 2014-06-12 17:17:06
+ * @since 1.0, 2019-03-08 15:29:11
  */
 class AlipayAcquireCloseRequest
 {

+ 471 - 0
sdk/alipay/aop/request/AlipayAcquireCreateRequest.php

@@ -0,0 +1,471 @@
+<?php
+/**
+ * ALIPAY API: alipay.acquire.create request
+ *
+ * @author auto create
+ * @since 1.0, 2019-03-08 15:29:11
+ */
+class AlipayAcquireCreateRequest
+{
+	/** 
+	 * 对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body
+	 **/
+	private $body;
+	
+	/** 
+	 * 买家支付宝账号,可以为email或者手机号
+	 **/
+	private $buyerEmail;
+	
+	/** 
+	 * 买家支付宝账号对应的支付宝唯一用户号
+以2088开头的纯16位数字
+	 **/
+	private $buyerId;
+	
+	/** 
+	 * 描述多渠道收单的渠道明细信息,json格式
+	 **/
+	private $channelParameters;
+	
+	/** 
+	 * 订单金额币种。
+目前只支持传入156(人民币)。
+如果为空,则默认设置为156
+	 **/
+	private $currency;
+	
+	/** 
+	 * 用于商户的特定业务信息的传递,只有商户与支付宝约定了传递此参数且约定了参数含义,此参数才有效。
+比如可传递二维码支付场景下的门店ID、门店类型、品牌ID等信息,以json格式传输。
+	 **/
+	private $extendParams;
+	
+	/** 
+	 * 描述商品明细信息,json格式
+	 **/
+	private $goodsDetail;
+	
+	/** 
+	 * 订单支付超时时间.
+设置未付款交易的超时时间,一旦超时,该笔交易就会自动被关闭。
+取值范围:1m~15d。
+m-分钟,h-小时,d-天,1c-当天(无论交易何时创建,都在0点关闭)。
+该参数数值不接受小数点,如1.5h,可转换为90m。
+该功能需要联系支付宝配置关闭时间
+	 **/
+	private $itBPay;
+	
+	/** 
+	 * 描述预付卡相关的明细信息,json格式
+	 **/
+	private $mcardParameters;
+	
+	/** 
+	 * 操作员的类型:
+0:支付宝操作员
+1:商户的操作员
+如果传入其它值或者为空,则默认设置为1
+	 **/
+	private $operatorCode;
+	
+	/** 
+	 * 卖家的操作员ID
+	 **/
+	private $operatorId;
+	
+	/** 
+	 * 支付宝合作商户网站唯一订单号
+	 **/
+	private $outTradeNo;
+	
+	/** 
+	 * 订单中商品的单价。如果请求时传入本参数,则必须满足total_fee=price×quantity的条件
+	 **/
+	private $price;
+	
+	/** 
+	 * 订单中商品的数量
+如果请求时传入本参数,则必须满足total_fee=price×quantity的条件
+	 **/
+	private $quantity;
+	
+	/** 
+	 * 业务关联ID集合,用于放置商户的订单号、支付流水号等信息,json格式
+	 **/
+	private $refIds;
+	
+	/** 
+	 * 描述分账明细信息,json格式
+	 **/
+	private $royaltyParameters;
+	
+	/** 
+	 * 卖家的分账类型,目前只支持传入ROYALTY(普通分账类型)
+	 **/
+	private $royaltyType;
+	
+	/** 
+	 * 卖家支付宝账号,可以为email或者手机号。
+如果seller_id不为空,则以seller_id的值作为卖家账号,忽略本参数
+	 **/
+	private $sellerEmail;
+	
+	/** 
+	 * 卖家支付宝账号对应的支付宝唯一用户号
+以2088开头的纯16位数字。
+如果和seller_email同时为空,则本参数默认填充partner的值。
+	 **/
+	private $sellerId;
+	
+	/** 
+	 * 收银台页面上,商品展示的超链接。
+	 **/
+	private $showUrl;
+	
+	/** 
+	 * 商品的标题/交易标题/订单标题/订单关键字等。
+该参数最长为128个汉字
+	 **/
+	private $subject;
+	
+	/** 
+	 * 订单金额。该笔订单的资金总额,取值范围[0.01,100000000],精确到小数点后2位。
+	 **/
+	private $totalFee;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBody($body)
+	{
+		$this->body = $body;
+		$this->apiParas["body"] = $body;
+	}
+
+	public function getBody()
+	{
+		return $this->body;
+	}
+
+	public function setBuyerEmail($buyerEmail)
+	{
+		$this->buyerEmail = $buyerEmail;
+		$this->apiParas["buyer_email"] = $buyerEmail;
+	}
+
+	public function getBuyerEmail()
+	{
+		return $this->buyerEmail;
+	}
+
+	public function setBuyerId($buyerId)
+	{
+		$this->buyerId = $buyerId;
+		$this->apiParas["buyer_id"] = $buyerId;
+	}
+
+	public function getBuyerId()
+	{
+		return $this->buyerId;
+	}
+
+	public function setChannelParameters($channelParameters)
+	{
+		$this->channelParameters = $channelParameters;
+		$this->apiParas["channel_parameters"] = $channelParameters;
+	}
+
+	public function getChannelParameters()
+	{
+		return $this->channelParameters;
+	}
+
+	public function setCurrency($currency)
+	{
+		$this->currency = $currency;
+		$this->apiParas["currency"] = $currency;
+	}
+
+	public function getCurrency()
+	{
+		return $this->currency;
+	}
+
+	public function setExtendParams($extendParams)
+	{
+		$this->extendParams = $extendParams;
+		$this->apiParas["extend_params"] = $extendParams;
+	}
+
+	public function getExtendParams()
+	{
+		return $this->extendParams;
+	}
+
+	public function setGoodsDetail($goodsDetail)
+	{
+		$this->goodsDetail = $goodsDetail;
+		$this->apiParas["goods_detail"] = $goodsDetail;
+	}
+
+	public function getGoodsDetail()
+	{
+		return $this->goodsDetail;
+	}
+
+	public function setItBPay($itBPay)
+	{
+		$this->itBPay = $itBPay;
+		$this->apiParas["it_b_pay"] = $itBPay;
+	}
+
+	public function getItBPay()
+	{
+		return $this->itBPay;
+	}
+
+	public function setMcardParameters($mcardParameters)
+	{
+		$this->mcardParameters = $mcardParameters;
+		$this->apiParas["mcard_parameters"] = $mcardParameters;
+	}
+
+	public function getMcardParameters()
+	{
+		return $this->mcardParameters;
+	}
+
+	public function setOperatorCode($operatorCode)
+	{
+		$this->operatorCode = $operatorCode;
+		$this->apiParas["operator_code"] = $operatorCode;
+	}
+
+	public function getOperatorCode()
+	{
+		return $this->operatorCode;
+	}
+
+	public function setOperatorId($operatorId)
+	{
+		$this->operatorId = $operatorId;
+		$this->apiParas["operator_id"] = $operatorId;
+	}
+
+	public function getOperatorId()
+	{
+		return $this->operatorId;
+	}
+
+	public function setOutTradeNo($outTradeNo)
+	{
+		$this->outTradeNo = $outTradeNo;
+		$this->apiParas["out_trade_no"] = $outTradeNo;
+	}
+
+	public function getOutTradeNo()
+	{
+		return $this->outTradeNo;
+	}
+
+	public function setPrice($price)
+	{
+		$this->price = $price;
+		$this->apiParas["price"] = $price;
+	}
+
+	public function getPrice()
+	{
+		return $this->price;
+	}
+
+	public function setQuantity($quantity)
+	{
+		$this->quantity = $quantity;
+		$this->apiParas["quantity"] = $quantity;
+	}
+
+	public function getQuantity()
+	{
+		return $this->quantity;
+	}
+
+	public function setRefIds($refIds)
+	{
+		$this->refIds = $refIds;
+		$this->apiParas["ref_ids"] = $refIds;
+	}
+
+	public function getRefIds()
+	{
+		return $this->refIds;
+	}
+
+	public function setRoyaltyParameters($royaltyParameters)
+	{
+		$this->royaltyParameters = $royaltyParameters;
+		$this->apiParas["royalty_parameters"] = $royaltyParameters;
+	}
+
+	public function getRoyaltyParameters()
+	{
+		return $this->royaltyParameters;
+	}
+
+	public function setRoyaltyType($royaltyType)
+	{
+		$this->royaltyType = $royaltyType;
+		$this->apiParas["royalty_type"] = $royaltyType;
+	}
+
+	public function getRoyaltyType()
+	{
+		return $this->royaltyType;
+	}
+
+	public function setSellerEmail($sellerEmail)
+	{
+		$this->sellerEmail = $sellerEmail;
+		$this->apiParas["seller_email"] = $sellerEmail;
+	}
+
+	public function getSellerEmail()
+	{
+		return $this->sellerEmail;
+	}
+
+	public function setSellerId($sellerId)
+	{
+		$this->sellerId = $sellerId;
+		$this->apiParas["seller_id"] = $sellerId;
+	}
+
+	public function getSellerId()
+	{
+		return $this->sellerId;
+	}
+
+	public function setShowUrl($showUrl)
+	{
+		$this->showUrl = $showUrl;
+		$this->apiParas["show_url"] = $showUrl;
+	}
+
+	public function getShowUrl()
+	{
+		return $this->showUrl;
+	}
+
+	public function setSubject($subject)
+	{
+		$this->subject = $subject;
+		$this->apiParas["subject"] = $subject;
+	}
+
+	public function getSubject()
+	{
+		return $this->subject;
+	}
+
+	public function setTotalFee($totalFee)
+	{
+		$this->totalFee = $totalFee;
+		$this->apiParas["total_fee"] = $totalFee;
+	}
+
+	public function getTotalFee()
+	{
+		return $this->totalFee;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.acquire.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 1 - 1
sdk/alipay/aop/request/AlipayAcquireCreateandpayRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.acquire.createandpay request
  *
  * @author auto create
- * @since 1.0, 2016-11-22 19:31:24
+ * @since 1.0, 2019-07-18 14:08:22
  */
 class AlipayAcquireCreateandpayRequest
 {

+ 118 - 0
sdk/alipay/aop/request/AlipayAcquireOrderShipmentinfoGetRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.acquire.order.shipmentinfo.get request
+ *
+ * @author auto create
+ * @since 1.0, 2019-03-08 15:29:11
+ */
+class AlipayAcquireOrderShipmentinfoGetRequest
+{
+	/** 
+	 * 支付宝订单号
+	 **/
+	private $ordId;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setOrdId($ordId)
+	{
+		$this->ordId = $ordId;
+		$this->apiParas["ord_id"] = $ordId;
+	}
+
+	public function getOrdId()
+	{
+		return $this->ordId;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.acquire.order.shipmentinfo.get";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAcquireOverseasSpotCancelRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.acquire.overseas.spot.cancel request
+ *
+ * @author auto create
+ * @since 1.0, 2019-03-08 15:29:11
+ */
+class AlipayAcquireOverseasSpotCancelRequest
+{
+	/** 
+	 * The original partner transaction id given in the payment request
+	 **/
+	private $partnerTransId;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setPartnerTransId($partnerTransId)
+	{
+		$this->partnerTransId = $partnerTransId;
+		$this->apiParas["partner_trans_id"] = $partnerTransId;
+	}
+
+	public function getPartnerTransId()
+	{
+		return $this->partnerTransId;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.acquire.overseas.spot.cancel";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 262 - 0
sdk/alipay/aop/request/AlipayAcquireOverseasSpotPayRequest.php

@@ -0,0 +1,262 @@
+<?php
+/**
+ * ALIPAY API: alipay.acquire.overseas.spot.pay request
+ *
+ * @author auto create
+ * @since 1.0, 2019-03-08 15:29:11
+ */
+class AlipayAcquireOverseasSpotPayRequest
+{
+	/** 
+	 * Used as identification of a Alipay user.
+The format of the Buyer_identity_code varies depending on the identity_code_type
+	 **/
+	private $buyerIdentityCode;
+	
+	/** 
+	 * The currency used for labeling the price of the transaction;Refer to the acronym of currency table
+	 **/
+	private $currency;
+	
+	/** 
+	 * Containing the extended parameters of the request, it’s in JSON format.
+
+For now it contains the following parameters:
+merchant_name;
+merchant_no;
+business_no;
+terminal_id;
+mcc;
+region_code
+	 **/
+	private $extendInfo;
+	
+	/** 
+	 * he identity code type could be qrcode, barcode or soundwave;
+
+only barcode is supported for now
+	 **/
+	private $identityCodeType;
+	
+	/** 
+	 * Transaction notes
+	 **/
+	private $memo;
+	
+	/** 
+	 * The transaction Id on the partner system which could be a sale order id and payment order id. 
+Alipay system uses the partner_trans_id and the partner to identity a transaction on partner side
+	 **/
+	private $partnerTransId;
+	
+	/** 
+	 * There are three kinds of password: login password, payment password and mobile password.
+In the barcode payment scenario, the mobile password is used;
+
+3DES is used for encryption/ decryption.
+	 **/
+	private $password;
+	
+	/** 
+	 * the transaction amount in the currency given above;
+Range: 0.01-100000000.00. Two digits after decimal point
+	 **/
+	private $transAmount;
+	
+	/** 
+	 * The name of the transaction which will be shown in the transaction records list
+	 **/
+	private $transName;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBuyerIdentityCode($buyerIdentityCode)
+	{
+		$this->buyerIdentityCode = $buyerIdentityCode;
+		$this->apiParas["buyer_identity_code"] = $buyerIdentityCode;
+	}
+
+	public function getBuyerIdentityCode()
+	{
+		return $this->buyerIdentityCode;
+	}
+
+	public function setCurrency($currency)
+	{
+		$this->currency = $currency;
+		$this->apiParas["currency"] = $currency;
+	}
+
+	public function getCurrency()
+	{
+		return $this->currency;
+	}
+
+	public function setExtendInfo($extendInfo)
+	{
+		$this->extendInfo = $extendInfo;
+		$this->apiParas["extend_info"] = $extendInfo;
+	}
+
+	public function getExtendInfo()
+	{
+		return $this->extendInfo;
+	}
+
+	public function setIdentityCodeType($identityCodeType)
+	{
+		$this->identityCodeType = $identityCodeType;
+		$this->apiParas["identity_code_type"] = $identityCodeType;
+	}
+
+	public function getIdentityCodeType()
+	{
+		return $this->identityCodeType;
+	}
+
+	public function setMemo($memo)
+	{
+		$this->memo = $memo;
+		$this->apiParas["memo"] = $memo;
+	}
+
+	public function getMemo()
+	{
+		return $this->memo;
+	}
+
+	public function setPartnerTransId($partnerTransId)
+	{
+		$this->partnerTransId = $partnerTransId;
+		$this->apiParas["partner_trans_id"] = $partnerTransId;
+	}
+
+	public function getPartnerTransId()
+	{
+		return $this->partnerTransId;
+	}
+
+	public function setPassword($password)
+	{
+		$this->password = $password;
+		$this->apiParas["password"] = $password;
+	}
+
+	public function getPassword()
+	{
+		return $this->password;
+	}
+
+	public function setTransAmount($transAmount)
+	{
+		$this->transAmount = $transAmount;
+		$this->apiParas["trans_amount"] = $transAmount;
+	}
+
+	public function getTransAmount()
+	{
+		return $this->transAmount;
+	}
+
+	public function setTransName($transName)
+	{
+		$this->transName = $transName;
+		$this->apiParas["trans_name"] = $transName;
+	}
+
+	public function getTransName()
+	{
+		return $this->transName;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.acquire.overseas.spot.pay";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 184 - 0
sdk/alipay/aop/request/AlipayAcquireOverseasSpotRefundRequest.php

@@ -0,0 +1,184 @@
+<?php
+/**
+ * ALIPAY API: alipay.acquire.overseas.spot.refund request
+ *
+ * @author auto create
+ * @since 1.0, 2019-03-08 15:29:11
+ */
+class AlipayAcquireOverseasSpotRefundRequest
+{
+	/** 
+	 * refund currency
+	 **/
+	private $currency;
+	
+	/** 
+	 * The refund order id on partner system.
+
+partner_refund_id together with partner identify a refund transaction
+	 **/
+	private $partnerRefundId;
+	
+	/** 
+	 * The original partner transaction id given in the payment request
+	 **/
+	private $partnerTransId;
+	
+	/** 
+	 * Less than or equal to the original transaction amont and the left transaction amount if ever refunded.
+	 **/
+	private $refundAmount;
+	
+	/** 
+	 * The reason of refund
+	 **/
+	private $refundReason;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setCurrency($currency)
+	{
+		$this->currency = $currency;
+		$this->apiParas["currency"] = $currency;
+	}
+
+	public function getCurrency()
+	{
+		return $this->currency;
+	}
+
+	public function setPartnerRefundId($partnerRefundId)
+	{
+		$this->partnerRefundId = $partnerRefundId;
+		$this->apiParas["partner_refund_id"] = $partnerRefundId;
+	}
+
+	public function getPartnerRefundId()
+	{
+		return $this->partnerRefundId;
+	}
+
+	public function setPartnerTransId($partnerTransId)
+	{
+		$this->partnerTransId = $partnerTransId;
+		$this->apiParas["partner_trans_id"] = $partnerTransId;
+	}
+
+	public function getPartnerTransId()
+	{
+		return $this->partnerTransId;
+	}
+
+	public function setRefundAmount($refundAmount)
+	{
+		$this->refundAmount = $refundAmount;
+		$this->apiParas["refund_amount"] = $refundAmount;
+	}
+
+	public function getRefundAmount()
+	{
+		return $this->refundAmount;
+	}
+
+	public function setRefundReason($refundReason)
+	{
+		$this->refundReason = $refundReason;
+		$this->apiParas["refund_reason"] = $refundReason;
+	}
+
+	public function getRefundReason()
+	{
+		return $this->refundReason;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.acquire.overseas.spot.refund";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAcquireOverseasSpotReverseRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.acquire.overseas.spot.reverse request
+ *
+ * @author auto create
+ * @since 1.0, 2019-03-08 15:29:11
+ */
+class AlipayAcquireOverseasSpotReverseRequest
+{
+	/** 
+	 * The original partner transaction id given in the payment request
+	 **/
+	private $partnerTransId;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setPartnerTransId($partnerTransId)
+	{
+		$this->partnerTransId = $partnerTransId;
+		$this->apiParas["partner_trans_id"] = $partnerTransId;
+	}
+
+	public function getPartnerTransId()
+	{
+		return $this->partnerTransId;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.acquire.overseas.spot.reverse";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 1 - 1
sdk/alipay/aop/request/AlipayAcquirePrecreateRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.acquire.precreate request
  *
  * @author auto create
- * @since 1.0, 2014-05-28 11:57:10
+ * @since 1.0, 2019-03-08 15:29:11
  */
 class AlipayAcquirePrecreateRequest
 {

+ 1 - 1
sdk/alipay/aop/request/AlipayAcquireQueryRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.acquire.query request
  *
  * @author auto create
- * @since 1.0, 2014-05-28 11:58:01
+ * @since 1.0, 2019-03-08 15:29:11
  */
 class AlipayAcquireQueryRequest
 {

+ 1 - 1
sdk/alipay/aop/request/AlipayAcquireRefundRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.acquire.refund request
  *
  * @author auto create
- * @since 1.0, 2014-06-12 17:17:03
+ * @since 1.0, 2019-03-08 15:29:11
  */
 class AlipayAcquireRefundRequest
 {

+ 1 - 1
sdk/alipay/aop/request/AlipayAppTokenGetRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.app.token.get request
  *
  * @author auto create
- * @since 1.0, 2016-07-29 19:56:12
+ * @since 1.0, 2019-03-26 17:00:00
  */
 class AlipayAppTokenGetRequest
 {

+ 118 - 0
sdk/alipay/aop/request/AlipayAssetAssetorderBatchqueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.asset.assetorder.batchquery request
+ *
+ * @author auto create
+ * @since 1.0, 2019-02-25 15:44:49
+ */
+class AlipayAssetAssetorderBatchqueryRequest
+{
+	/** 
+	 * alipay.asset.card.query(卡资产订单查询)
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.asset.assetorder.batchquery";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 5 - 5
sdk/alipay/aop/request/AlipayTrustUserRiskSummaryGetRequest.php → sdk/alipay/aop/request/AlipayAssetCardDisburseRequest.php

@@ -1,14 +1,14 @@
 <?php
 /**
- * ALIPAY API: alipay.trust.user.risk.summary.get request
+ * ALIPAY API: alipay.asset.card.disburse request
  *
  * @author auto create
- * @since 1.0, 2016-03-04 11:36:29
+ * @since 1.0, 2019-04-28 14:37:51
  */
-class AlipayTrustUserRiskSummaryGetRequest
+class AlipayAssetCardDisburseRequest
 {
 	/** 
-	 * 描述用户信息
+	 * alipay.asset.card.disburse(打款)
 	 **/
 	private $bizContent;
 
@@ -35,7 +35,7 @@ class AlipayTrustUserRiskSummaryGetRequest
 
 	public function getApiMethodName()
 	{
-		return "alipay.trust.user.risk.summary.get";
+		return "alipay.asset.card.disburse";
 	}
 
 	public function setNotifyUrl($notifyUrl)

+ 118 - 0
sdk/alipay/aop/request/AlipayAssetCardNewtemplateCreateRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.asset.card.newtemplate.create request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AlipayAssetCardNewtemplateCreateRequest
+{
+	/** 
+	 * 外部商户标准卡模板创建
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.asset.card.newtemplate.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAssetCardReturnRefundRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.asset.card.return.refund request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AlipayAssetCardReturnRefundRequest
+{
+	/** 
+	 * 外部商户标准卡退款
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.asset.card.return.refund";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAssetCardTransferRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.asset.card.transfer request
+ *
+ * @author auto create
+ * @since 1.0, 2019-04-28 14:48:45
+ */
+class AlipayAssetCardTransferRequest
+{
+	/** 
+	 * alipay.asset.card.transfer(外部商户标准卡资产转移)
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.asset.card.transfer";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAssetPointAccountlogQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.asset.point.accountlog.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AlipayAssetPointAccountlogQueryRequest
+{
+	/** 
+	 * 用户集分宝流水明细查询
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.asset.point.accountlog.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 1 - 1
sdk/alipay/aop/request/AlipayAssetPointBalanceQueryRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.asset.point.balance.query request
  *
  * @author auto create
- * @since 1.0, 2016-07-29 19:52:37
+ * @since 1.0, 2019-01-07 20:51:15
  */
 class AlipayAssetPointBalanceQueryRequest
 {

+ 1 - 1
sdk/alipay/aop/request/AlipayAssetPointBudgetQueryRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.asset.point.budget.query request
  *
  * @author auto create
- * @since 1.0, 2016-07-29 19:52:25
+ * @since 1.0, 2019-01-07 20:51:15
  */
 class AlipayAssetPointBudgetQueryRequest
 {

+ 1 - 1
sdk/alipay/aop/request/AlipayAssetPointOrderCreateRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.asset.point.order.create request
  *
  * @author auto create
- * @since 1.0, 2016-07-29 19:52:44
+ * @since 1.0, 2019-01-07 20:51:15
  */
 class AlipayAssetPointOrderCreateRequest
 {

+ 1 - 1
sdk/alipay/aop/request/AlipayAssetPointOrderQueryRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.asset.point.order.query request
  *
  * @author auto create
- * @since 1.0, 2016-07-29 19:52:31
+ * @since 1.0, 2019-01-07 20:51:15
  */
 class AlipayAssetPointOrderQueryRequest
 {

+ 118 - 0
sdk/alipay/aop/request/AlipayAssetPointPointprodBudgetlibAddRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.asset.point.pointprod.budgetlib.add request
+ *
+ * @author auto create
+ * @since 1.0, 2019-08-29 17:46:02
+ */
+class AlipayAssetPointPointprodBudgetlibAddRequest
+{
+	/** 
+	 * 预算库追加
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.asset.point.pointprod.budgetlib.add";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAssetPointPointprodBudgetlibCreateRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.asset.point.pointprod.budgetlib.create request
+ *
+ * @author auto create
+ * @since 1.0, 2019-08-29 17:46:08
+ */
+class AlipayAssetPointPointprodBudgetlibCreateRequest
+{
+	/** 
+	 * 集分宝预算库创建
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.asset.point.pointprod.budgetlib.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAssetPointPointprodBudgetlibModifyRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.asset.point.pointprod.budgetlib.modify request
+ *
+ * @author auto create
+ * @since 1.0, 2019-08-29 17:46:42
+ */
+class AlipayAssetPointPointprodBudgetlibModifyRequest
+{
+	/** 
+	 * 预算库有效期修改
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.asset.point.pointprod.budgetlib.modify";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAssetPointPointprodBudgetlibQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.asset.point.pointprod.budgetlib.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-08-29 17:45:47
+ */
+class AlipayAssetPointPointprodBudgetlibQueryRequest
+{
+	/** 
+	 * 集分宝预算库查询
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.asset.point.pointprod.budgetlib.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAssetPointPointprodBudgetlibReturnRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.asset.point.pointprod.budgetlib.return request
+ *
+ * @author auto create
+ * @since 1.0, 2019-08-21 10:05:01
+ */
+class AlipayAssetPointPointprodBudgetlibReturnRequest
+{
+	/** 
+	 * 集分宝预算库预算回收
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.asset.point.pointprod.budgetlib.return";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAssetPointPointprodPointlibQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.asset.point.pointprod.pointlib.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-08-30 17:14:12
+ */
+class AlipayAssetPointPointprodPointlibQueryRequest
+{
+	/** 
+	 * 集分宝积分库查询
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.asset.point.pointprod.pointlib.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAssetVoucherVoucherDirectuseRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.asset.voucher.voucher.directuse request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AlipayAssetVoucherVoucherDirectuseRequest
+{
+	/** 
+	 * 直接使用券核销
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.asset.voucher.voucher.directuse";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayAssetVoucherprodChargeSendRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.asset.voucherprod.charge.send request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AlipayAssetVoucherprodChargeSendRequest
+{
+	/** 
+	 * 外部商户标准发卡并充值
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.asset.voucherprod.charge.send";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 134 - 0
sdk/alipay/aop/request/AlipayBaitiaoprodAccountQueryRequest.php

@@ -0,0 +1,134 @@
+<?php
+/**
+ * ALIPAY API: alipay.baitiaoprod.account.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-03-08 15:29:11
+ */
+class AlipayBaitiaoprodAccountQueryRequest
+{
+	/** 
+	 * 用户账号id,可以是淘宝账号ID,或者支付宝账号ID
+	 **/
+	private $userId;
+	
+	/** 
+	 * 用户账号类型,可以是淘宝账号=taobao,或者是支付宝账号=alipay,不区分大小写
+	 **/
+	private $userIdType;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setUserId($userId)
+	{
+		$this->userId = $userId;
+		$this->apiParas["user_id"] = $userId;
+	}
+
+	public function getUserId()
+	{
+		return $this->userId;
+	}
+
+	public function setUserIdType($userIdType)
+	{
+		$this->userIdType = $userIdType;
+		$this->apiParas["user_id_type"] = $userIdType;
+	}
+
+	public function getUserIdType()
+	{
+		return $this->userIdType;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.baitiaoprod.account.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 134 - 0
sdk/alipay/aop/request/AlipayBaitiaoprodSellerQueryRequest.php

@@ -0,0 +1,134 @@
+<?php
+/**
+ * ALIPAY API: alipay.baitiaoprod.seller.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-03-08 15:29:11
+ */
+class AlipayBaitiaoprodSellerQueryRequest
+{
+	/** 
+	 * 卖家账号id
+	 **/
+	private $sellerId;
+	
+	/** 
+	 * 对应接口参数seller_id(卖家账号)类型,TAOBAO/ALIPAY
+	 **/
+	private $sellerIdType;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setSellerId($sellerId)
+	{
+		$this->sellerId = $sellerId;
+		$this->apiParas["seller_id"] = $sellerId;
+	}
+
+	public function getSellerId()
+	{
+		return $this->sellerId;
+	}
+
+	public function setSellerIdType($sellerIdType)
+	{
+		$this->sellerIdType = $sellerIdType;
+		$this->apiParas["seller_id_type"] = $sellerIdType;
+	}
+
+	public function getSellerIdType()
+	{
+		return $this->sellerIdType;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.baitiaoprod.seller.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBaitiaoprodSellerStatusQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.baitiaoprod.seller.status.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-03-08 15:29:11
+ */
+class AlipayBaitiaoprodSellerStatusQueryRequest
+{
+	/** 
+	 * 卖家淘宝账号id
+	 **/
+	private $taobaoSellerId;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setTaobaoSellerId($taobaoSellerId)
+	{
+		$this->taobaoSellerId = $taobaoSellerId;
+		$this->apiParas["taobao_seller_id"] = $taobaoSellerId;
+	}
+
+	public function getTaobaoSellerId()
+	{
+		return $this->taobaoSellerId;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.baitiaoprod.seller.status.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 134 - 0
sdk/alipay/aop/request/AlipayBizprodTestRequest.php

@@ -0,0 +1,134 @@
+<?php
+/**
+ * ALIPAY API: alipay.bizprod.test request
+ *
+ * @author auto create
+ * @since 1.0, 2019-03-08 15:29:11
+ */
+class AlipayBizprodTestRequest
+{
+	/** 
+	 * 年龄
+	 **/
+	private $age;
+	
+	/** 
+	 * 用户名
+	 **/
+	private $name;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setAge($age)
+	{
+		$this->age = $age;
+		$this->apiParas["age"] = $age;
+	}
+
+	public function getAge()
+	{
+		return $this->age;
+	}
+
+	public function setName($name)
+	{
+		$this->name = $name;
+		$this->apiParas["name"] = $name;
+	}
+
+	public function getName()
+	{
+		return $this->name;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.bizprod.test";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 4 - 4
sdk/alipay/aop/request/AlipayOfflineMarketShopAlbumQueryRequest.php → sdk/alipay/aop/request/AlipayBossBaseAfgsdhRequest.php

@@ -1,11 +1,11 @@
 <?php
 /**
- * ALIPAY API: alipay.offline.market.shop.album.query request
+ * ALIPAY API: alipay.boss.base.afgsdh request
  *
  * @author auto create
- * @since 1.0, 2015-10-14 21:56:37
+ * @since 1.0, 2019-01-07 20:51:15
  */
-class AlipayOfflineMarketShopAlbumQueryRequest
+class AlipayBossBaseAfgsdhRequest
 {
 
 	private $apiParas = array();
@@ -20,7 +20,7 @@ class AlipayOfflineMarketShopAlbumQueryRequest
 	
 	public function getApiMethodName()
 	{
-		return "alipay.offline.market.shop.album.query";
+		return "alipay.boss.base.afgsdh";
 	}
 
 	public function setNotifyUrl($notifyUrl)

+ 118 - 0
sdk/alipay/aop/request/AlipayBossBaseProcessInstanceCancelRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.base.process.instance.cancel request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-06 15:00:49
+ */
+class AlipayBossBaseProcessInstanceCancelRequest
+{
+	/** 
+	 * 撤消流程实例
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.base.process.instance.cancel";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossBaseProcessInstanceCreateRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.base.process.instance.create request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-18 12:01:06
+ */
+class AlipayBossBaseProcessInstanceCreateRequest
+{
+	/** 
+	 * 创建流程实例
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.base.process.instance.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossBaseProcessInstanceQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.base.process.instance.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-06 15:00:11
+ */
+class AlipayBossBaseProcessInstanceQueryRequest
+{
+	/** 
+	 * 查询流程实例
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.base.process.instance.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossBaseProcessSignVerifyRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.base.process.sign.verify request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-06 15:00:57
+ */
+class AlipayBossBaseProcessSignVerifyRequest
+{
+	/** 
+	 * 核实流程签名
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.base.process.sign.verify";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossBaseProcessTaskProcessRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.base.process.task.process request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-06 15:00:28
+ */
+class AlipayBossBaseProcessTaskProcessRequest
+{
+	/** 
+	 * 流程任务处理
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.base.process.task.process";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 134 - 0
sdk/alipay/aop/request/AlipayBossCommParameterRequest.php

@@ -0,0 +1,134 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.comm.parameter request
+ *
+ * @author auto create
+ * @since 1.0, 2019-03-08 15:29:11
+ */
+class AlipayBossCommParameterRequest
+{
+	/** 
+	 * 银行卡明文卡号
+	 **/
+	private $cardNo;
+	
+	/** 
+	 * 机构内标(instId)
+	 **/
+	private $instId;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setCardNo($cardNo)
+	{
+		$this->cardNo = $cardNo;
+		$this->apiParas["card_no"] = $cardNo;
+	}
+
+	public function getCardNo()
+	{
+		return $this->cardNo;
+	}
+
+	public function setInstId($instId)
+	{
+		$this->instId = $instId;
+		$this->apiParas["inst_id"] = $instId;
+	}
+
+	public function getInstId()
+	{
+		return $this->instId;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.comm.parameter";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossContractManagementCancelRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.contract.management.cancel request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-25 18:33:32
+ */
+class AlipayBossContractManagementCancelRequest
+{
+	/** 
+	 * 撤销关联方合约审批
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.contract.management.cancel";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossContractManagementCreateRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.contract.management.create request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-25 18:33:59
+ */
+class AlipayBossContractManagementCreateRequest
+{
+	/** 
+	 * 开启蚂蚁关联交易合约审批接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.contract.management.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossContractManagementIdentifyRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.contract.management.identify request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-26 11:36:48
+ */
+class AlipayBossContractManagementIdentifyRequest
+{
+	/** 
+	 * 蚂蚁关联方识别
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.contract.management.identify";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossContractManagementQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.contract.management.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-26 11:24:05
+ */
+class AlipayBossContractManagementQueryRequest
+{
+	/** 
+	 * 蚂蚁关联交易合约审批信息查询
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.contract.management.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 103 - 0
sdk/alipay/aop/request/AlipayBossCsBizcategoryGetbyidQueryRequest.php

@@ -0,0 +1,103 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.cs.bizcategory.getbyid.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-07-05 14:24:25
+ */
+class AlipayBossCsBizcategoryGetbyidQueryRequest
+{
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function getApiMethodName()
+	{
+		return "alipay.boss.cs.bizcategory.getbyid.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 1 - 1
sdk/alipay/aop/request/AlipayBossCsChannelQueryRequest.php

@@ -3,7 +3,7 @@
  * ALIPAY API: alipay.boss.cs.channel.query request
  *
  * @author auto create
- * @since 1.0, 2016-02-23 20:04:44
+ * @since 1.0, 2019-01-07 20:51:15
  */
 class AlipayBossCsChannelQueryRequest
 {

+ 118 - 0
sdk/alipay/aop/request/AlipayBossCsCssocialYqmessageQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.cs.cssocial.yqmessage.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AlipayBossCsCssocialYqmessageQueryRequest
+{
+	/** 
+	 * 舆情数据通用搜索
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.cs.cssocial.yqmessage.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossCsDatacollectSendRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.cs.datacollect.send request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AlipayBossCsDatacollectSendRequest
+{
+	/** 
+	 * 舆情数据处理平台外部数据提交接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.cs.datacollect.send";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 5 - 5
sdk/alipay/aop/request/AlipayOpenAppPackagetestRequest.php → sdk/alipay/aop/request/AlipayBossFncAliooJehjSdfRequest.php

@@ -1,14 +1,14 @@
 <?php
 /**
- * ALIPAY API: alipay.open.app.packagetest request
+ * ALIPAY API: alipay.boss.fnc.alioo.jehj.sdf request
  *
  * @author auto create
- * @since 1.0, 2016-09-21 21:43:09
+ * @since 1.0, 2019-01-07 20:51:15
  */
-class AlipayOpenAppPackagetestRequest
+class AlipayBossFncAliooJehjSdfRequest
 {
 	/** 
-	 * ISP功能测试接口
+	 * afasd
 	 **/
 	private $bizContent;
 
@@ -35,7 +35,7 @@ class AlipayOpenAppPackagetestRequest
 
 	public function getApiMethodName()
 	{
-		return "alipay.open.app.packagetest";
+		return "alipay.boss.fnc.alioo.jehj.sdf";
 	}
 
 	public function setNotifyUrl($notifyUrl)

+ 118 - 0
sdk/alipay/aop/request/AlipayBossFncArbillMonthstatementbillQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.fnc.arbill.monthstatementbill.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-05 20:06:54
+ */
+class AlipayBossFncArbillMonthstatementbillQueryRequest
+{
+	/** 
+	 * AR对账单查询
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.fnc.arbill.monthstatementbill.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 4 - 4
sdk/alipay/aop/request/KoubeiMarketingDataCustomtagBatchqueryRequest.php → sdk/alipay/aop/request/AlipayBossFncContractManagementCreateRequest.php

@@ -1,11 +1,11 @@
 <?php
 /**
- * ALIPAY API: koubei.marketing.data.customtag.batchquery request
+ * ALIPAY API: alipay.boss.fnc.contract.management.create request
  *
  * @author auto create
- * @since 1.0, 2016-08-29 14:52:46
+ * @since 1.0, 2019-09-19 16:57:43
  */
-class KoubeiMarketingDataCustomtagBatchqueryRequest
+class AlipayBossFncContractManagementCreateRequest
 {
 
 	private $apiParas = array();
@@ -20,7 +20,7 @@ class KoubeiMarketingDataCustomtagBatchqueryRequest
 	
 	public function getApiMethodName()
 	{
-		return "koubei.marketing.data.customtag.batchquery";
+		return "alipay.boss.fnc.contract.management.create";
 	}
 
 	public function setNotifyUrl($notifyUrl)

+ 118 - 0
sdk/alipay/aop/request/AlipayBossFncInvoiceApplyRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.fnc.invoice.apply request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-12 15:41:52
+ */
+class AlipayBossFncInvoiceApplyRequest
+{
+	/** 
+	 * 应收开票申请(根据账单申请)
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.fnc.invoice.apply";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossFncInvoiceBatchqueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.fnc.invoice.batchquery request
+ *
+ * @author auto create
+ * @since 1.0, 2019-01-07 20:51:15
+ */
+class AlipayBossFncInvoiceBatchqueryRequest
+{
+	/** 
+	 * 应收发票综合查询
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.fnc.invoice.batchquery";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossFncInvoiceBilllinkamtBatchqueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.fnc.invoice.billlinkamt.batchquery request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-12 16:04:53
+ */
+class AlipayBossFncInvoiceBilllinkamtBatchqueryRequest
+{
+	/** 
+	 * 根据账单号获取关联的发票ID以及与账单相关的关联开票金额
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.fnc.invoice.billlinkamt.batchquery";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 5 - 5
sdk/alipay/aop/request/AlipayOfflineMarketLeadsQrcodeQueryRequest.php → sdk/alipay/aop/request/AlipayBossFncInvoiceLinkamtBatchqueryRequest.php

@@ -1,14 +1,14 @@
 <?php
 /**
- * ALIPAY API: alipay.offline.market.leads.qrcode.query request
+ * ALIPAY API: alipay.boss.fnc.invoice.linkamt.batchquery request
  *
  * @author auto create
- * @since 1.0, 2016-07-26 17:42:58
+ * @since 1.0, 2019-09-12 16:05:16
  */
-class AlipayOfflineMarketLeadsQrcodeQueryRequest
+class AlipayBossFncInvoiceLinkamtBatchqueryRequest
 {
 	/** 
-	 * 地推小二认领了Leads后申请创建开店二维码,提供给商户扫描开店。
+	 * 根据发票ID获取关联的账单号以及与本发票相关的关联开票金额
 	 **/
 	private $bizContent;
 
@@ -35,7 +35,7 @@ class AlipayOfflineMarketLeadsQrcodeQueryRequest
 
 	public function getApiMethodName()
 	{
-		return "alipay.offline.market.leads.qrcode.query";
+		return "alipay.boss.fnc.invoice.linkamt.batchquery";
 	}
 
 	public function setNotifyUrl($notifyUrl)

+ 118 - 0
sdk/alipay/aop/request/AlipayBossFncInvoiceMailinfoQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.fnc.invoice.mailinfo.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-12 16:04:22
+ */
+class AlipayBossFncInvoiceMailinfoQueryRequest
+{
+	/** 
+	 * 根据发票邮寄ID获取当前的邮寄信息
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.fnc.invoice.mailinfo.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossFncInvoiceQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.fnc.invoice.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-12 15:42:43
+ */
+class AlipayBossFncInvoiceQueryRequest
+{
+	/** 
+	 * 根据发票ID查询发票信息
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.fnc.invoice.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossFncInvoiceStatementbillApplyRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.fnc.invoice.statementbill.apply request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-05 16:28:12
+ */
+class AlipayBossFncInvoiceStatementbillApplyRequest
+{
+	/** 
+	 * 应收开票申请(根据查询到的对账单申请)
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.fnc.invoice.statementbill.apply";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossFncInvoicereceiptBatchqueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.fnc.invoicereceipt.batchquery request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-12 15:42:15
+ */
+class AlipayBossFncInvoicereceiptBatchqueryRequest
+{
+	/** 
+	 * 根据月账单号集合和来源查询开票单据及金额汇总
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.fnc.invoicereceipt.batchquery";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
sdk/alipay/aop/request/AlipayBossFncInvoicereceiptCreateRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.boss.fnc.invoicereceipt.create request
+ *
+ * @author auto create
+ * @since 1.0, 2019-09-12 15:43:02
+ */
+class AlipayBossFncInvoicereceiptCreateRequest
+{
+	/** 
+	 * 账单变更同步接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.boss.fnc.invoicereceipt.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

部分文件因文件數量過多而無法顯示