FulfillmentInfo.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class FulfillmentInfo(object):
  6. def __init__(self):
  7. self._biz_ext_param = None
  8. self._biz_time = None
  9. self._out_order_no = None
  10. @property
  11. def biz_ext_param(self):
  12. return self._biz_ext_param
  13. @biz_ext_param.setter
  14. def biz_ext_param(self, value):
  15. self._biz_ext_param = value
  16. @property
  17. def biz_time(self):
  18. return self._biz_time
  19. @biz_time.setter
  20. def biz_time(self, value):
  21. self._biz_time = value
  22. @property
  23. def out_order_no(self):
  24. return self._out_order_no
  25. @out_order_no.setter
  26. def out_order_no(self, value):
  27. self._out_order_no = value
  28. def to_alipay_dict(self):
  29. params = dict()
  30. if self.biz_ext_param:
  31. if hasattr(self.biz_ext_param, 'to_alipay_dict'):
  32. params['biz_ext_param'] = self.biz_ext_param.to_alipay_dict()
  33. else:
  34. params['biz_ext_param'] = self.biz_ext_param
  35. if self.biz_time:
  36. if hasattr(self.biz_time, 'to_alipay_dict'):
  37. params['biz_time'] = self.biz_time.to_alipay_dict()
  38. else:
  39. params['biz_time'] = self.biz_time
  40. if self.out_order_no:
  41. if hasattr(self.out_order_no, 'to_alipay_dict'):
  42. params['out_order_no'] = self.out_order_no.to_alipay_dict()
  43. else:
  44. params['out_order_no'] = self.out_order_no
  45. return params
  46. @staticmethod
  47. def from_alipay_dict(d):
  48. if not d:
  49. return None
  50. o = FulfillmentInfo()
  51. if 'biz_ext_param' in d:
  52. o.biz_ext_param = d['biz_ext_param']
  53. if 'biz_time' in d:
  54. o.biz_time = d['biz_time']
  55. if 'out_order_no' in d:
  56. o.out_order_no = d['out_order_no']
  57. return o