GoodsDetail.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. namespace app\common\services\alipay\f2fpay\model\builder;
  3. /**
  4. * Created by PhpStorm.
  5. * User: xudong.ding
  6. * Date: 16/5/19
  7. * Time: 下午2:09
  8. */
  9. class GoodsDetail
  10. {
  11. // 商品编号(国标)
  12. private $goodsId;
  13. //支付宝定义的统一商品编号
  14. private $alipayGoodsId;
  15. // 商品名称
  16. private $goodsName;
  17. // 商品数量
  18. private $quantity;
  19. // 商品价格,此处单位为元,精确到小数点后2位
  20. private $price;
  21. // 商品类别
  22. private $goodsCategory;
  23. // 商品详情
  24. private $body;
  25. private $goodsDetail = array();
  26. //单个商品json字符串
  27. //private $goodsDetailStr = NULL;
  28. //获取单个商品的json字符串
  29. public function getGoodsDetail()
  30. {
  31. return $this->goodsDetail;
  32. /*$this->goodsDetailStr = "{";
  33. foreach ($this->goodsDetail as $k => $v){
  34. $this->goodsDetailStr.= "\"".$k."\":\"".$v."\",";
  35. }
  36. $this->goodsDetailStr = substr($this->goodsDetailStr,0,-1);
  37. $this->goodsDetailStr.= "}";
  38. return $this->goodsDetailStr;*/
  39. }
  40. public function setGoodsId($goodsId)
  41. {
  42. $this->goodsId = $goodsId;
  43. $this->goodsDetail['goods_id'] = $goodsId;
  44. }
  45. public function getGoodsId()
  46. {
  47. return $this->goodsId;
  48. }
  49. public function setAlipayGoodsId($alipayGoodsId)
  50. {
  51. $this->alipayGoodsId = $alipayGoodsId;
  52. $this->goodsDetail['alipay_goods_id'] = $alipayGoodsId;
  53. }
  54. public function getAlipayGoodsId()
  55. {
  56. return $this->alipayGoodsId;
  57. }
  58. public function setGoodsName($goodsName)
  59. {
  60. $this->goodsName = $goodsName;
  61. $this->goodsDetail['goods_name'] = $goodsName;
  62. }
  63. public function getGoodsName()
  64. {
  65. return $this->goodsName;
  66. }
  67. public function setQuantity($quantity)
  68. {
  69. $this->quantity = $quantity;
  70. $this->goodsDetail['quantity'] = $quantity;
  71. }
  72. public function getQuantity()
  73. {
  74. return $this->quantity;
  75. }
  76. public function setPrice($price)
  77. {
  78. $this->price = $price;
  79. $this->goodsDetail['price'] = $price;
  80. }
  81. public function getPrice()
  82. {
  83. return $this->price;
  84. }
  85. public function setGoodsCategory($goodsCategory)
  86. {
  87. $this->goodsCategory = $goodsCategory;
  88. $this->goodsDetail['goods_category'] = $goodsCategory;
  89. }
  90. public function getGoodsCategory()
  91. {
  92. return $this->goodsCategory;
  93. }
  94. public function setBody($body)
  95. {
  96. $this->body = $body;
  97. $this->goodsDetail['body'] = $body;
  98. }
  99. public function getBody()
  100. {
  101. return $this->body;
  102. }
  103. }
  104. ?>