AlipayTradeCloseContentBuilder.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /* *
  3. * 功能:支付宝手机网站alipay.trade.close (统一收单交易关闭接口)业务参数封装
  4. * 版本:2.0
  5. * 修改日期:2016-11-01
  6. * 说明:
  7. * 以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。
  8. */
  9. class AlipayTradeCloseContentBuilder
  10. {
  11. // 商户订单号.
  12. private $outTradeNo;
  13. // 支付宝交易号
  14. private $tradeNo;
  15. //卖家端自定义的的操作员 ID
  16. private $operatorId;
  17. private $bizContentarr = array();
  18. private $bizContent = NULL;
  19. public function getBizContent()
  20. {
  21. if(!empty($this->bizContentarr)){
  22. $this->bizContent = json_encode($this->bizContentarr,JSON_UNESCAPED_UNICODE);
  23. }
  24. return $this->bizContent;
  25. }
  26. public function getTradeNo()
  27. {
  28. return $this->tradeNo;
  29. }
  30. public function setTradeNo($tradeNo)
  31. {
  32. $this->tradeNo = $tradeNo;
  33. $this->bizContentarr['trade_no'] = $tradeNo;
  34. }
  35. public function getOutTradeNo()
  36. {
  37. return $this->outTradeNo;
  38. }
  39. public function setOutTradeNo($outTradeNo)
  40. {
  41. $this->outTradeNo = $outTradeNo;
  42. $this->bizContentarr['out_trade_no'] = $outTradeNo;
  43. }
  44. public function getOperatorId()
  45. {
  46. return $this->operatorId;
  47. }
  48. public function setOperatorId($operatorId)
  49. {
  50. $this->operatorId = $operatorId;
  51. $this->bizContentarr['operator_id'] = $operatorId;
  52. }
  53. }
  54. ?>