PaytoolRefundResultDetail.py 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. from alipay.aop.api.domain.TradeFundBill import TradeFundBill
  6. class PaytoolRefundResultDetail(object):
  7. def __init__(self):
  8. self._gmt_refund = None
  9. self._paytool_bill_no = None
  10. self._paytool_request_no = None
  11. self._refund_amount = None
  12. self._refund_fund_bill_list = None
  13. self._status = None
  14. self._tool_code = None
  15. @property
  16. def gmt_refund(self):
  17. return self._gmt_refund
  18. @gmt_refund.setter
  19. def gmt_refund(self, value):
  20. self._gmt_refund = value
  21. @property
  22. def paytool_bill_no(self):
  23. return self._paytool_bill_no
  24. @paytool_bill_no.setter
  25. def paytool_bill_no(self, value):
  26. self._paytool_bill_no = value
  27. @property
  28. def paytool_request_no(self):
  29. return self._paytool_request_no
  30. @paytool_request_no.setter
  31. def paytool_request_no(self, value):
  32. self._paytool_request_no = value
  33. @property
  34. def refund_amount(self):
  35. return self._refund_amount
  36. @refund_amount.setter
  37. def refund_amount(self, value):
  38. self._refund_amount = value
  39. @property
  40. def refund_fund_bill_list(self):
  41. return self._refund_fund_bill_list
  42. @refund_fund_bill_list.setter
  43. def refund_fund_bill_list(self, value):
  44. if isinstance(value, list):
  45. self._refund_fund_bill_list = list()
  46. for i in value:
  47. if isinstance(i, TradeFundBill):
  48. self._refund_fund_bill_list.append(i)
  49. else:
  50. self._refund_fund_bill_list.append(TradeFundBill.from_alipay_dict(i))
  51. @property
  52. def status(self):
  53. return self._status
  54. @status.setter
  55. def status(self, value):
  56. self._status = value
  57. @property
  58. def tool_code(self):
  59. return self._tool_code
  60. @tool_code.setter
  61. def tool_code(self, value):
  62. self._tool_code = value
  63. def to_alipay_dict(self):
  64. params = dict()
  65. if self.gmt_refund:
  66. if hasattr(self.gmt_refund, 'to_alipay_dict'):
  67. params['gmt_refund'] = self.gmt_refund.to_alipay_dict()
  68. else:
  69. params['gmt_refund'] = self.gmt_refund
  70. if self.paytool_bill_no:
  71. if hasattr(self.paytool_bill_no, 'to_alipay_dict'):
  72. params['paytool_bill_no'] = self.paytool_bill_no.to_alipay_dict()
  73. else:
  74. params['paytool_bill_no'] = self.paytool_bill_no
  75. if self.paytool_request_no:
  76. if hasattr(self.paytool_request_no, 'to_alipay_dict'):
  77. params['paytool_request_no'] = self.paytool_request_no.to_alipay_dict()
  78. else:
  79. params['paytool_request_no'] = self.paytool_request_no
  80. if self.refund_amount:
  81. if hasattr(self.refund_amount, 'to_alipay_dict'):
  82. params['refund_amount'] = self.refund_amount.to_alipay_dict()
  83. else:
  84. params['refund_amount'] = self.refund_amount
  85. if self.refund_fund_bill_list:
  86. if isinstance(self.refund_fund_bill_list, list):
  87. for i in range(0, len(self.refund_fund_bill_list)):
  88. element = self.refund_fund_bill_list[i]
  89. if hasattr(element, 'to_alipay_dict'):
  90. self.refund_fund_bill_list[i] = element.to_alipay_dict()
  91. if hasattr(self.refund_fund_bill_list, 'to_alipay_dict'):
  92. params['refund_fund_bill_list'] = self.refund_fund_bill_list.to_alipay_dict()
  93. else:
  94. params['refund_fund_bill_list'] = self.refund_fund_bill_list
  95. if self.status:
  96. if hasattr(self.status, 'to_alipay_dict'):
  97. params['status'] = self.status.to_alipay_dict()
  98. else:
  99. params['status'] = self.status
  100. if self.tool_code:
  101. if hasattr(self.tool_code, 'to_alipay_dict'):
  102. params['tool_code'] = self.tool_code.to_alipay_dict()
  103. else:
  104. params['tool_code'] = self.tool_code
  105. return params
  106. @staticmethod
  107. def from_alipay_dict(d):
  108. if not d:
  109. return None
  110. o = PaytoolRefundResultDetail()
  111. if 'gmt_refund' in d:
  112. o.gmt_refund = d['gmt_refund']
  113. if 'paytool_bill_no' in d:
  114. o.paytool_bill_no = d['paytool_bill_no']
  115. if 'paytool_request_no' in d:
  116. o.paytool_request_no = d['paytool_request_no']
  117. if 'refund_amount' in d:
  118. o.refund_amount = d['refund_amount']
  119. if 'refund_fund_bill_list' in d:
  120. o.refund_fund_bill_list = d['refund_fund_bill_list']
  121. if 'status' in d:
  122. o.status = d['status']
  123. if 'tool_code' in d:
  124. o.tool_code = d['tool_code']
  125. return o