2020.02新版
This commit is contained in:
21
plugins/alipay/config.ini
Normal file
21
plugins/alipay/config.ini
Normal file
@@ -0,0 +1,21 @@
|
||||
[config]
|
||||
;支付插件英文名称,需和目录名称一致,不能有重复
|
||||
name = "alipay"
|
||||
|
||||
;支付插件显示名称
|
||||
showname = "支付宝官方支付"
|
||||
|
||||
;支付插件作者
|
||||
author = "支付宝"
|
||||
|
||||
;支付插件作者链接
|
||||
link = "https://b.alipay.com/signing/productSetV2.htm"
|
||||
|
||||
;支付插件支持的支付方式,多种方式用英文,隔开,可选的有alipay,qqpay,wxpay,bank
|
||||
types = "alipay"
|
||||
|
||||
;支付插件要求传入的参数以及参数显示名称,可选的有appid,appkey,appsecret,appurl,appmchid
|
||||
inputs = "appid:应用APPID,appkey:支付宝公钥(RSA2),appsecret:商户私钥(RSA2)"
|
||||
|
||||
;支付插件要求传入的支付方式参数
|
||||
select = "1:电脑网站支付,2:手机网站支付,3:当面付扫码,4:JS支付"
|
||||
209
plugins/alipay/inc/AlipayCertifyService.php
Normal file
209
plugins/alipay/inc/AlipayCertifyService.php
Normal file
@@ -0,0 +1,209 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/19
|
||||
* Time: 下午2:09
|
||||
*/
|
||||
require_once PAY_ROOT.'inc/lib/AopClient.php';
|
||||
require_once PAY_ROOT.'inc/model/request/AlipayUserCertifyOpenInitializeRequest.php';
|
||||
require_once PAY_ROOT.'inc/model/request/AlipayUserCertifyOpenCertifyRequest.php';
|
||||
require_once PAY_ROOT.'inc/model/request/AlipayUserCertifyOpenQueryRequest.php';
|
||||
require PAY_ROOT.'inc/config.php';
|
||||
|
||||
class AlipayCertifyService {
|
||||
|
||||
//支付宝网关地址
|
||||
public $gateway_url = "https://openapi.alipay.com/gateway.do";
|
||||
|
||||
//异步通知回调地址
|
||||
public $notify_url;
|
||||
|
||||
//签名类型
|
||||
public $sign_type;
|
||||
|
||||
//支付宝公钥地址
|
||||
public $alipay_public_key;
|
||||
|
||||
//商户私钥地址
|
||||
public $private_key;
|
||||
|
||||
//授权回调地址
|
||||
public $return_url;
|
||||
|
||||
//应用id
|
||||
public $appid;
|
||||
|
||||
//编码格式
|
||||
public $charset = "UTF-8";
|
||||
|
||||
public $token = NULL;
|
||||
|
||||
//返回数据格式
|
||||
public $format = "json";
|
||||
|
||||
//签名方式
|
||||
public $signtype = "RSA";
|
||||
|
||||
|
||||
function __construct($alipay_config){
|
||||
$this->gateway_url = $alipay_config['gatewayUrl'];
|
||||
$this->appid = $alipay_config['app_id'];
|
||||
$this->sign_type = $alipay_config['sign_type'];
|
||||
$this->private_key = $alipay_config['merchant_private_key'];
|
||||
$this->alipay_public_key = $alipay_config['alipay_public_key'];
|
||||
$this->return_url = $alipay_config['cert_return_url'];
|
||||
$this->charset = $alipay_config['charset'];
|
||||
$this->signtype = $alipay_config['sign_type'];
|
||||
|
||||
if(empty($this->appid)||trim($this->appid)==""){
|
||||
throw new Exception("appid should not be NULL!");
|
||||
}
|
||||
if(empty($this->private_key)||trim($this->private_key)==""){
|
||||
throw new Exception("private_key should not be NULL!");
|
||||
}
|
||||
if(empty($this->alipay_public_key)||trim($this->alipay_public_key)==""){
|
||||
throw new Exception("alipay_public_key should not be NULL!");
|
||||
}
|
||||
if(empty($this->charset)||trim($this->charset)==""){
|
||||
throw new Exception("charset should not be NULL!");
|
||||
}
|
||||
if(empty($this->gateway_url)||trim($this->gateway_url)==""){
|
||||
throw new Exception("gateway_url should not be NULL!");
|
||||
}
|
||||
if(empty($this->sign_type)||trim($this->sign_type)==""){
|
||||
throw new Exception("sign_type should not be NULL");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//身份认证初始化服务
|
||||
public function initialize($outer_order_no, $cert_name, $cert_no, $biz_code = 'SMART_FACE') {
|
||||
|
||||
$BizContent = array(
|
||||
'outer_order_no' => $outer_order_no, //商户请求的唯一标识
|
||||
'biz_code' => $biz_code, //认证场景码
|
||||
'identity_param' => [
|
||||
'identity_type' => 'CERT_INFO', //身份信息参数类型
|
||||
'cert_type' => 'IDENTITY_CARD', //证件类型
|
||||
'cert_name' => $cert_name, //真实姓名
|
||||
'cert_no' => $cert_no, //证件号码
|
||||
],
|
||||
'merchant_config' => ['return_url'=>$this->return_url], //商户个性化配置
|
||||
);
|
||||
$request = new AlipayUserCertifyOpenInitializeRequest();
|
||||
$request->setBizContent(json_encode($BizContent));
|
||||
|
||||
$response = $this->aopclientRequestExecute($request);
|
||||
$response = $response->alipay_user_certify_open_initialize_response;
|
||||
|
||||
if(!empty($response->code)&&$response->code == 10000){
|
||||
$result = array('certify_id'=>$response->certify_id);
|
||||
}else{
|
||||
$result = array('code'=>$response->code, 'msg'=>$response->msg, 'sub_code'=>$response->sub_code, 'sub_msg'=>$response->sub_msg);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
//身份认证开始认证
|
||||
public function certify($certify_id) {
|
||||
|
||||
$BizContent = array(
|
||||
'certify_id' => $certify_id,
|
||||
);
|
||||
$request = new AlipayUserCertifyOpenCertifyRequest();
|
||||
$request->setBizContent(json_encode($BizContent));
|
||||
|
||||
$response = $this->aopclientRequestPageExecute($request);
|
||||
|
||||
return $response;
|
||||
|
||||
}
|
||||
|
||||
//身份认证记录查询
|
||||
public function query($certify_id) {
|
||||
|
||||
$BizContent = array(
|
||||
'certify_id' => $certify_id,
|
||||
);
|
||||
$request = new AlipayUserCertifyOpenQueryRequest();
|
||||
$request->setBizContent(json_encode($BizContent));
|
||||
|
||||
$response = $this->aopclientRequestExecute($request);
|
||||
$response = $response->alipay_user_certify_open_query_response;
|
||||
|
||||
if(!empty($response->code)&&$response->code == 10000){
|
||||
$result = array('passed'=>$response->passed[0], 'identity_info'=>$response->identity_info, 'material_info'=>$response->material_info);
|
||||
}else{
|
||||
$result = array('code'=>$response->code, 'msg'=>$response->msg, 'sub_code'=>$response->sub_code, 'sub_msg'=>$response->sub_msg);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用SDK执行提交页面接口请求
|
||||
* @param unknown $request
|
||||
* @param string $token
|
||||
* @param string $appAuthToken
|
||||
* @return string $$result
|
||||
*/
|
||||
private function aopclientRequestExecute($request, $token = NULL, $appAuthToken = NULL) {
|
||||
|
||||
$aop = new AopClient ();
|
||||
$aop->gatewayUrl = $this->gateway_url;
|
||||
$aop->appId = $this->appid;
|
||||
$aop->signType = $this->sign_type;
|
||||
$aop->rsaPrivateKey = $this->private_key;
|
||||
$aop->alipayrsaPublicKey = $this->alipay_public_key;
|
||||
$aop->apiVersion = "1.0";
|
||||
$aop->postCharset = $this->charset;
|
||||
|
||||
$aop->format=$this->format;
|
||||
// 开启页面信息输出
|
||||
$aop->debugInfo=true;
|
||||
$result = $aop->execute($request,$token,$appAuthToken);
|
||||
|
||||
//打开后,将url形式请求报文写入log文件
|
||||
//$this->writeLog("response: ".var_export($result,true));
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用SDK执行提交页面接口请求
|
||||
* @param unknown $request
|
||||
* @param string $token
|
||||
* @param string $appAuthToken
|
||||
* @return string $$result
|
||||
*/
|
||||
private function aopclientRequestPageExecute($request, $token = NULL, $appAuthToken = NULL) {
|
||||
|
||||
$aop = new AopClient ();
|
||||
$aop->gatewayUrl = $this->gateway_url;
|
||||
$aop->appId = $this->appid;
|
||||
$aop->signType = $this->sign_type;
|
||||
$aop->rsaPrivateKey = $this->private_key;
|
||||
$aop->alipayrsaPublicKey = $this->alipay_public_key;
|
||||
$aop->apiVersion = "1.0";
|
||||
$aop->postCharset = $this->charset;
|
||||
|
||||
$aop->format=$this->format;
|
||||
// 开启页面信息输出
|
||||
$aop->debugInfo=true;
|
||||
$result = $aop->pageExecute($request,$token,$appAuthToken);
|
||||
|
||||
//打开后,将url形式请求报文写入log文件
|
||||
//$this->writeLog("response: ".var_export($result,true));
|
||||
return $result;
|
||||
}
|
||||
|
||||
function writeLog($text) {
|
||||
// $text=iconv("GBK", "UTF-8//IGNORE", $text);
|
||||
//$text = characet ( $text );
|
||||
file_put_contents ( PAY_ROOT."inc/log/log.txt", date ( "Y-m-d H:i:s" ) . " " . $text . "\r\n", FILE_APPEND );
|
||||
}
|
||||
|
||||
}
|
||||
167
plugins/alipay/inc/AlipayOauthService.php
Normal file
167
plugins/alipay/inc/AlipayOauthService.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/19
|
||||
* Time: 下午2:09
|
||||
*/
|
||||
require_once PAY_ROOT.'inc/lib/AopClient.php';
|
||||
require_once PAY_ROOT.'inc/model/request/AlipaySystemOauthTokenRequest.php';
|
||||
require_once PAY_ROOT.'inc/model/request/AlipayUserInfoShareRequest.php';
|
||||
require PAY_ROOT.'inc/config.php';
|
||||
|
||||
class AlipayOauthService {
|
||||
|
||||
//支付宝网关地址
|
||||
public $gateway_url = "https://openapi.alipay.com/gateway.do";
|
||||
|
||||
//异步通知回调地址
|
||||
public $notify_url;
|
||||
|
||||
//签名类型
|
||||
public $sign_type;
|
||||
|
||||
//支付宝公钥地址
|
||||
public $alipay_public_key;
|
||||
|
||||
//商户私钥地址
|
||||
public $private_key;
|
||||
|
||||
//授权回调地址
|
||||
public $redirect_uri;
|
||||
|
||||
//应用id
|
||||
public $appid;
|
||||
|
||||
//编码格式
|
||||
public $charset = "UTF-8";
|
||||
|
||||
public $token = NULL;
|
||||
|
||||
//返回数据格式
|
||||
public $format = "json";
|
||||
|
||||
//签名方式
|
||||
public $signtype = "RSA";
|
||||
|
||||
|
||||
function __construct($alipay_config){
|
||||
$this->gateway_url = $alipay_config['gatewayUrl'];
|
||||
$this->appid = $alipay_config['app_id'];
|
||||
$this->sign_type = $alipay_config['sign_type'];
|
||||
$this->private_key = $alipay_config['merchant_private_key'];
|
||||
$this->alipay_public_key = $alipay_config['alipay_public_key'];
|
||||
$this->redirect_uri = $alipay_config['redirect_uri'];
|
||||
$this->charset = $alipay_config['charset'];
|
||||
$this->signtype = $alipay_config['sign_type'];
|
||||
|
||||
if(empty($this->appid)||trim($this->appid)==""){
|
||||
throw new Exception("appid should not be NULL!");
|
||||
}
|
||||
if(empty($this->private_key)||trim($this->private_key)==""){
|
||||
throw new Exception("private_key should not be NULL!");
|
||||
}
|
||||
if(empty($this->alipay_public_key)||trim($this->alipay_public_key)==""){
|
||||
throw new Exception("alipay_public_key should not be NULL!");
|
||||
}
|
||||
if(empty($this->charset)||trim($this->charset)==""){
|
||||
throw new Exception("charset should not be NULL!");
|
||||
}
|
||||
if(empty($this->gateway_url)||trim($this->gateway_url)==""){
|
||||
throw new Exception("gateway_url should not be NULL!");
|
||||
}
|
||||
if(empty($this->sign_type)||trim($this->sign_type)==""){
|
||||
throw new Exception("sign_type should not be NULL");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//跳转支付宝授权页面
|
||||
public function oauth() {
|
||||
|
||||
$param = array('app_id'=>$this->appid, 'scope'=>'auth_base', 'redirect_uri'=>$this->redirect_uri);
|
||||
$url = 'https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?'.http_build_query($param);
|
||||
|
||||
Header("Location: $url");
|
||||
exit();
|
||||
|
||||
}
|
||||
|
||||
//换取授权访问令牌
|
||||
public function getToken($code, $grant_type = 'authorization_code') {
|
||||
|
||||
$request = new AlipaySystemOauthTokenRequest();
|
||||
if($grant_type == 'refresh_token'){
|
||||
$request->setGrantType("refresh_token");
|
||||
$request->setRefreshToken($code);
|
||||
}else{
|
||||
$request->setGrantType("authorization_code");
|
||||
$request->setCode($code);
|
||||
}
|
||||
|
||||
$response = $this->aopclientRequestExecute($request);
|
||||
$response = $response->alipay_system_oauth_token_response;
|
||||
|
||||
if(!empty($response) && $response->user_id){
|
||||
$result = array('user_id'=>$response->user_id, 'access_token'=>$response->access_token);
|
||||
}else{
|
||||
$result = array('code'=>$response->code, 'msg'=>$response->msg, 'sub_code'=>$response->sub_code, 'sub_msg'=>$response->sub_msg);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
//支付宝会员授权信息查询
|
||||
public function userinfo($accessToken) {
|
||||
|
||||
$request = new AlipayUserInfoShareRequest();
|
||||
|
||||
$response = $this->aopclientRequestExecute($request, $accessToken);
|
||||
$response = $response->alipay_user_info_share_response;
|
||||
|
||||
if(!empty($response) && $response->code == "10000"){
|
||||
$result = json_decode(json_encode($response), true);
|
||||
}else{
|
||||
$result = array('code'=>$response->code, 'msg'=>$response->msg, 'sub_code'=>$response->sub_code, 'sub_msg'=>$response->sub_msg);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用SDK执行提交页面接口请求
|
||||
* @param unknown $request
|
||||
* @param string $token
|
||||
* @param string $appAuthToken
|
||||
* @return string $$result
|
||||
*/
|
||||
private function aopclientRequestExecute($request, $token = NULL, $appAuthToken = NULL) {
|
||||
|
||||
$aop = new AopClient ();
|
||||
$aop->gatewayUrl = $this->gateway_url;
|
||||
$aop->appId = $this->appid;
|
||||
$aop->signType = $this->sign_type;
|
||||
$aop->rsaPrivateKey = $this->private_key;
|
||||
$aop->alipayrsaPublicKey = $this->alipay_public_key;
|
||||
$aop->apiVersion = "1.0";
|
||||
$aop->postCharset = $this->charset;
|
||||
|
||||
$aop->format=$this->format;
|
||||
// 开启页面信息输出
|
||||
$aop->debugInfo=true;
|
||||
$result = $aop->execute($request,$token,$appAuthToken);
|
||||
|
||||
//打开后,将url形式请求报文写入log文件
|
||||
//$this->writeLog("response: ".var_export($result,true));
|
||||
return $result;
|
||||
}
|
||||
|
||||
function writeLog($text) {
|
||||
// $text=iconv("GBK", "UTF-8//IGNORE", $text);
|
||||
//$text = characet ( $text );
|
||||
file_put_contents ( PAY_ROOT."inc/log/log.txt", date ( "Y-m-d H:i:s" ) . " " . $text . "\r\n", FILE_APPEND );
|
||||
}
|
||||
|
||||
}
|
||||
394
plugins/alipay/inc/AlipayTradeService.php
Normal file
394
plugins/alipay/inc/AlipayTradeService.php
Normal file
@@ -0,0 +1,394 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/19
|
||||
* Time: 下午2:09
|
||||
*/
|
||||
require_once PAY_ROOT.'inc/lib/AopClient.php';
|
||||
require_once PAY_ROOT.'inc/model/request/AlipayTradeCreateRequest.php';
|
||||
require_once PAY_ROOT.'inc/model/request/AlipayTradePagePayRequest.php';
|
||||
require_once PAY_ROOT.'inc/model/request/AlipayTradeWapPayRequest.php';
|
||||
require_once PAY_ROOT.'inc/model/request/AlipayTradePrecreateRequest.php';
|
||||
require_once PAY_ROOT.'inc/model/request/AlipayTradeQueryRequest.php';
|
||||
require_once PAY_ROOT.'inc/model/request/AlipayTradeRefundRequest.php';
|
||||
require_once PAY_ROOT.'inc/model/request/AlipayTradeCloseRequest.php';
|
||||
require_once PAY_ROOT.'inc/model/request/AlipayTradeFastpayRefundQueryRequest.php';
|
||||
require_once PAY_ROOT.'inc/model/result/AlipayF2FPrecreateResult.php';
|
||||
require_once PAY_ROOT.'inc/model/result/AlipayF2FQueryResult.php';
|
||||
require_once PAY_ROOT.'inc/model/result/AlipayF2FRefundResult.php';
|
||||
require_once PAY_ROOT.'inc/model/builder/AlipayTradeQueryContentBuilder.php';
|
||||
require PAY_ROOT.'inc/config.php';
|
||||
|
||||
class AlipayTradeService {
|
||||
|
||||
//支付宝网关地址
|
||||
public $gateway_url = "https://openapi.alipay.com/gateway.do";
|
||||
|
||||
//异步通知回调地址
|
||||
public $notify_url;
|
||||
|
||||
//同步通知回调地址
|
||||
public $return_url;
|
||||
|
||||
//签名类型
|
||||
public $sign_type;
|
||||
|
||||
//支付宝公钥地址
|
||||
public $alipay_public_key;
|
||||
|
||||
//商户私钥地址
|
||||
public $private_key;
|
||||
|
||||
//应用id
|
||||
public $appid;
|
||||
|
||||
//编码格式
|
||||
public $charset = "UTF-8";
|
||||
|
||||
|
||||
public $token = NULL;
|
||||
|
||||
//返回数据格式
|
||||
public $format = "json";
|
||||
|
||||
//签名方式
|
||||
public $signtype = "RSA2";
|
||||
|
||||
|
||||
function __construct($alipay_config){
|
||||
$this->gateway_url = $alipay_config['gatewayUrl'];
|
||||
$this->appid = $alipay_config['app_id'];
|
||||
$this->sign_type = $alipay_config['sign_type'];
|
||||
$this->private_key = $alipay_config['merchant_private_key'];
|
||||
$this->alipay_public_key = $alipay_config['alipay_public_key'];
|
||||
$this->charset = $alipay_config['charset'];
|
||||
$this->notify_url = $alipay_config['notify_url'];
|
||||
$this->return_url = $alipay_config['return_url'];
|
||||
$this->signtype = $alipay_config['sign_type'];
|
||||
|
||||
if(empty($this->appid)||trim($this->appid)==""){
|
||||
throw new Exception("appid should not be NULL!");
|
||||
}
|
||||
if(empty($this->private_key)||trim($this->private_key)==""){
|
||||
throw new Exception("private_key should not be NULL!");
|
||||
}
|
||||
if(empty($this->alipay_public_key)||trim($this->alipay_public_key)==""){
|
||||
throw new Exception("alipay_public_key should not be NULL!");
|
||||
}
|
||||
if(empty($this->charset)||trim($this->charset)==""){
|
||||
throw new Exception("charset should not be NULL!");
|
||||
}
|
||||
if(empty($this->gateway_url)||trim($this->gateway_url)==""){
|
||||
throw new Exception("gateway_url should not be NULL!");
|
||||
}
|
||||
if(empty($this->sign_type)||trim($this->sign_type)==""){
|
||||
throw new Exception("sign_type should not be NULL");
|
||||
}
|
||||
|
||||
}
|
||||
function AlipayWapPayService($alipay_config) {
|
||||
$this->__construct($alipay_config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用SDK执行提交页面接口请求
|
||||
* @param unknown $request
|
||||
* @param $ispage 是否是页面接口,电脑网站支付是页面表单接口。
|
||||
* @return string $result
|
||||
*/
|
||||
private function aopclientRequestExecute($request, $ispage=false) {
|
||||
|
||||
$aop = new AopClient ();
|
||||
$aop->gatewayUrl = $this->gateway_url;
|
||||
$aop->appId = $this->appid;
|
||||
$aop->signType = $this->sign_type;
|
||||
$aop->rsaPrivateKey = $this->private_key;
|
||||
$aop->alipayrsaPublicKey = $this->alipay_public_key;
|
||||
$aop->apiVersion = "1.0";
|
||||
$aop->postCharset = $this->charset;
|
||||
$aop->format=$this->format;
|
||||
// 开启页面信息输出
|
||||
$aop->debugInfo=true;
|
||||
if($ispage)
|
||||
{
|
||||
$result = $aop->pageExecute($request,"post");
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $aop->Execute($request);
|
||||
}
|
||||
|
||||
//打开后,将url形式请求报文写入log文件
|
||||
//$this->writeLog("response: ".var_export($result,true));
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* alipay.trade.create
|
||||
* @param $builder 业务参数,使用build中的对象生成。
|
||||
* @return $response 支付宝返回的信息
|
||||
*/
|
||||
public function create($req) {
|
||||
$bizContent = $req->getBizContent();
|
||||
$this->writeLog($bizContent);
|
||||
|
||||
$request = new AlipayTradeCreateRequest();
|
||||
$request->setBizContent ( $bizContent );
|
||||
$request->setNotifyUrl ( $this->notify_url );
|
||||
|
||||
// 首先调用支付api
|
||||
$response = $this->aopclientRequestExecute ( $request );
|
||||
$response = $response->alipay_trade_create_response;
|
||||
|
||||
$result = new AlipayF2FPrecreateResult($response);
|
||||
if(!empty($response)&&("10000"==$response->code)){
|
||||
$result->setTradeStatus("SUCCESS");
|
||||
} elseif($this->tradeError($response)){
|
||||
$result->setTradeStatus("UNKNOWN");
|
||||
} else {
|
||||
$result->setTradeStatus("FAILED");
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
//当面付2.0预下单(生成二维码)
|
||||
public function qrPay($req) {
|
||||
$bizContent = $req->getBizContent();
|
||||
$this->writeLog($bizContent);
|
||||
|
||||
$request = new AlipayTradePrecreateRequest();
|
||||
$request->setBizContent ( $bizContent );
|
||||
$request->setNotifyUrl ( $this->notify_url );
|
||||
|
||||
// 首先调用支付api
|
||||
$response = $this->aopclientRequestExecute ( $request );
|
||||
$response = $response->alipay_trade_precreate_response;
|
||||
|
||||
$result = new AlipayF2FPrecreateResult($response);
|
||||
if(!empty($response)&&("10000"==$response->code)){
|
||||
$result->setTradeStatus("SUCCESS");
|
||||
} elseif($this->tradeError($response)){
|
||||
$result->setTradeStatus("UNKNOWN");
|
||||
} else {
|
||||
$result->setTradeStatus("FAILED");
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* alipay.trade.page.pay
|
||||
* @param $builder 业务参数,使用build中的对象生成。
|
||||
* @return $response 支付宝返回的信息
|
||||
*/
|
||||
public function pagePay($builder) {
|
||||
|
||||
$biz_content=$builder->getBizContent();
|
||||
//打印业务参数
|
||||
$this->writeLog($biz_content);
|
||||
|
||||
$request = new AlipayTradePagePayRequest();
|
||||
|
||||
$request->setNotifyUrl($this->notify_url);
|
||||
$request->setReturnUrl($this->return_url);
|
||||
$request->setBizContent ( $biz_content );
|
||||
|
||||
// 首先调用支付api
|
||||
$response = $this->aopclientRequestExecute ($request,true);
|
||||
// $response = $response->alipay_trade_wap_pay_response;
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* alipay.trade.wap.pay
|
||||
* @param $builder 业务参数,使用build中的对象生成。
|
||||
* @return $response 支付宝返回的信息
|
||||
*/
|
||||
public function wapPay($builder) {
|
||||
|
||||
$biz_content=$builder->getBizContent();
|
||||
//打印业务参数
|
||||
$this->writeLog($biz_content);
|
||||
|
||||
$request = new AlipayTradeWapPayRequest();
|
||||
|
||||
$request->setNotifyUrl($this->notify_url);
|
||||
$request->setReturnUrl($this->return_url);
|
||||
$request->setBizContent ( $biz_content );
|
||||
|
||||
// 首先调用支付api
|
||||
$response = $this->aopclientRequestExecute ($request,true);
|
||||
// $response = $response->alipay_trade_wap_pay_response;
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* alipay.trade.refund (统一收单交易退款接口)
|
||||
* @param $builder 业务参数,使用build中的对象生成。
|
||||
* @return $response 支付宝返回的信息
|
||||
*/
|
||||
public function refund($req) {
|
||||
$bizContent = $req->getBizContent();
|
||||
$this->writeLog($bizContent);
|
||||
$request = new AlipayTradeRefundRequest();
|
||||
$request->setBizContent ( $bizContent );
|
||||
$response = $this->aopclientRequestExecute ( $request );
|
||||
|
||||
$response = $response->alipay_trade_refund_response;
|
||||
|
||||
$result = new AlipayF2FRefundResult($response);
|
||||
if(!empty($response)&&("10000"==$response->code)){
|
||||
$result->setTradeStatus("SUCCESS");
|
||||
} elseif ($this->tradeError($response)){
|
||||
$result->setTradeStatus("UNKNOWN");
|
||||
} else {
|
||||
$result->setTradeStatus("FAILED");
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* alipay.trade.close (统一收单交易关闭接口)
|
||||
* @param $builder 业务参数,使用build中的对象生成。
|
||||
* @return $response 支付宝返回的信息
|
||||
*/
|
||||
public function close($builder){
|
||||
$biz_content=$builder->getBizContent();
|
||||
//打印业务参数
|
||||
$this->writeLog($biz_content);
|
||||
$request = new AlipayTradeCloseRequest();
|
||||
$request->setBizContent ( $biz_content );
|
||||
|
||||
$response = $this->aopclientRequestExecute ($request);
|
||||
$response = $response->alipay_trade_close_response;
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款查询 alipay.trade.fastpay.refund.query (统一收单交易退款查询)
|
||||
* @param $builder 业务参数,使用build中的对象生成。
|
||||
* @return $response 支付宝返回的信息
|
||||
*/
|
||||
public function refundQuery($builder){
|
||||
$biz_content=$builder->getBizContent();
|
||||
//打印业务参数
|
||||
$this->writeLog($biz_content);
|
||||
$request = new AlipayTradeFastpayRefundQueryRequest();
|
||||
$request->setBizContent ( $biz_content );
|
||||
|
||||
$response = $this->aopclientRequestExecute ($request);
|
||||
$response = $response->alipay_trade_fastpay_refund_query_response;
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* alipay.trade.query (统一收单线下交易查询)
|
||||
* @param $builder 业务参数,使用build中的对象生成。
|
||||
* @return $response 支付宝返回的信息
|
||||
*/
|
||||
public function query($builder) {
|
||||
$biz_content = $builder->getBizContent();
|
||||
//$this->writeLog($biz_content);
|
||||
$request = new AlipayTradeQueryRequest();
|
||||
$request->setBizContent ( $biz_content );
|
||||
$response = $this->aopclientRequestExecute ( $request );
|
||||
|
||||
return $response->alipay_trade_query_response;
|
||||
}
|
||||
|
||||
/**
|
||||
* alipay.trade.query (统一收单线下交易查询)
|
||||
* @param $tradeNo 支付宝交易号
|
||||
* @return $response 支付宝返回的信息
|
||||
*/
|
||||
public function orderQuery($tradeNo) {
|
||||
$queryContentBuilder = new AlipayTradeQueryContentBuilder();
|
||||
$queryContentBuilder->setTradeNo($tradeNo);
|
||||
$response = $this->query($queryContentBuilder);
|
||||
return $response;
|
||||
}
|
||||
|
||||
// 当面付2.0消费查询
|
||||
public function queryTradeResult($req){
|
||||
$response = $this->query($req);
|
||||
$result = new AlipayF2FQueryResult($response);
|
||||
|
||||
if($this->querySuccess($response)){
|
||||
// 查询返回该订单交易支付成功
|
||||
$result->setTradeStatus("SUCCESS");
|
||||
|
||||
} elseif ($this->tradeError($response)){
|
||||
//查询发生异常或无返回,交易状态未知
|
||||
$result->setTradeStatus("UNKNOWN");
|
||||
} else {
|
||||
//其他情况均表明该订单号交易失败
|
||||
$result->setTradeStatus("FAILED");
|
||||
}
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
// 查询返回“支付成功”
|
||||
protected function querySuccess($queryResponse){
|
||||
return !empty($queryResponse)&&
|
||||
$queryResponse->code == "10000"&&
|
||||
($queryResponse->trade_status == "TRADE_SUCCESS"||
|
||||
$queryResponse->trade_status == "TRADE_FINISHED");
|
||||
}
|
||||
|
||||
// 查询返回“交易关闭”
|
||||
protected function queryClose($queryResponse){
|
||||
return !empty($queryResponse)&&
|
||||
$queryResponse->code == "10000"&&
|
||||
$queryResponse->trade_status == "TRADE_CLOSED";
|
||||
}
|
||||
|
||||
// 交易异常,或发生系统错误
|
||||
protected function tradeError($response){
|
||||
return empty($response)||
|
||||
$response->code == "20000";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* alipay.data.dataservice.bill.downloadurl.query (查询对账单下载地址)
|
||||
* @param $builder 业务参数,使用build中的对象生成。
|
||||
* @return $response 支付宝返回的信息
|
||||
*/
|
||||
public function downloadurlQuery($builder){
|
||||
$biz_content=$builder->getBizContent();
|
||||
//打印业务参数
|
||||
$this->writeLog($biz_content);
|
||||
$request = new alipaydatadataservicebilldownloadurlqueryRequest();
|
||||
$request->setBizContent ( $biz_content );
|
||||
|
||||
$response = $this->aopclientRequestExecute ($request);
|
||||
$response = $response->alipay_data_dataservice_bill_downloadurl_query_response;
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验签方法
|
||||
* @param $arr 验签支付宝返回的信息,使用支付宝公钥。
|
||||
* @return boolean
|
||||
*/
|
||||
public function check($arr){
|
||||
$aop = new AopClient();
|
||||
$aop->alipayrsaPublicKey = $this->alipay_public_key;
|
||||
$result = $aop->rsaCheckV1($arr, $this->alipay_public_key, $this->signtype);
|
||||
if($result){
|
||||
$queryResponse = $this->orderQuery($arr['trade_no']);
|
||||
$result = $this->querySuccess($queryResponse);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function writeLog($text) {
|
||||
// $text=iconv("GBK", "UTF-8//IGNORE", $text);
|
||||
//$text = characet ( $text );
|
||||
file_put_contents ( PAY_ROOT."inc/log/log.txt", date ( "Y-m-d H:i:s" ) . " " . $text . "\r\n", FILE_APPEND );
|
||||
}
|
||||
|
||||
}
|
||||
32
plugins/alipay/inc/config.php
Normal file
32
plugins/alipay/inc/config.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
$config = array (
|
||||
//签名方式,默认为RSA2(RSA2048)
|
||||
'sign_type' => "RSA2",
|
||||
|
||||
//支付宝公钥
|
||||
'alipay_public_key' => $channel['appkey'],
|
||||
|
||||
//商户私钥
|
||||
'merchant_private_key' => $channel['appsecret'],
|
||||
|
||||
//编码格式
|
||||
'charset' => "UTF-8",
|
||||
|
||||
//支付宝网关
|
||||
'gatewayUrl' => "https://openapi.alipay.com/gateway.do",
|
||||
|
||||
//应用ID
|
||||
'app_id' => $channel['appid'],
|
||||
|
||||
//异步通知地址
|
||||
'notify_url' => $conf['localurl'].'pay/alipay/notify/'.(defined("TRADE_NO")?TRADE_NO:$order['trade_no']).'/',
|
||||
|
||||
//同步通知地址
|
||||
'return_url' => $conf['localurl'].'pay/alipay/return/'.(defined("TRADE_NO")?TRADE_NO:$order['trade_no']).'/',
|
||||
|
||||
//登录返回页面
|
||||
'redirect_uri' => $siteurl.'user/oauth.php',
|
||||
|
||||
//实名认证返回页面
|
||||
'cert_return_url' => 'alipays://platformapi/startapp?appId=20000067&url='.urlencode($siteurl.'user/alipaycertok.php'),
|
||||
);
|
||||
1233
plugins/alipay/inc/lib/AopClient.php
Normal file
1233
plugins/alipay/inc/lib/AopClient.php
Normal file
File diff suppressed because it is too large
Load Diff
71
plugins/alipay/inc/lib/AopEncrypt.php
Normal file
71
plugins/alipay/inc/lib/AopEncrypt.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* 加密工具类
|
||||
*
|
||||
* User: jiehua
|
||||
* Date: 16/3/30
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解密方法
|
||||
* @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);
|
||||
|
||||
$encrypt_str = stripPKSC7Padding($encrypt_str);
|
||||
return $encrypt_str;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 填充算法
|
||||
* @param string $source
|
||||
* @return string
|
||||
*/
|
||||
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;
|
||||
}
|
||||
/**
|
||||
* 移去填充算法
|
||||
* @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;
|
||||
}
|
||||
45
plugins/alipay/inc/log/log.txt
Normal file
45
plugins/alipay/inc/log/log.txt
Normal file
@@ -0,0 +1,45 @@
|
||||
2019-12-30 15:18:58 {"out_trade_no":"2019123015185815959","total_amount":"0.01","subject":"测试商品"}
|
||||
2019-12-30 15:30:55 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2019123015305514985"}
|
||||
2019-12-30 15:31:39 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2019123015313972121"}
|
||||
2019-12-30 15:32:06 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2019123015320673406"}
|
||||
2019-12-30 15:34:10 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2019123015340950615"}
|
||||
2019-12-30 15:34:39 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2019123015343916030"}
|
||||
2019-12-30 15:35:38 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2019123015353897750"}
|
||||
2019-12-30 15:36:45 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2019123015364529263"}
|
||||
2019-12-30 15:39:07 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2019123015390790733"}
|
||||
2019-12-30 15:39:21 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.3","out_trade_no":"2019123015392165431"}
|
||||
2019-12-30 16:08:03 {"productCode":"QUICK_WAP_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2019123016080349544"}
|
||||
2019-12-30 16:10:04 {"productCode":"QUICK_WAP_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2019123016100418612"}
|
||||
2019-12-30 16:10:59 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2019123016105967452"}
|
||||
2019-12-30 16:11:17 {"out_trade_no":"2019123016111735380","total_amount":"0.01","subject":"测试商品"}
|
||||
2019-12-30 16:11:26 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2019123016112643188"}
|
||||
2019-12-30 16:11:35 {"out_trade_no":"2019123016113551465","total_amount":"0.01","subject":"测试商品"}
|
||||
2019-12-30 16:33:59 {"trade_no":"2019123022001480341405429596","refund_amount":"0.30"}
|
||||
2019-12-30 16:36:50 {"trade_no":"2019123022001480341405429596","refund_amount":"0.30"}
|
||||
2019-12-30 16:37:23 {"trade_no":"2019123022001455741404921978","refund_amount":"0.01"}
|
||||
2019-12-30 16:38:30 {"trade_no":"2019123022001455741404921978","refund_amount":"0.01"}
|
||||
2019-12-30 17:25:50 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.04","out_trade_no":"2019123017255031130"}
|
||||
2020-01-03 00:16:37 {"productCode":"QUICK_WAP_PAY","subject":"在线收款","total_amount":"1.00","out_trade_no":"2020010300163764737"}
|
||||
2020-01-03 09:08:39 {"out_trade_no":"2020010309083980824","total_amount":"1","subject":"onlinepay1578013719","buyer_id":"2088212878255745"}
|
||||
2020-01-03 09:11:10 {"out_trade_no":"2020010309111073082","total_amount":"1","subject":"onlinepay1578013870","buyer_id":"2088212878255745"}
|
||||
2020-01-03 09:12:06 {"out_trade_no":"2020010309120668907","total_amount":"1","subject":"onlinepay1578013926","buyer_id":"2088212878255745"}
|
||||
2020-01-03 09:13:21 {"out_trade_no":"2020010309132192903","total_amount":"1","subject":"onlinepay1578014001","buyer_id":"2088212878255745"}
|
||||
2020-01-03 09:13:29 {"out_trade_no":"2020010309132920437","total_amount":"1","subject":"onlinepay1578014009","buyer_id":"2088212878255745"}
|
||||
2020-01-03 09:17:24 {"out_trade_no":"2020010309172451548","total_amount":"1","subject":"onlinepay1578014244","buyer_id":"2088212878255745"}
|
||||
2020-01-03 09:24:47 {"out_trade_no":"2020010309244792263","total_amount":"1","subject":"onlinepay1578014687","buyer_id":"2088212878255745"}
|
||||
2020-01-03 09:25:38 {"out_trade_no":"2020010309253836862","total_amount":"1","subject":"onlinepay1578014738","buyer_id":"2088212878255745"}
|
||||
2020-01-03 09:34:31 {"out_trade_no":"2020010309343181480","total_amount":"1","subject":"onlinepay1578015271","buyer_id":"2088902145680340"}
|
||||
2020-01-03 09:35:28 {"out_trade_no":"2020010309352871074","total_amount":"1","subject":"onlinepay1578015328","buyer_id":"2088902145680340"}
|
||||
2020-01-03 09:36:13 {"out_trade_no":"2020010309361383664","total_amount":"1","subject":"onlinepay1578015373","buyer_id":"2088902145680340"}
|
||||
2020-01-03 09:39:44 {"out_trade_no":"2020010309394488015","total_amount":"1","subject":"onlinepay1578015584","buyer_id":"2088902145680340"}
|
||||
2020-01-03 09:47:47 {"productCode":"QUICK_WAP_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2020010309474786130"}
|
||||
2020-01-03 09:48:03 {"out_trade_no":"2020010309480334513","total_amount":"0.01","subject":"测试商品"}
|
||||
2020-01-03 09:48:12 {"out_trade_no":"2020010309481226250","total_amount":"1","subject":"onlinepay1578016092","buyer_id":"2088902145680340"}
|
||||
2020-01-03 09:48:21 {"out_trade_no":"2020010309482188590","total_amount":"1","subject":"onlinepay1578016101","buyer_id":"2088212878255745"}
|
||||
2020-01-03 09:52:32 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2020010309523223008"}
|
||||
2020-01-03 09:52:36 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2020010309523626917"}
|
||||
2020-01-03 09:52:39 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"测试商品","total_amount":"0.01","out_trade_no":"2020010309523981342"}
|
||||
2020-01-03 09:54:15 {"out_trade_no":"2020010309541535375","total_amount":"0.01","subject":"测试商品"}
|
||||
2020-01-06 22:33:50 {"out_trade_no":"2020010622335057261","total_amount":"0.01","subject":"测试商品"}
|
||||
2020-02-05 17:39:49 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"购买会员 #1#","total_amount":"10.00","out_trade_no":"2020020517394978681"}
|
||||
2020-02-05 17:43:19 {"product_code":"FAST_INSTANT_TRADE_PAY","subject":"购买会员 #1#","total_amount":"10.00","out_trade_no":"2020020517431960215"}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/* *
|
||||
* 功能:支付宝电脑网站alipay.trade.close (统一收单交易关闭接口)业务参数封装
|
||||
* 版本:2.0
|
||||
* 修改日期:2017-05-01
|
||||
* 说明:
|
||||
* 以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。
|
||||
*/
|
||||
|
||||
|
||||
class AlipayTradeCloseContentBuilder
|
||||
{
|
||||
|
||||
// 商户订单号.
|
||||
private $outTradeNo;
|
||||
|
||||
// 支付宝交易号
|
||||
private $tradeNo;
|
||||
|
||||
//卖家端自定义的的操作员 ID
|
||||
private $operatorId;
|
||||
|
||||
private $bizContentarr = array();
|
||||
|
||||
private $bizContent = NULL;
|
||||
|
||||
public function getBizContent()
|
||||
{
|
||||
if(!empty($this->bizContentarr)){
|
||||
$this->bizContent = json_encode($this->bizContentarr,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
return $this->bizContent;
|
||||
}
|
||||
|
||||
public function getTradeNo()
|
||||
{
|
||||
return $this->tradeNo;
|
||||
}
|
||||
|
||||
public function setTradeNo($tradeNo)
|
||||
{
|
||||
$this->tradeNo = $tradeNo;
|
||||
$this->bizContentarr['trade_no'] = $tradeNo;
|
||||
}
|
||||
|
||||
public function getOutTradeNo()
|
||||
{
|
||||
return $this->outTradeNo;
|
||||
}
|
||||
|
||||
public function setOutTradeNo($outTradeNo)
|
||||
{
|
||||
$this->outTradeNo = $outTradeNo;
|
||||
$this->bizContentarr['out_trade_no'] = $outTradeNo;
|
||||
}
|
||||
public function getOperatorId()
|
||||
{
|
||||
return $this->operatorId;
|
||||
}
|
||||
|
||||
public function setOperatorId($operatorId)
|
||||
{
|
||||
$this->operatorId = $operatorId;
|
||||
$this->bizContentarr['operator_id'] = $operatorId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/19
|
||||
* Time: 下午2:09
|
||||
*/
|
||||
|
||||
require_once 'GoodsDetail.php';
|
||||
require_once 'ExtendParams.php';
|
||||
require_once 'RoyaltyDetailInfo.php';
|
||||
require_once 'ContentBuilder.php';
|
||||
|
||||
class AlipayTradeCreateContentBuilder extends ContentBuilder
|
||||
{
|
||||
|
||||
// 商户网站订单系统中唯一订单号,64个字符以内,只能包含字母、数字、下划线,
|
||||
// 需保证商户系统端不能重复,建议通过数据库sequence生成,
|
||||
private $outTradeNo;
|
||||
|
||||
// 卖家支付宝账号ID,用于支持一个签约账号下支持打款到不同的收款账号,(打款到sellerId对应的支付宝账号)
|
||||
// 如果该字段为空,则默认为与支付宝签约的商户的PID,也就是appid对应的PID
|
||||
private $sellerId;
|
||||
|
||||
// 订单总金额,整形,此处单位为元,精确到小数点后2位,不能超过1亿元
|
||||
// 如果同时传入了【打折金额】,【不可打折金额】,【订单总金额】三者,则必须满足如下条件:【订单总金额】=【打折金额】+【不可打折金额】
|
||||
private $totalAmount;
|
||||
|
||||
// 订单可打折金额,此处单位为元,精确到小数点后2位
|
||||
// 可以配合商家平台配置折扣活动,如果订单部分商品参与打折,可以将部分商品总价填写至此字段,默认全部商品可打折
|
||||
// 如果该值未传入,但传入了【订单总金额】,【不可打折金额】 则该值默认为【订单总金额】- 【不可打折金额】
|
||||
private $discountableAmount;
|
||||
|
||||
//买家支付宝账号
|
||||
private $buyerId;
|
||||
|
||||
// 订单标题,粗略描述用户的支付目的。如“喜士多(浦东店)消费”
|
||||
private $subject;
|
||||
|
||||
// 订单描述,可以对交易或商品进行一个详细地描述,比如填写"购买商品2件共15.00元"
|
||||
private $body;
|
||||
|
||||
// 商品明细列表,需填写购买商品详细信息,
|
||||
private $goodsDetailList = array();
|
||||
|
||||
// 商户操作员编号,添加此参数可以为商户操作员做销售统
|
||||
private $operatorId;
|
||||
|
||||
// 商户门店编号,通过门店号和商家后台可以配置精准到门店的折扣信息,详询支付宝技术支持
|
||||
private $storeId;
|
||||
|
||||
// 商户机具终端编号,当以机具方式接入支付宝时必传,详询支付宝技术支持
|
||||
private $terminalId;
|
||||
|
||||
// 业务扩展参数,目前可添加由支付宝分配的系统商编号(通过setSysServiceProviderId方法),详情请咨询支付宝技术支持
|
||||
private $extendParams = array();
|
||||
|
||||
// (推荐使用,相对时间) 支付超时时间,5m 5分钟
|
||||
private $timeExpress;
|
||||
|
||||
private $bizContent = NULL;
|
||||
|
||||
private $bizParas = array();
|
||||
|
||||
|
||||
public function setOutTradeNo($outTradeNo)
|
||||
{
|
||||
$this->outTradeNo = $outTradeNo;
|
||||
$this->bizParas['out_trade_no'] = $outTradeNo;
|
||||
}
|
||||
public function getOutTradeNo()
|
||||
{
|
||||
return $this->outTradeNo;
|
||||
}
|
||||
|
||||
public function setSellerId($sellerId)
|
||||
{
|
||||
$this->sellerId = $sellerId;
|
||||
$this->bizParas['seller_id'] = $sellerId;
|
||||
}
|
||||
|
||||
public function getSellerId()
|
||||
{
|
||||
return $this->sellerId;
|
||||
}
|
||||
|
||||
public function setTotalAmount($totalAmount)
|
||||
{
|
||||
$this->totalAmount = $totalAmount;
|
||||
$this->bizParas['total_amount'] = $totalAmount;
|
||||
}
|
||||
|
||||
public function getTotalAmount()
|
||||
{
|
||||
return $this->totalAmount;
|
||||
}
|
||||
|
||||
public function setDiscountableAmount($discountableAmount)
|
||||
{
|
||||
$this->discountableAmount = $discountableAmount;
|
||||
$this->bizParas['discountable_amount'] = $discountableAmount;
|
||||
}
|
||||
|
||||
public function getDiscountableAmount()
|
||||
{
|
||||
return $this->discountableAmount;
|
||||
}
|
||||
|
||||
public function setBuyerId($buyerId)
|
||||
{
|
||||
$this->buyerId = $buyerId;
|
||||
$this->bizParas['buyer_id'] = $buyerId;
|
||||
}
|
||||
|
||||
public function getBuyerLogonId()
|
||||
{
|
||||
return $this->buyerLogonId;
|
||||
}
|
||||
|
||||
public function setSubject($subject)
|
||||
{
|
||||
$this->subject = $subject;
|
||||
$this->bizParas['subject'] = $subject;
|
||||
}
|
||||
|
||||
public function getSubject()
|
||||
{
|
||||
return $this->subject;
|
||||
}
|
||||
|
||||
public function setBody($body)
|
||||
{
|
||||
$this->body = $body;
|
||||
$this->bizParas['body'] = $body;
|
||||
}
|
||||
|
||||
public function getBody()
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
public function setOperatorId($operatorId)
|
||||
{
|
||||
$this->operatorId = $operatorId;
|
||||
$this->bizParas['operator_id'] = $operatorId;
|
||||
}
|
||||
|
||||
public function getOperatorId()
|
||||
{
|
||||
return $this->operatorId;
|
||||
}
|
||||
|
||||
public function setStoreId($storeId)
|
||||
{
|
||||
$this->storeId = $storeId;
|
||||
$this->bizParas['store_id'] = $storeId;
|
||||
}
|
||||
|
||||
public function getStoreId()
|
||||
{
|
||||
return $this->storeId;
|
||||
}
|
||||
|
||||
public function setTerminalId($terminalId)
|
||||
{
|
||||
$this->terminalId = $terminalId;
|
||||
$this->bizParas['terminal_id'] = $terminalId;
|
||||
}
|
||||
|
||||
public function getTerminalId()
|
||||
{
|
||||
return $this->terminalId;
|
||||
}
|
||||
|
||||
public function setTimeExpress($timeExpress)
|
||||
{
|
||||
$this->timeExpress = $timeExpress;
|
||||
$this->bizParas['timeout_express'] = $timeExpress;
|
||||
}
|
||||
|
||||
public function getTimeExpress()
|
||||
{
|
||||
return $this->timeExpress;
|
||||
}
|
||||
|
||||
public function getExtendParams()
|
||||
{
|
||||
return $this->extendParams;
|
||||
}
|
||||
|
||||
public function setExtendParams($extendParams)
|
||||
{
|
||||
$this->extendParams = $extendParams;
|
||||
$this->bizParas['extend_params'] = $extendParams;
|
||||
}
|
||||
|
||||
public function getGoodsDetailList()
|
||||
{
|
||||
return $this->goodsDetailList;
|
||||
}
|
||||
|
||||
public function setGoodsDetailList($goodsDetailList)
|
||||
{
|
||||
$this->goodsDetailList = $goodsDetailList;
|
||||
$this->bizParas['goods_detail'] = $goodsDetailList;
|
||||
}
|
||||
|
||||
public function getBizContent()
|
||||
{
|
||||
if(!empty($this->bizParas)){
|
||||
$this->bizContent = json_encode($this->bizParas,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
return $this->bizContent;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/* *
|
||||
* 功能:支付宝电脑网站支付alipay.trade.fastpay.refund.query (统一收单交易退款查询)业务参数封装
|
||||
* 版本:2.0
|
||||
* 修改日期:2017-05-01
|
||||
* 说明:
|
||||
* 以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。
|
||||
*/
|
||||
|
||||
|
||||
class AlipayTradeFastpayRefundQueryContentBuilder
|
||||
{
|
||||
|
||||
// 商户订单号.
|
||||
private $outTradeNo;
|
||||
// 支付宝交易号
|
||||
private $tradeNo;
|
||||
// 请求退款接口时,传入的退款请求号,如果在退款请求时未传入,则该值为创建交易时的外部交易号
|
||||
private $outRequestNo;
|
||||
|
||||
private $bizContentarr = array();
|
||||
|
||||
private $bizContent = NULL;
|
||||
|
||||
public function getBizContent()
|
||||
{
|
||||
if(!empty($this->bizContentarr)){
|
||||
$this->bizContent = json_encode($this->bizContentarr,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
return $this->bizContent;
|
||||
}
|
||||
|
||||
public function getTradeNo()
|
||||
{
|
||||
return $this->tradeNo;
|
||||
}
|
||||
|
||||
public function setTradeNo($tradeNo)
|
||||
{
|
||||
$this->tradeNo = $tradeNo;
|
||||
$this->bizContentarr['trade_no'] = $tradeNo;
|
||||
}
|
||||
|
||||
public function getOutTradeNo()
|
||||
{
|
||||
return $this->outTradeNo;
|
||||
}
|
||||
|
||||
public function setOutTradeNo($outTradeNo)
|
||||
{
|
||||
$this->outTradeNo = $outTradeNo;
|
||||
$this->bizContentarr['out_trade_no'] = $outTradeNo;
|
||||
}
|
||||
public function getOutRequestNo()
|
||||
{
|
||||
return $this->outRequestNo;
|
||||
}
|
||||
public function setOutRequestNo($outRequestNo)
|
||||
{
|
||||
$this->outRequestNo = $outRequestNo;
|
||||
$this->bizContentarr['out_request_no'] = $outRequestNo;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/* *
|
||||
* 功能:支付宝电脑网站支付(alipay.trade.page.pay)接口业务参数封装
|
||||
* 版本:2.0
|
||||
* 修改日期:2017-05-01
|
||||
* 说明:
|
||||
* 以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。
|
||||
*/
|
||||
|
||||
|
||||
class AlipayTradePagePayContentBuilder
|
||||
{
|
||||
|
||||
// 订单描述,可以对交易或商品进行一个详细地描述,比如填写"购买商品2件共15.00元"
|
||||
private $body;
|
||||
|
||||
// 订单标题,粗略描述用户的支付目的。
|
||||
private $subject;
|
||||
|
||||
// 商户订单号.
|
||||
private $outTradeNo;
|
||||
|
||||
// (推荐使用,相对时间) 该笔订单允许的最晚付款时间,逾期将关闭交易。取值范围:1m~15d。m-分钟,h-小时,d-天,1c-当天(1c-当天的情况下,无论交易何时创建,都在0点关闭)。 该参数数值不接受小数点, 如 1.5h,可转换为 90m
|
||||
private $timeExpress;
|
||||
|
||||
// 订单总金额,整形,此处单位为元,精确到小数点后2位,不能超过1亿元
|
||||
private $totalAmount;
|
||||
|
||||
// 产品标示码,固定值:QUICK_WAP_PAY
|
||||
private $productCode;
|
||||
|
||||
private $bizContentarr = array();
|
||||
|
||||
private $bizContent = NULL;
|
||||
|
||||
public function getBizContent()
|
||||
{
|
||||
if(!empty($this->bizContentarr)){
|
||||
$this->bizContent = json_encode($this->bizContentarr,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
return $this->bizContent;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->bizContentarr['product_code'] = "FAST_INSTANT_TRADE_PAY";
|
||||
}
|
||||
|
||||
public function AlipayTradeWapPayContentBuilder()
|
||||
{
|
||||
$this->__construct();
|
||||
}
|
||||
|
||||
public function getBody()
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
public function setBody($body)
|
||||
{
|
||||
$this->body = $body;
|
||||
$this->bizContentarr['body'] = $body;
|
||||
}
|
||||
|
||||
public function setSubject($subject)
|
||||
{
|
||||
$this->subject = $subject;
|
||||
$this->bizContentarr['subject'] = $subject;
|
||||
}
|
||||
|
||||
public function getSubject()
|
||||
{
|
||||
return $this->subject;
|
||||
}
|
||||
|
||||
public function getOutTradeNo()
|
||||
{
|
||||
return $this->outTradeNo;
|
||||
}
|
||||
|
||||
public function setOutTradeNo($outTradeNo)
|
||||
{
|
||||
$this->outTradeNo = $outTradeNo;
|
||||
$this->bizContentarr['out_trade_no'] = $outTradeNo;
|
||||
}
|
||||
|
||||
public function setTimeExpress($timeExpress)
|
||||
{
|
||||
$this->timeExpress = $timeExpress;
|
||||
$this->bizContentarr['timeout_express'] = $timeExpress;
|
||||
}
|
||||
|
||||
public function getTimeExpress()
|
||||
{
|
||||
return $this->timeExpress;
|
||||
}
|
||||
|
||||
public function setTotalAmount($totalAmount)
|
||||
{
|
||||
$this->totalAmount = $totalAmount;
|
||||
$this->bizContentarr['total_amount'] = $totalAmount;
|
||||
}
|
||||
|
||||
public function getTotalAmount()
|
||||
{
|
||||
return $this->totalAmount;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,254 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/19
|
||||
* Time: 下午2:09
|
||||
*/
|
||||
|
||||
require_once 'GoodsDetail.php';
|
||||
require_once 'ExtendParams.php';
|
||||
require_once 'RoyaltyDetailInfo.php';
|
||||
require_once 'ContentBuilder.php';
|
||||
|
||||
class AlipayTradePrecreateContentBuilder extends ContentBuilder
|
||||
{
|
||||
|
||||
// 商户网站订单系统中唯一订单号,64个字符以内,只能包含字母、数字、下划线,
|
||||
// 需保证商户系统端不能重复,建议通过数据库sequence生成,
|
||||
private $outTradeNo;
|
||||
|
||||
// 卖家支付宝账号ID,用于支持一个签约账号下支持打款到不同的收款账号,(打款到sellerId对应的支付宝账号)
|
||||
// 如果该字段为空,则默认为与支付宝签约的商户的PID,也就是appid对应的PID
|
||||
private $sellerId;
|
||||
|
||||
// 订单总金额,整形,此处单位为元,精确到小数点后2位,不能超过1亿元
|
||||
// 如果同时传入了【打折金额】,【不可打折金额】,【订单总金额】三者,则必须满足如下条件:【订单总金额】=【打折金额】+【不可打折金额】
|
||||
private $totalAmount;
|
||||
|
||||
// 订单可打折金额,此处单位为元,精确到小数点后2位
|
||||
// 可以配合商家平台配置折扣活动,如果订单部分商品参与打折,可以将部分商品总价填写至此字段,默认全部商品可打折
|
||||
// 如果该值未传入,但传入了【订单总金额】,【不可打折金额】 则该值默认为【订单总金额】- 【不可打折金额】
|
||||
private $discountableAmount;
|
||||
|
||||
// 订单不可打折金额,此处单位为元,精确到小数点后2位,可以配合商家平台配置折扣活动,如果酒水不参与打折,则将对应金额填写至此字段
|
||||
// 如果该值未传入,但传入了【订单总金额】,【打折金额】,则该值默认为【订单总金额】-【打折金额】
|
||||
private $undiscountableAmount;
|
||||
|
||||
//买家支付宝账号
|
||||
private $buyerLogonId;
|
||||
|
||||
// 订单标题,粗略描述用户的支付目的。如“喜士多(浦东店)消费”
|
||||
private $subject;
|
||||
|
||||
// 订单描述,可以对交易或商品进行一个详细地描述,比如填写"购买商品2件共15.00元"
|
||||
private $body;
|
||||
|
||||
// 商品明细列表,需填写购买商品详细信息,
|
||||
private $goodsDetailList = array();
|
||||
|
||||
// 商户操作员编号,添加此参数可以为商户操作员做销售统
|
||||
private $operatorId;
|
||||
|
||||
// 商户门店编号,通过门店号和商家后台可以配置精准到门店的折扣信息,详询支付宝技术支持
|
||||
private $storeId;
|
||||
|
||||
// 支付宝商家平台中配置的商户门店号,详询支付宝技术支持
|
||||
private $alipayStoreId;
|
||||
|
||||
// 商户机具终端编号,当以机具方式接入支付宝时必传,详询支付宝技术支持
|
||||
private $terminalId;
|
||||
|
||||
// 业务扩展参数,目前可添加由支付宝分配的系统商编号(通过setSysServiceProviderId方法),详情请咨询支付宝技术支持
|
||||
private $extendParams = array();
|
||||
|
||||
// (推荐使用,相对时间) 支付超时时间,5m 5分钟
|
||||
private $timeExpress;
|
||||
|
||||
private $bizContent = NULL;
|
||||
|
||||
private $bizParas = array();
|
||||
|
||||
|
||||
public function setOutTradeNo($outTradeNo)
|
||||
{
|
||||
$this->outTradeNo = $outTradeNo;
|
||||
$this->bizParas['out_trade_no'] = $outTradeNo;
|
||||
}
|
||||
public function getOutTradeNo()
|
||||
{
|
||||
return $this->outTradeNo;
|
||||
}
|
||||
|
||||
public function setSellerId($sellerId)
|
||||
{
|
||||
$this->sellerId = $sellerId;
|
||||
$this->bizParas['seller_id'] = $sellerId;
|
||||
}
|
||||
|
||||
public function getSellerId()
|
||||
{
|
||||
return $this->sellerId;
|
||||
}
|
||||
|
||||
public function setTotalAmount($totalAmount)
|
||||
{
|
||||
$this->totalAmount = $totalAmount;
|
||||
$this->bizParas['total_amount'] = $totalAmount;
|
||||
}
|
||||
|
||||
public function getTotalAmount()
|
||||
{
|
||||
return $this->totalAmount;
|
||||
}
|
||||
|
||||
public function setDiscountableAmount($discountableAmount)
|
||||
{
|
||||
$this->discountableAmount = $discountableAmount;
|
||||
$this->bizParas['discountable_amount'] = $discountableAmount;
|
||||
}
|
||||
|
||||
public function getDiscountableAmount()
|
||||
{
|
||||
return $this->discountableAmount;
|
||||
}
|
||||
|
||||
public function setUndiscountableAmount($undiscountableAmount)
|
||||
{
|
||||
$this->undiscountableAmount = $undiscountableAmount;
|
||||
$this->bizParas['undiscountable_amount'] = $undiscountableAmount;
|
||||
}
|
||||
|
||||
public function getUndiscountableAmount()
|
||||
{
|
||||
return $this->undiscountableAmount;
|
||||
}
|
||||
|
||||
public function setBuyerLogonId($buyerLogonId)
|
||||
{
|
||||
$this->buyerLogonId = $buyerLogonId;
|
||||
$this->bizParas['buyer_logon_id'] = $buyerLogonId;
|
||||
}
|
||||
|
||||
public function getBuyerLogonId()
|
||||
{
|
||||
return $this->buyerLogonId;
|
||||
}
|
||||
|
||||
public function setSubject($subject)
|
||||
{
|
||||
$this->subject = $subject;
|
||||
$this->bizParas['subject'] = $subject;
|
||||
}
|
||||
|
||||
public function getSubject()
|
||||
{
|
||||
return $this->subject;
|
||||
}
|
||||
|
||||
public function setBody($body)
|
||||
{
|
||||
$this->body = $body;
|
||||
$this->bizParas['body'] = $body;
|
||||
}
|
||||
|
||||
public function getBody()
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
public function setOperatorId($operatorId)
|
||||
{
|
||||
$this->operatorId = $operatorId;
|
||||
$this->bizParas['operator_id'] = $operatorId;
|
||||
}
|
||||
|
||||
public function getOperatorId()
|
||||
{
|
||||
return $this->operatorId;
|
||||
}
|
||||
|
||||
public function setStoreId($storeId)
|
||||
{
|
||||
$this->storeId = $storeId;
|
||||
$this->bizParas['store_id'] = $storeId;
|
||||
}
|
||||
|
||||
public function getStoreId()
|
||||
{
|
||||
return $this->storeId;
|
||||
}
|
||||
|
||||
public function setTerminalId($terminalId)
|
||||
{
|
||||
$this->terminalId = $terminalId;
|
||||
$this->bizParas['terminal_id'] = $terminalId;
|
||||
}
|
||||
|
||||
public function getTerminalId()
|
||||
{
|
||||
return $this->terminalId;
|
||||
}
|
||||
|
||||
public function setTimeExpress($timeExpress)
|
||||
{
|
||||
$this->timeExpress = $timeExpress;
|
||||
$this->bizParas['timeout_express'] = $timeExpress;
|
||||
}
|
||||
|
||||
public function getTimeExpress()
|
||||
{
|
||||
return $this->timeExpress;
|
||||
}
|
||||
|
||||
public function getAlipayStoreId()
|
||||
{
|
||||
return $this->alipayStoreId;
|
||||
}
|
||||
|
||||
|
||||
public function setAlipayStoreId($alipayStoreId)
|
||||
{
|
||||
$this->alipayStoreId = $alipayStoreId;
|
||||
$this->bizParas['alipay_store_id'] = $alipayStoreId;
|
||||
}
|
||||
|
||||
public function getExtendParams()
|
||||
{
|
||||
return $this->extendParams;
|
||||
}
|
||||
|
||||
public function setExtendParams($extendParams)
|
||||
{
|
||||
$this->extendParams = $extendParams;
|
||||
$this->bizParas['extend_params'] = $extendParams;
|
||||
}
|
||||
|
||||
public function getGoodsDetailList()
|
||||
{
|
||||
return $this->goodsDetailList;
|
||||
}
|
||||
|
||||
public function setGoodsDetailList($goodsDetailList)
|
||||
{
|
||||
$this->goodsDetailList = $goodsDetailList;
|
||||
$this->bizParas['goods_detail'] = $goodsDetailList;
|
||||
}
|
||||
|
||||
public function getBizContent()
|
||||
{
|
||||
/*$this->bizContent = "{";
|
||||
foreach ($this->bizParas as $k=>$v){
|
||||
$this->bizContent.= "\"".$k."\":\"".$v."\",";
|
||||
}
|
||||
$this->bizContent = substr($this->bizContent,0,-1);
|
||||
$this->bizContent.= "}";*/
|
||||
if(!empty($this->bizParas)){
|
||||
$this->bizContent = json_encode($this->bizParas,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
return $this->bizContent;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/19
|
||||
* Time: 下午2:09
|
||||
*/
|
||||
require_once 'ContentBuilder.php';
|
||||
|
||||
class AlipayTradeQueryContentBuilder extends ContentBuilder
|
||||
{
|
||||
// 支付宝交易号,和商户订单号不能同时为空, 如果同时存在则通过tradeNo查询支付宝交易
|
||||
private $tradeNo;
|
||||
|
||||
// 商户订单号,通过此商户订单号查询当面付的交易状态
|
||||
private $outTradeNo;
|
||||
|
||||
private $bizContentarr = array();
|
||||
|
||||
private $bizContent = NULL;
|
||||
|
||||
public function getBizContent()
|
||||
{
|
||||
if(!empty($this->bizContentarr)){
|
||||
$this->bizContent = json_encode($this->bizContentarr,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
return $this->bizContent;
|
||||
}
|
||||
|
||||
public function getOutTradeNo()
|
||||
{
|
||||
return $this->outTradeNo;
|
||||
}
|
||||
|
||||
public function setOutTradeNo($outTradeNo)
|
||||
{
|
||||
$this->outTradeNo = $outTradeNo;
|
||||
$this->bizContentarr['out_trade_no'] = $outTradeNo;
|
||||
}
|
||||
|
||||
public function getTradeNo()
|
||||
{
|
||||
return $this->tradeNo;
|
||||
}
|
||||
|
||||
public function setTradeNo($tradeNo)
|
||||
{
|
||||
$this->tradeNo = $tradeNo;
|
||||
$this->bizContentarr['trade_no'] = $tradeNo;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/19
|
||||
* Time: 下午2:09
|
||||
*/
|
||||
require_once 'ContentBuilder.php';
|
||||
|
||||
class AlipayTradeRefundContentBuilder extends ContentBuilder
|
||||
{
|
||||
// 支付宝交易号,当面付支付成功后支付宝会返回给商户系统。通过此支付宝交易号进行交易退款
|
||||
private $tradeNo;
|
||||
|
||||
// (推荐) 外部订单号,可通过外部订单号申请退款,推荐使用
|
||||
private $outTradeNo;
|
||||
|
||||
// 退款金额,该金额必须小于等于订单的支付金额,此处单位为元,精确到小数点后2位
|
||||
private $refundAmount;
|
||||
|
||||
// (可选,需要支持重复退货时必填) 商户退款请求号,相同支付宝交易号下的不同退款请求号对应同一笔交易的不同退款申请,
|
||||
// 对于相同支付宝交易号下多笔相同商户退款请求号的退款交易,支付宝只会进行一次退款
|
||||
private $outRequestNo;
|
||||
|
||||
// (必填) 退款原因,可以说明用户退款原因,方便为商家后台提供统计
|
||||
private $refundReason;
|
||||
|
||||
// (必填) 商户门店编号,退款情况下可以为商家后台提供退款权限判定和统计等作用,详询支付宝技术支持
|
||||
private $storeId;
|
||||
|
||||
// 商户操作员编号,添加此参数可以为商户操作员做销售统
|
||||
private $operatorId;
|
||||
|
||||
// 商户机具终端编号,当以机具方式接入支付宝时必传,详询支付宝技术支持
|
||||
private $terminalId;
|
||||
|
||||
private $bizContentarr = array();
|
||||
|
||||
private $bizContent = NULL;
|
||||
|
||||
/* public function __construct()
|
||||
{
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
public function AlipayTradeRefundContentBuilder()
|
||||
{
|
||||
$this->__construct();
|
||||
}*/
|
||||
|
||||
public function getBizContent()
|
||||
{
|
||||
if(!empty($this->bizContentarr)){
|
||||
$this->bizContent = json_encode($this->bizContentarr,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
return $this->bizContent;
|
||||
}
|
||||
|
||||
public function setTradeNo($tradeNo)
|
||||
{
|
||||
$this->tradeNo = $tradeNo;
|
||||
$this->bizContentarr['trade_no'] = $tradeNo;
|
||||
}
|
||||
|
||||
public function getTradeNo()
|
||||
{
|
||||
return $this->tradeNo;
|
||||
}
|
||||
|
||||
public function setOutTradeNo($outTradeNo)
|
||||
{
|
||||
$this->outTradeNo = $outTradeNo;
|
||||
$this->bizContentarr['out_trade_no'] = $outTradeNo;
|
||||
}
|
||||
|
||||
public function getOutTradeNo()
|
||||
{
|
||||
return $this->outTradeNo;
|
||||
}
|
||||
|
||||
public function setOperatorId($operatorId)
|
||||
{
|
||||
$this->operatorId = $operatorId;
|
||||
$this->bizContentarr['operator_id'] = $operatorId;
|
||||
}
|
||||
|
||||
public function getOperatorId()
|
||||
{
|
||||
return $this->operatorId;
|
||||
}
|
||||
|
||||
public function setOutRequestNo($outRequestNo)
|
||||
{
|
||||
$this->outRequestNo = $outRequestNo;
|
||||
$this->bizContentarr['out_request_no'] = $outRequestNo;
|
||||
}
|
||||
|
||||
public function getOutRequestNo()
|
||||
{
|
||||
return $this->outRequestNo;
|
||||
}
|
||||
|
||||
public function setRefundAmount($refundAmount)
|
||||
{
|
||||
$this->refundAmount = $refundAmount;
|
||||
$this->bizContentarr['refund_amount'] = $refundAmount;
|
||||
}
|
||||
|
||||
public function getRefundAmount()
|
||||
{
|
||||
return $this->refundAmount;
|
||||
}
|
||||
|
||||
public function setRefundReason($refundReason)
|
||||
{
|
||||
$this->refundReason = $refundReason;
|
||||
$this->bizContentarr['refund_reason'] = $refundReason;
|
||||
}
|
||||
|
||||
public function getRefundReason()
|
||||
{
|
||||
return $this->refundReason;
|
||||
}
|
||||
|
||||
public function setStoreId($storeId)
|
||||
{
|
||||
$this->storeId = $storeId;
|
||||
$this->bizContentarr['store_id'] = $storeId;
|
||||
}
|
||||
|
||||
public function getStoreId()
|
||||
{
|
||||
return $this->storeId;
|
||||
}
|
||||
|
||||
public function setTerminalId($terminalId)
|
||||
{
|
||||
$this->terminalId = $terminalId;
|
||||
$this->bizContentarr['terminal_id'] =$terminalId;
|
||||
}
|
||||
|
||||
public function getTerminalId()
|
||||
{
|
||||
return $this->terminalId;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
/* *
|
||||
* 功能:支付宝手机网站支付接口(alipay.trade.wap.pay)接口业务参数封装
|
||||
* 版本:2.0
|
||||
* 修改日期:2016-11-01
|
||||
* 说明:
|
||||
* 以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。
|
||||
*/
|
||||
|
||||
|
||||
class AlipayTradeWapPayContentBuilder
|
||||
{
|
||||
|
||||
// 订单描述,可以对交易或商品进行一个详细地描述,比如填写"购买商品2件共15.00元"
|
||||
private $body;
|
||||
|
||||
// 订单标题,粗略描述用户的支付目的。
|
||||
private $subject;
|
||||
|
||||
// 商户订单号.
|
||||
private $outTradeNo;
|
||||
|
||||
// (推荐使用,相对时间) 支付超时时间,5m 5分钟
|
||||
private $timeExpress;
|
||||
|
||||
// 订单总金额,整形,此处单位为元,精确到小数点后2位,不能超过1亿元
|
||||
private $totalAmount;
|
||||
|
||||
// 如果该字段为空,则默认为与支付宝签约的商户的PID,也就是appid对应的PID
|
||||
private $sellerId;
|
||||
|
||||
// 产品标示码,固定值:QUICK_WAP_PAY
|
||||
private $productCode;
|
||||
|
||||
private $bizContentarr = array();
|
||||
|
||||
private $bizContent = NULL;
|
||||
|
||||
public function getBizContent()
|
||||
{
|
||||
if(!empty($this->bizContentarr)){
|
||||
$this->bizContent = json_encode($this->bizContentarr,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
return $this->bizContent;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->bizContentarr['productCode'] = "QUICK_WAP_PAY";
|
||||
}
|
||||
|
||||
public function AlipayTradeWapPayContentBuilder()
|
||||
{
|
||||
$this->__construct();
|
||||
}
|
||||
|
||||
public function getBody()
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
public function setBody($body)
|
||||
{
|
||||
$this->body = $body;
|
||||
$this->bizContentarr['body'] = $body;
|
||||
}
|
||||
|
||||
public function setSubject($subject)
|
||||
{
|
||||
$this->subject = $subject;
|
||||
$this->bizContentarr['subject'] = $subject;
|
||||
}
|
||||
|
||||
public function getSubject()
|
||||
{
|
||||
return $this->subject;
|
||||
}
|
||||
|
||||
public function getOutTradeNo()
|
||||
{
|
||||
return $this->outTradeNo;
|
||||
}
|
||||
|
||||
public function setOutTradeNo($outTradeNo)
|
||||
{
|
||||
$this->outTradeNo = $outTradeNo;
|
||||
$this->bizContentarr['out_trade_no'] = $outTradeNo;
|
||||
}
|
||||
|
||||
public function setTimeExpress($timeExpress)
|
||||
{
|
||||
$this->timeExpress = $timeExpress;
|
||||
$this->bizContentarr['timeout_express'] = $timeExpress;
|
||||
}
|
||||
|
||||
public function getTimeExpress()
|
||||
{
|
||||
return $this->timeExpress;
|
||||
}
|
||||
|
||||
public function setTotalAmount($totalAmount)
|
||||
{
|
||||
$this->totalAmount = $totalAmount;
|
||||
$this->bizContentarr['total_amount'] = $totalAmount;
|
||||
}
|
||||
|
||||
public function getTotalAmount()
|
||||
{
|
||||
return $this->totalAmount;
|
||||
}
|
||||
|
||||
public function setSellerId($sellerId)
|
||||
{
|
||||
$this->sellerId = $sellerId;
|
||||
$this->bizContentarr['seller_id'] = $sellerId;
|
||||
}
|
||||
|
||||
public function getSellerId()
|
||||
{
|
||||
return $this->sellerId;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
36
plugins/alipay/inc/model/builder/ContentBuilder.php
Normal file
36
plugins/alipay/inc/model/builder/ContentBuilder.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/6/27
|
||||
* Time: 下午3:31
|
||||
*/
|
||||
class ContentBuilder
|
||||
{
|
||||
//第三方应用授权令牌
|
||||
private $appAuthToken;
|
||||
|
||||
//异步通知地址(仅扫码支付使用)
|
||||
private $notifyUrl;
|
||||
|
||||
public function setAppAuthToken($appAuthToken)
|
||||
{
|
||||
$this->appAuthToken = $appAuthToken;
|
||||
}
|
||||
|
||||
public function setNotifyUrl($notifyUrl)
|
||||
{
|
||||
$this->notifyUrl = $notifyUrl;
|
||||
}
|
||||
|
||||
public function getAppAuthToken()
|
||||
{
|
||||
return $this->appAuthToken;
|
||||
}
|
||||
|
||||
public function getNotifyUrl()
|
||||
{
|
||||
return $this->notifyUrl;
|
||||
}
|
||||
}
|
||||
61
plugins/alipay/inc/model/builder/ExtendParams.php
Normal file
61
plugins/alipay/inc/model/builder/ExtendParams.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: airwalk
|
||||
* Date: 16/5/19
|
||||
* Time: 下午3:56
|
||||
*/
|
||||
|
||||
class ExtendParams
|
||||
{
|
||||
// 系统商编号
|
||||
private $sysServiceProviderId;
|
||||
|
||||
//使用花呗分期要进行的分期数,非必填项
|
||||
private $hbFqNum;
|
||||
|
||||
//使用花呗分期需要卖家承担的手续费比例的百分值
|
||||
private $hbFqSellerPercent;
|
||||
|
||||
private $extendParamsArr = array();
|
||||
|
||||
public function getExtendParams()
|
||||
{
|
||||
if(!empty($this->extendParamsArr)) {
|
||||
return $this->extendParamsArr;
|
||||
}
|
||||
}
|
||||
|
||||
public function getSysServiceProviderId()
|
||||
{
|
||||
return $this->sysServiceProviderId;
|
||||
}
|
||||
|
||||
public function setSysServiceProviderId($sysServiceProviderId)
|
||||
{
|
||||
$this->sysServiceProviderId = $sysServiceProviderId;
|
||||
$this->extendParamsArr['sys_service_provider_id'] = $sysServiceProviderId;
|
||||
}
|
||||
|
||||
public function getHbFqNum()
|
||||
{
|
||||
return $this->hbFqNum;
|
||||
}
|
||||
|
||||
public function setHbFqNum($hbFqNum)
|
||||
{
|
||||
$this->hbFqNum = $hbFqNum;
|
||||
$this->extendParamsArr['hb_fq_num'] = $hbFqNum;
|
||||
}
|
||||
|
||||
public function getHbFqSellerPercent()
|
||||
{
|
||||
return $this->hbFqSellerPercent;
|
||||
}
|
||||
|
||||
public function setHbFqSellerPercent($hbFqSellerPercent)
|
||||
{
|
||||
$this->hbFqSellerPercent = $hbFqSellerPercent;
|
||||
$this->extendParamsArr['hb_fq_seller_percent'] = $hbFqSellerPercent;
|
||||
}
|
||||
}
|
||||
129
plugins/alipay/inc/model/builder/GoodsDetail.php
Normal file
129
plugins/alipay/inc/model/builder/GoodsDetail.php
Normal file
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/19
|
||||
* Time: 下午2:09
|
||||
*/
|
||||
class GoodsDetail
|
||||
{
|
||||
// 商品编号(国标)
|
||||
private $goodsId;
|
||||
|
||||
//支付宝定义的统一商品编号
|
||||
private $alipayGoodsId;
|
||||
|
||||
// 商品名称
|
||||
private $goodsName;
|
||||
|
||||
// 商品数量
|
||||
private $quantity;
|
||||
|
||||
// 商品价格,此处单位为元,精确到小数点后2位
|
||||
private $price;
|
||||
|
||||
// 商品类别
|
||||
private $goodsCategory;
|
||||
|
||||
// 商品详情
|
||||
private $body;
|
||||
|
||||
private $goodsDetail = array();
|
||||
|
||||
//单个商品json字符串
|
||||
//private $goodsDetailStr = NULL;
|
||||
|
||||
//获取单个商品的json字符串
|
||||
public function getGoodsDetail()
|
||||
{
|
||||
return $this->goodsDetail;
|
||||
/*$this->goodsDetailStr = "{";
|
||||
foreach ($this->goodsDetail as $k => $v){
|
||||
$this->goodsDetailStr.= "\"".$k."\":\"".$v."\",";
|
||||
}
|
||||
$this->goodsDetailStr = substr($this->goodsDetailStr,0,-1);
|
||||
$this->goodsDetailStr.= "}";
|
||||
return $this->goodsDetailStr;*/
|
||||
}
|
||||
|
||||
public function setGoodsId($goodsId)
|
||||
{
|
||||
$this->goodsId = $goodsId;
|
||||
$this->goodsDetail['goods_id'] = $goodsId;
|
||||
}
|
||||
|
||||
public function getGoodsId()
|
||||
{
|
||||
return $this->goodsId;
|
||||
}
|
||||
|
||||
public function setAlipayGoodsId($alipayGoodsId)
|
||||
{
|
||||
$this->alipayGoodsId = $alipayGoodsId;
|
||||
$this->goodsDetail['alipay_goods_id'] = $alipayGoodsId;
|
||||
}
|
||||
|
||||
public function getAlipayGoodsId()
|
||||
{
|
||||
return $this->alipayGoodsId;
|
||||
}
|
||||
|
||||
public function setGoodsName($goodsName)
|
||||
{
|
||||
$this->goodsName = $goodsName;
|
||||
$this->goodsDetail['goods_name'] = $goodsName;
|
||||
}
|
||||
|
||||
public function getGoodsName()
|
||||
{
|
||||
return $this->goodsName;
|
||||
}
|
||||
|
||||
public function setQuantity($quantity)
|
||||
{
|
||||
$this->quantity = $quantity;
|
||||
$this->goodsDetail['quantity'] = $quantity;
|
||||
}
|
||||
|
||||
public function getQuantity()
|
||||
{
|
||||
return $this->quantity;
|
||||
}
|
||||
|
||||
public function setPrice($price)
|
||||
{
|
||||
$this->price = $price;
|
||||
$this->goodsDetail['price'] = $price;
|
||||
}
|
||||
|
||||
public function getPrice()
|
||||
{
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
public function setGoodsCategory($goodsCategory)
|
||||
{
|
||||
$this->goodsCategory = $goodsCategory;
|
||||
$this->goodsDetail['goods_category'] = $goodsCategory;
|
||||
}
|
||||
|
||||
public function getGoodsCategory()
|
||||
{
|
||||
return $this->goodsCategory;
|
||||
}
|
||||
|
||||
public function setBody($body)
|
||||
{
|
||||
$this->body = $body;
|
||||
$this->goodsDetail['body'] = $body;
|
||||
}
|
||||
|
||||
public function getBody()
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
161
plugins/alipay/inc/model/builder/RoyaltyDetailInfo.php
Normal file
161
plugins/alipay/inc/model/builder/RoyaltyDetailInfo.php
Normal file
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/20
|
||||
* Time: 上午11:33
|
||||
*/
|
||||
|
||||
class RoyaltyDetailInfo
|
||||
{
|
||||
//分账序列号,表示分账执行的顺序,必须为正整数
|
||||
private $serialNo;
|
||||
|
||||
//接受分账金额的账户类型:默认值为userId。
|
||||
//userId:支付宝账号对应的支付宝唯一用户号。
|
||||
//bankIndex:分账到银行账户的银行编号。目前暂时只支持分账到一个银行编号。
|
||||
//storeId:分账到门店对应的银行卡编号。
|
||||
private $transInType;
|
||||
|
||||
//(必填)分账批次号 分账批次号。 目前需要和转入账号类型为bankIndex配合使用
|
||||
private $batchNo;
|
||||
|
||||
//商户分账的外部关联号,用于关联到每一笔分账信息,商户需保证其唯一性。
|
||||
//如果为空,该值则默认为“商户网站唯一订单号+分账序列号”
|
||||
private $outRelationId;
|
||||
|
||||
//(必填)要分账的账户类型,默认值为userId
|
||||
//目前只支持userId:支付宝账号对应的支付宝唯一用户号
|
||||
private $transOutType;
|
||||
|
||||
//(必填)如果转出账号类型为userId,本参数为要分账的支付宝账号对应的支付宝唯一用户号。
|
||||
//以2088开头的纯16位数字。
|
||||
private $transOut;
|
||||
|
||||
//(必填)如果转入账号类型为userId,本参数为接受分账金额的支付宝账号对应的支付宝唯一用户号。以2088开头的纯16位数字。
|
||||
//如果转入账号类型为bankIndex,本参数为28位的银行编号(商户和支付宝签约时确定)
|
||||
//如果转入账号类型为storeId,本参数为商户的门店ID。
|
||||
private $transIn;
|
||||
|
||||
//(必填)分账的金额,单位为元
|
||||
private $amount;
|
||||
|
||||
//分账描述信息
|
||||
private $desc;
|
||||
|
||||
private $royaltyDetailInfo = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->setTransInType("userId");
|
||||
$this->setTransOutType("userId");
|
||||
}
|
||||
|
||||
public function RoyaltyDetailInfo(){
|
||||
$this->__construct();
|
||||
}
|
||||
|
||||
public function getRoyaltyDetailInfo()
|
||||
{
|
||||
return $this->royaltyDetailInfo;
|
||||
}
|
||||
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
public function getBatchNo()
|
||||
{
|
||||
return $this->batchNo;
|
||||
}
|
||||
|
||||
public function getDesc()
|
||||
{
|
||||
return $this->desc;
|
||||
}
|
||||
|
||||
public function getOutRelationId()
|
||||
{
|
||||
return $this->outRelationId;
|
||||
}
|
||||
|
||||
public function getSerialNo()
|
||||
{
|
||||
return $this->serialNo;
|
||||
}
|
||||
|
||||
public function getTransIn()
|
||||
{
|
||||
return $this->transIn;
|
||||
}
|
||||
|
||||
public function getTransInType()
|
||||
{
|
||||
return $this->transInType;
|
||||
}
|
||||
|
||||
public function getTransOut()
|
||||
{
|
||||
return $this->transOut;
|
||||
}
|
||||
|
||||
public function getTransOutType()
|
||||
{
|
||||
return $this->transOutType;
|
||||
}
|
||||
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
$this->royaltyDetailInfo['amount'] = $amount;
|
||||
}
|
||||
|
||||
public function setBatchNo($batchNo)
|
||||
{
|
||||
$this->batchNo = $batchNo;
|
||||
$this->royaltyDetailInfo['batch_no'] = $batchNo;
|
||||
}
|
||||
|
||||
public function setDesc($desc)
|
||||
{
|
||||
$this->desc = $desc;
|
||||
$this->royaltyDetailInfo['desc'] = $desc;
|
||||
}
|
||||
|
||||
public function setOutRelationId($outRelationId)
|
||||
{
|
||||
$this->outRelationId = $outRelationId;
|
||||
$this->royaltyDetailInfo['out_relation_id'] = $outRelationId;
|
||||
}
|
||||
|
||||
public function setSerialNo($serialNo)
|
||||
{
|
||||
$this->serialNo = $serialNo;
|
||||
$this->royaltyDetailInfo['serial_no'] = $serialNo;
|
||||
}
|
||||
|
||||
public function setTransIn($transIn)
|
||||
{
|
||||
$this->transIn = $transIn;
|
||||
$this->royaltyDetailInfo['trans_in'] = $transIn;
|
||||
}
|
||||
|
||||
public function setTransInType($transInType)
|
||||
{
|
||||
$this->transInType = $transInType;
|
||||
$this->royaltyDetailInfo['trans_in_type'] = $transInType;
|
||||
}
|
||||
|
||||
public function setTransOut($transOut)
|
||||
{
|
||||
$this->transOut = $transOut;
|
||||
$this->royaltyDetailInfo['trans_out'] = $transOut;
|
||||
}
|
||||
|
||||
public function setTransOutType($transOutType)
|
||||
{
|
||||
$this->transOutType = $transOutType;
|
||||
$this->royaltyDetailInfo['trans_out_type'] = $transOutType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.fund.account.query request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2019-11-08 12:17:16
|
||||
*/
|
||||
class AlipayFundAccountQueryRequest
|
||||
{
|
||||
/**
|
||||
* 支付宝资金账户资产查询接口
|
||||
**/
|
||||
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.fund.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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.fund.trans.common.query request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2019-10-19 09:32:00
|
||||
*/
|
||||
class AlipayFundTransCommonQueryRequest
|
||||
{
|
||||
/**
|
||||
* 转账业务单据查询接口
|
||||
**/
|
||||
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.fund.trans.common.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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.fund.trans.toaccount.transfer request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2019-06-17 11:15:01
|
||||
*/
|
||||
class AlipayFundTransToaccountTransferRequest
|
||||
{
|
||||
/**
|
||||
* 单笔转账到支付宝账户接口
|
||||
**/
|
||||
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.fund.trans.toaccount.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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.fund.trans.uni.transfer request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2019-10-23 15:09:00
|
||||
*/
|
||||
class AlipayFundTransUniTransferRequest
|
||||
{
|
||||
/**
|
||||
* 支付宝转账支付接口
|
||||
**/
|
||||
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.fund.trans.uni.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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.system.oauth.token request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2018-07-13 17:18:06
|
||||
*/
|
||||
class AlipaySystemOauthTokenRequest
|
||||
{
|
||||
/**
|
||||
* 授权码,用户对应用授权后得到。
|
||||
**/
|
||||
private $code;
|
||||
|
||||
/**
|
||||
* 值为authorization_code时,代表用code换取;值为refresh_token时,代表用refresh_token换取
|
||||
**/
|
||||
private $grantType;
|
||||
|
||||
/**
|
||||
* 刷新令牌,上次换取访问令牌时得到。见出参的refresh_token字段
|
||||
**/
|
||||
private $refreshToken;
|
||||
|
||||
private $apiParas = array();
|
||||
private $terminalType;
|
||||
private $terminalInfo;
|
||||
private $prodCode;
|
||||
private $apiVersion="1.0";
|
||||
private $notifyUrl;
|
||||
private $returnUrl;
|
||||
private $needEncrypt=false;
|
||||
|
||||
|
||||
public function setCode($code)
|
||||
{
|
||||
$this->code = $code;
|
||||
$this->apiParas["code"] = $code;
|
||||
}
|
||||
|
||||
public function getCode()
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
public function setGrantType($grantType)
|
||||
{
|
||||
$this->grantType = $grantType;
|
||||
$this->apiParas["grant_type"] = $grantType;
|
||||
}
|
||||
|
||||
public function getGrantType()
|
||||
{
|
||||
return $this->grantType;
|
||||
}
|
||||
|
||||
public function setRefreshToken($refreshToken)
|
||||
{
|
||||
$this->refreshToken = $refreshToken;
|
||||
$this->apiParas["refresh_token"] = $refreshToken;
|
||||
}
|
||||
|
||||
public function getRefreshToken()
|
||||
{
|
||||
return $this->refreshToken;
|
||||
}
|
||||
|
||||
public function getApiMethodName()
|
||||
{
|
||||
return "alipay.system.oauth.token";
|
||||
}
|
||||
|
||||
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
plugins/alipay/inc/model/request/AlipayTradeCloseRequest.php
Normal file
118
plugins/alipay/inc/model/request/AlipayTradeCloseRequest.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.trade.close request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2016-11-09 22:08:22
|
||||
*/
|
||||
class AlipayTradeCloseRequest
|
||||
{
|
||||
/**
|
||||
* 统一收单交易关闭接口
|
||||
**/
|
||||
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.trade.close";
|
||||
}
|
||||
|
||||
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
plugins/alipay/inc/model/request/AlipayTradeCreateRequest.php
Normal file
118
plugins/alipay/inc/model/request/AlipayTradeCreateRequest.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.trade.create request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2019-07-15 17:17:13
|
||||
*/
|
||||
class AlipayTradeCreateRequest
|
||||
{
|
||||
/**
|
||||
* 商户通过该接口进行交易的创建下单
|
||||
**/
|
||||
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.trade.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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.trade.fastpay.refund.query request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2017-03-23 19:11:54
|
||||
*/
|
||||
class AlipayTradeFastpayRefundQueryRequest
|
||||
{
|
||||
/**
|
||||
* 商户可使用该接口查询自已通过alipay.trade.refund提交的退款请求是否执行成功。
|
||||
**/
|
||||
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.trade.fastpay.refund.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
plugins/alipay/inc/model/request/AlipayTradePagePayRequest.php
Normal file
118
plugins/alipay/inc/model/request/AlipayTradePagePayRequest.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.trade.page.pay request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2017-04-06 15:55:36
|
||||
*/
|
||||
class AlipayTradePagePayRequest
|
||||
{
|
||||
/**
|
||||
* 统一收单下单并支付页面接口
|
||||
**/
|
||||
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.trade.page.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;
|
||||
}
|
||||
|
||||
}
|
||||
119
plugins/alipay/inc/model/request/AlipayTradePrecreateRequest.php
Normal file
119
plugins/alipay/inc/model/request/AlipayTradePrecreateRequest.php
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.trade.precreate request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2017-01-09 15:29:09
|
||||
*/
|
||||
class AlipayTradePrecreateRequest
|
||||
{
|
||||
/**
|
||||
* 收银员通过收银台或商户后台调用支付宝接口,生成二维码后,展示给伤脑筋户,由用户扫描二维码完成订单支付。
|
||||
修改路由策略到R
|
||||
**/
|
||||
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.trade.precreate";
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
119
plugins/alipay/inc/model/request/AlipayTradeQueryRequest.php
Normal file
119
plugins/alipay/inc/model/request/AlipayTradeQueryRequest.php
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.trade.query request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2017-01-09 15:37:43
|
||||
*/
|
||||
class AlipayTradeQueryRequest
|
||||
{
|
||||
/**
|
||||
* 统一收单线下交易查询
|
||||
修改路由策略到R
|
||||
**/
|
||||
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.trade.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
plugins/alipay/inc/model/request/AlipayTradeRefundRequest.php
Normal file
118
plugins/alipay/inc/model/request/AlipayTradeRefundRequest.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.trade.refund request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2017-01-13 19:12:23
|
||||
*/
|
||||
class AlipayTradeRefundRequest
|
||||
{
|
||||
/**
|
||||
* 统一收单交易退款接口
|
||||
**/
|
||||
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.trade.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
plugins/alipay/inc/model/request/AlipayTradeWapPayRequest.php
Normal file
118
plugins/alipay/inc/model/request/AlipayTradeWapPayRequest.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.trade.wap.pay request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2016-11-17 11:46:00
|
||||
*/
|
||||
class AlipayTradeWapPayRequest
|
||||
{
|
||||
/**
|
||||
* 手机网站支付接口2.0
|
||||
**/
|
||||
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.trade.wap.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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.user.certify.open.certify request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2019-07-11 19:50:01
|
||||
*/
|
||||
class AlipayUserCertifyOpenCertifyRequest
|
||||
{
|
||||
/**
|
||||
* 开放认证开始认证
|
||||
**/
|
||||
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.user.certify.open.certify";
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.user.certify.open.initialize request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2019-06-05 18:35:01
|
||||
*/
|
||||
class AlipayUserCertifyOpenInitializeRequest
|
||||
{
|
||||
/**
|
||||
* 支付宝开放认证初始化服务
|
||||
**/
|
||||
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.user.certify.open.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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.user.certify.open.query request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2019-01-07 20:51:15
|
||||
*/
|
||||
class AlipayUserCertifyOpenQueryRequest
|
||||
{
|
||||
/**
|
||||
* 支付宝开放认证查询
|
||||
**/
|
||||
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.user.certify.open.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
plugins/alipay/inc/model/request/AlipayUserInfoShareRequest.php
Normal file
103
plugins/alipay/inc/model/request/AlipayUserInfoShareRequest.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* ALIPAY API: alipay.user.info.share request
|
||||
*
|
||||
* @author auto create
|
||||
* @since 1.0, 2018-07-13 17:18:06
|
||||
*/
|
||||
class AlipayUserInfoShareRequest
|
||||
{
|
||||
|
||||
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.user.info.share";
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
44
plugins/alipay/inc/model/result/AlipayF2FPrecreateResult.php
Normal file
44
plugins/alipay/inc/model/result/AlipayF2FPrecreateResult.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/19
|
||||
* Time: 下午2:09
|
||||
*/
|
||||
class AlipayF2FPrecreateResult
|
||||
{
|
||||
private $tradeStatus;
|
||||
private $response;
|
||||
|
||||
public function __construct($response)
|
||||
{
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
public function AlipayF2FPrecreateResult($response)
|
||||
{
|
||||
$this->__construct($response);
|
||||
}
|
||||
|
||||
public function setTradeStatus($tradeStatus)
|
||||
{
|
||||
$this->tradeStatus = $tradeStatus;
|
||||
}
|
||||
|
||||
public function getTradeStatus()
|
||||
{
|
||||
return $this->tradeStatus;
|
||||
}
|
||||
|
||||
public function setResponse($response)
|
||||
{
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
public function getResponse()
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
44
plugins/alipay/inc/model/result/AlipayF2FQueryResult.php
Normal file
44
plugins/alipay/inc/model/result/AlipayF2FQueryResult.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/19
|
||||
* Time: 下午2:09
|
||||
*/
|
||||
class AlipayF2FQueryResult
|
||||
{
|
||||
private $tradeStatus;
|
||||
private $response;
|
||||
|
||||
public function __construct($response)
|
||||
{
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
public function AlipayF2FPayResult($response)
|
||||
{
|
||||
$this->__construct($response);
|
||||
}
|
||||
|
||||
public function setTradeStatus($tradeStatus)
|
||||
{
|
||||
$this->tradeStatus = $tradeStatus;
|
||||
}
|
||||
|
||||
public function getTradeStatus()
|
||||
{
|
||||
return $this->tradeStatus;
|
||||
}
|
||||
|
||||
public function setResponse($response)
|
||||
{
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
public function getResponse()
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
44
plugins/alipay/inc/model/result/AlipayF2FRefundResult.php
Normal file
44
plugins/alipay/inc/model/result/AlipayF2FRefundResult.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/19
|
||||
* Time: 下午2:09
|
||||
*/
|
||||
class AlipayF2FRefundResult
|
||||
{
|
||||
private $tradeStatus;
|
||||
private $response;
|
||||
|
||||
public function __construct($response)
|
||||
{
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
public function AlipayF2FPayResult($response)
|
||||
{
|
||||
$this->__construct($response);
|
||||
}
|
||||
|
||||
public function setTradeStatus($tradeStatus)
|
||||
{
|
||||
$this->tradeStatus = $tradeStatus;
|
||||
}
|
||||
|
||||
public function getTradeStatus()
|
||||
{
|
||||
return $this->tradeStatus;
|
||||
}
|
||||
|
||||
public function setResponse($response)
|
||||
{
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
public function getResponse()
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
46
plugins/alipay/notify.php
Normal file
46
plugins/alipay/notify.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
|
||||
require_once(PAY_ROOT."inc/AlipayTradeService.php");
|
||||
|
||||
|
||||
//计算得出通知验证结果
|
||||
$alipaySevice = new AlipayTradeService($config);
|
||||
//$alipaySevice->writeLog(var_export($_POST,true));
|
||||
$verify_result = $alipaySevice->check($_POST);
|
||||
|
||||
if($verify_result) {//验证成功
|
||||
//商户订单号
|
||||
|
||||
$out_trade_no = daddslashes($_POST['out_trade_no']);
|
||||
|
||||
//支付宝交易号
|
||||
|
||||
$trade_no = daddslashes($_POST['trade_no']);
|
||||
|
||||
//交易状态
|
||||
$trade_status = $_POST['trade_status'];
|
||||
|
||||
//买家支付宝
|
||||
$buyer_id = daddslashes($_POST['buyer_id']);
|
||||
|
||||
//交易金额
|
||||
$total_amount = $_POST['total_amount'];
|
||||
|
||||
if($_POST['trade_status'] == 'TRADE_FINISHED') {
|
||||
//退款日期超过可退款期限后(如三个月可退款),支付宝系统发送该交易状态通知
|
||||
}
|
||||
else if ($_POST['trade_status'] == 'TRADE_SUCCESS') {
|
||||
if($out_trade_no == TRADE_NO && round($total_amount,2)==round($order['money'],2) && $order['status']==0){
|
||||
if($DB->exec("update `pre_order` set `status` ='1' where `trade_no`='".TRADE_NO."'")){
|
||||
$DB->exec("update `pre_order` set `api_trade_no` ='$trade_no',`endtime` ='$date',`buyer` ='$buyer_id',`date` =NOW() where `trade_no`='".TRADE_NO."'");
|
||||
processOrder($order);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "success";
|
||||
}
|
||||
else {
|
||||
//验证失败
|
||||
echo "fail";
|
||||
170
plugins/alipay/qrcode.php
Normal file
170
plugins/alipay/qrcode.php
Normal file
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
/*
|
||||
* 支付宝当面付扫码支付
|
||||
*/
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
|
||||
$sitename=htmlspecialchars(base64_decode($_GET['sitename']));
|
||||
|
||||
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')!==false){
|
||||
include(SYSTEM_ROOT.'pages/wxopen.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once(PAY_ROOT."inc/model/builder/AlipayTradePrecreateContentBuilder.php");
|
||||
require_once(PAY_ROOT."inc/AlipayTradeService.php");
|
||||
|
||||
// 创建请求builder,设置请求参数
|
||||
$qrPayRequestBuilder = new AlipayTradePrecreateContentBuilder();
|
||||
$qrPayRequestBuilder->setOutTradeNo(TRADE_NO);
|
||||
$qrPayRequestBuilder->setTotalAmount($order['money']);
|
||||
$qrPayRequestBuilder->setSubject($ordername);
|
||||
|
||||
// 调用qrPay方法获取当面付应答
|
||||
$qrPay = new AlipayTradeService($config);
|
||||
$qrPayResult = $qrPay->qrPay($qrPayRequestBuilder);
|
||||
|
||||
// 根据状态值进行业务处理
|
||||
$status = $qrPayResult->getTradeStatus();
|
||||
$response = $qrPayResult->getResponse();
|
||||
if($status == 'SUCCESS'){
|
||||
$code_url = $response->qr_code;
|
||||
}elseif($status == 'FAILED'){
|
||||
sysmsg('支付宝创建订单二维码失败!['.$response->sub_code.']'.$response->sub_msg);
|
||||
}else{
|
||||
print_r($response);
|
||||
sysmsg('系统异常,状态未知!');
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="Content-Language" content="zh-cn">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>支付宝扫码支付 - <?php echo $sitename?></title>
|
||||
<link href="/assets/css/alipay_pay.css" rel="stylesheet" media="screen">
|
||||
</head>
|
||||
<body>
|
||||
<div class="body">
|
||||
<h1 class="mod-title">
|
||||
<span class="ico-wechat"></span><span class="text">支付宝扫码支付</span>
|
||||
</h1>
|
||||
<div class="mod-ct">
|
||||
<div class="order">
|
||||
</div>
|
||||
<div class="amount">¥<?php echo $order['money']?></div>
|
||||
<div class="qr-image" id="qrcode">
|
||||
</div>
|
||||
|
||||
<div class="detail" id="orderDetail">
|
||||
<dl class="detail-ct" style="display: none;">
|
||||
<dt>购买物品</dt>
|
||||
<dd id="productName"><?php echo $order['name']?></dd>
|
||||
<dt>商户订单号</dt>
|
||||
<dd id="billId"><?php echo $order['trade_no']?></dd>
|
||||
<dt>创建时间</dt>
|
||||
<dd id="createTime"><?php echo $order['addtime']?></dd>
|
||||
</dl>
|
||||
<a href="javascript:void(0)" class="arrow"><i class="ico-arrow"></i></a>
|
||||
</div>
|
||||
<div class="tip">
|
||||
<span class="dec dec-left"></span>
|
||||
<span class="dec dec-right"></span>
|
||||
<div class="ico-scan"></div>
|
||||
<div class="tip-text">
|
||||
<p>请使用支付宝扫一扫</p>
|
||||
<p>扫描二维码完成支付</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tip-text">
|
||||
</div>
|
||||
</div>
|
||||
<?php if(checkmobile()==true){?>
|
||||
<div class="foot">
|
||||
<div class="inner">
|
||||
<div id="J_downloadInteraction" class="download-interaction download-interaction-opening">
|
||||
<div class="inner-interaction">
|
||||
<p class="download-opening">正在打开支付宝<span class="download-opening-1">.</span><span class="download-opening-2">.</span><span class="download-opening-3">.</span></p>
|
||||
<p class="download-asking">如果没有打开支付宝,<a id="J_downloadBtn" href="javascript:;" onclick="openAli();">请点此重新唤起</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<script src="/assets/js/qcloud_util.js"></script>
|
||||
<script src="/assets/js/jquery-qrcode.min.js"></script>
|
||||
<script src="//cdn.staticfile.org/layer/2.3/layer.js"></script>
|
||||
<script>
|
||||
var code_url = '<?php echo $code_url?>';
|
||||
$('#qrcode').qrcode({
|
||||
text: code_url,
|
||||
width: 230,
|
||||
height: 230,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
// 订单详情
|
||||
$('#orderDetail .arrow').click(function (event) {
|
||||
if ($('#orderDetail').hasClass('detail-open')) {
|
||||
$('#orderDetail .detail-ct').slideUp(500, function () {
|
||||
$('#orderDetail').removeClass('detail-open');
|
||||
});
|
||||
} else {
|
||||
$('#orderDetail .detail-ct').slideDown(500, function () {
|
||||
$('#orderDetail').addClass('detail-open');
|
||||
});
|
||||
}
|
||||
});
|
||||
// 检查是否支付完成
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
timeout: 10000, //ajax请求超时时间10s
|
||||
data: {type: "alipay", trade_no: "<?php echo $order['trade_no']?>"}, //post数据
|
||||
success: function (data, textStatus) {
|
||||
//从服务器得到数据,显示数据并继续查询
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.01,time: 15000});
|
||||
setTimeout(window.location.href=data.backurl, 1000);
|
||||
}else{
|
||||
setTimeout("loadmsg()", 4000);
|
||||
}
|
||||
},
|
||||
//Ajax请求超时,继续查询
|
||||
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
||||
if (textStatus == "timeout") {
|
||||
setTimeout("loadmsg()", 1000);
|
||||
} else { //异常
|
||||
setTimeout("loadmsg()", 4000);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function openAli(){
|
||||
var scheme = 'alipays://platformapi/startapp?saId=10000007&qrcode=';
|
||||
scheme += encodeURIComponent(code_url);
|
||||
|
||||
if(navigator.userAgent.indexOf("Safari") > -1){
|
||||
window.location.href = scheme;
|
||||
}
|
||||
else{
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.style.display = "none";
|
||||
iframe.src = scheme;
|
||||
document.body.appendChild(iframe);
|
||||
}
|
||||
}
|
||||
window.onload = function(){
|
||||
openAli();
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
29
plugins/alipay/refund.php
Normal file
29
plugins/alipay/refund.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/*
|
||||
* 支付宝退款接口
|
||||
*/
|
||||
if(!defined('IN_REFUND'))exit();
|
||||
|
||||
require_once(PAY_ROOT."inc/model/builder/AlipayTradeRefundContentBuilder.php");
|
||||
require_once(PAY_ROOT."inc/AlipayTradeService.php");
|
||||
|
||||
// 创建请求builder,设置请求参数
|
||||
$requestBuilder = new AlipayTradeRefundContentBuilder();
|
||||
$requestBuilder->setTradeNo($order['api_trade_no']);
|
||||
$requestBuilder->setRefundAmount($order['realmoney']);
|
||||
|
||||
// 调用退款接口
|
||||
$trade = new AlipayTradeService($config);
|
||||
$refundResult = $trade->refund($requestBuilder);
|
||||
|
||||
// 根据状态值进行业务处理
|
||||
$status = $refundResult->getTradeStatus();
|
||||
$response = $refundResult->getResponse();
|
||||
if($status == 'SUCCESS'){
|
||||
$result = ['code'=>0, 'trade_no'=>$response->trade_no, 'refund_fee'=>$response->refund_fee, 'refund_time'=>$response->gmt_refund_pay, 'buyer'=>$response->buyer_user_id];
|
||||
}elseif($status == 'FAILED'){
|
||||
$result = ['code'=>-1, 'msg'=>'['.$response->sub_code.']'.$response->sub_msg];
|
||||
}else{
|
||||
$result = ['code'=>-1, 'msg'=>'未知错误'];
|
||||
}
|
||||
return $result;
|
||||
44
plugins/alipay/return.php
Normal file
44
plugins/alipay/return.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
|
||||
require_once(PAY_ROOT."inc/AlipayTradeService.php");
|
||||
|
||||
|
||||
//计算得出通知验证结果
|
||||
$alipaySevice = new AlipayTradeService($config);
|
||||
//$alipaySevice->writeLog(var_export($_POST,true));
|
||||
$verify_result = $alipaySevice->check($_GET);
|
||||
|
||||
if($verify_result) {//验证成功
|
||||
//商户订单号
|
||||
|
||||
$out_trade_no = daddslashes($_GET['out_trade_no']);
|
||||
|
||||
//支付宝交易号
|
||||
|
||||
$trade_no = daddslashes($_GET['trade_no']);
|
||||
|
||||
//交易金额
|
||||
$total_amount = $_GET['total_amount'];
|
||||
|
||||
if($out_trade_no == TRADE_NO && round($total_amount,2)==round($order['money'],2)){
|
||||
$url=creat_callback($order);
|
||||
|
||||
if($order['status']==0){
|
||||
if($DB->exec("update `pre_order` set `status` ='1' where `trade_no`='".TRADE_NO."'")){
|
||||
$DB->exec("update `pre_order` set `api_trade_no` ='$trade_no',`endtime` ='$date',`date` =NOW() where `trade_no`='".TRADE_NO."'");
|
||||
processOrder($order,false);
|
||||
}
|
||||
echo '<script>window.location.href="'.$url['return'].'";</script>';
|
||||
}else{
|
||||
echo '<script>window.location.href="'.$url['return'].'";</script>';
|
||||
}
|
||||
}else{
|
||||
sysmsg('订单信息校验失败');
|
||||
}
|
||||
}
|
||||
else {
|
||||
//验证失败
|
||||
sysmsg('支付宝返回验证失败!');
|
||||
45
plugins/alipay/submit.php
Normal file
45
plugins/alipay/submit.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
|
||||
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')!==false && !$submit2){
|
||||
echo "<script>window.location.href='/submit2.php?typeid={$order['type']}&trade_no={$trade_no}';</script>";exit;
|
||||
}
|
||||
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')!==false){
|
||||
include(SYSTEM_ROOT.'pages/wxopen.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
if(in_array('3',$channel['apptype']) && !in_array('1',$channel['apptype']) && !in_array('2',$channel['apptype'])){
|
||||
echo "<script>window.location.href='/pay/alipay/qrcode/{$trade_no}/?sitename={$sitename}';</script>";
|
||||
}else{
|
||||
|
||||
if(!empty($conf['localurl_alipay']) && !strpos($conf['localurl_alipay'],$_SERVER['HTTP_HOST'])){
|
||||
echo "<script>window.location.href='{$conf['localurl_alipay']}submit2.php?typeid={$order['type']}&trade_no={$trade_no}';</script>";exit;
|
||||
}
|
||||
|
||||
if(checkmobile()==true && in_array('2',$channel['apptype'])){
|
||||
require_once(PAY_ROOT."inc/model/builder/AlipayTradeWapPayContentBuilder.php");
|
||||
require_once(PAY_ROOT."inc/AlipayTradeService.php");
|
||||
|
||||
//¹¹Ôì²ÎÊý
|
||||
$payRequestBuilder = new AlipayTradeWapPayContentBuilder();
|
||||
$payRequestBuilder->setSubject($ordername);
|
||||
$payRequestBuilder->setTotalAmount($order['money']);
|
||||
$payRequestBuilder->setOutTradeNo($trade_no);
|
||||
|
||||
$aop = new AlipayTradeService($config);
|
||||
echo $aop->wapPay($payRequestBuilder);
|
||||
}else{
|
||||
require_once(PAY_ROOT."inc/model/builder/AlipayTradePagePayContentBuilder.php");
|
||||
require_once(PAY_ROOT."inc/AlipayTradeService.php");
|
||||
|
||||
//¹¹Ôì²ÎÊý
|
||||
$payRequestBuilder = new AlipayTradePagePayContentBuilder();
|
||||
$payRequestBuilder->setSubject($ordername);
|
||||
$payRequestBuilder->setTotalAmount($order['money']);
|
||||
$payRequestBuilder->setOutTradeNo($trade_no);
|
||||
|
||||
$aop = new AlipayTradeService($config);
|
||||
echo $aop->pagePay($payRequestBuilder);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user