添加后台代理代码
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/19
|
||||
* Time: 下午2:09
|
||||
*/
|
||||
require_once 'ContentBuilder.php';
|
||||
|
||||
class AlipayTradeCancelContentBuilder extends ContentBuilder
|
||||
{
|
||||
// 支付宝交易号,和商户订单号不能同时为空
|
||||
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,266 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/18
|
||||
* Time: 下午2:09
|
||||
*/
|
||||
require_once 'GoodsDetail.php';
|
||||
require_once 'ExtendParams.php';
|
||||
require_once 'RoyaltyDetailInfo.php';
|
||||
require_once 'ContentBuilder.php';
|
||||
|
||||
class AlipayTradePayContentBuilder extends ContentBuilder
|
||||
{
|
||||
//支付场景码,此处为条码支付bar_code
|
||||
private $scene;
|
||||
|
||||
//支付授权码,用户支付宝钱包app点击"付款",在条码下对应的一串数字
|
||||
private $authCode;
|
||||
|
||||
// 商户网站订单系统中唯一订单号,64个字符以内,只能包含字母、数字、下划线,
|
||||
// 需保证商户系统端不能重复,建议通过数据库sequence生成,
|
||||
private $outTradeNo;
|
||||
|
||||
// 卖家支付宝账号ID,用于支持一个签约账号下支持打款到不同的收款账号,(打款到sellerId对应的支付宝账号)
|
||||
// 如果该字段为空,则默认为与支付宝签约的商户的PID,也就是appid对应的PID
|
||||
private $sellerId;
|
||||
|
||||
// 订单总金额,整形,此处单位为元,精确到小数点后2位,不能超过1亿元
|
||||
// 如果同时传入了【打折金额】,【不可打折金额】,【订单总金额】三者,则必须满足如下条件:【订单总金额】=【打折金额】+【不可打折金额】
|
||||
private $totalAmount;
|
||||
|
||||
// 订单可打折金额,此处单位为元,精确到小数点后2位
|
||||
// 可以配合商家平台配置折扣活动,如果订单部分商品参与打折,可以将部分商品总价填写至此字段,默认全部商品可打折
|
||||
// 如果该值未传入,但传入了【订单总金额】,【不可打折金额】 则该值默认为【订单总金额】- 【不可打折金额】
|
||||
private $discountableAmount;
|
||||
|
||||
// 订单不可打折金额,此处单位为元,精确到小数点后2位,可以配合商家平台配置折扣活动,如果酒水不参与打折,则将对应金额填写至此字段
|
||||
// 如果该值未传入,但传入了【订单总金额】,【打折金额】,则该值默认为【订单总金额】-【打折金额】
|
||||
private $undiscountableAmount;
|
||||
|
||||
// 订单标题,粗略描述用户的支付目的。如“XX品牌XXX门店消费”
|
||||
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 __construct()
|
||||
{
|
||||
$this->bizParas['scene'] = "bar_code";
|
||||
}
|
||||
|
||||
public function AlipayTradePayContentBuilder()
|
||||
{
|
||||
$this->__construct();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public function getAuthCode()
|
||||
{
|
||||
return $this->authCode;
|
||||
}
|
||||
|
||||
public function setAuthCode($authCode)
|
||||
{
|
||||
$this->authCode = $authCode;
|
||||
$this->bizParas['auth_code'] = $authCode;
|
||||
}
|
||||
|
||||
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 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,253 @@
|
||||
<?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_f2fpay 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,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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -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,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xudong.ding
|
||||
* Date: 16/5/19
|
||||
* Time: 下午2:09
|
||||
*/
|
||||
class AlipayF2FPayResult
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user