AlipayBusinessOrderCreateResponse.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.response.AlipayResponse import AlipayResponse
  5. from alipay.aop.api.domain.MarketingInfo import MarketingInfo
  6. class AlipayBusinessOrderCreateResponse(AlipayResponse):
  7. def __init__(self):
  8. super(AlipayBusinessOrderCreateResponse, self).__init__()
  9. self._confirmed_marketing = None
  10. self._merchant_order_no = None
  11. self._order_no = None
  12. @property
  13. def confirmed_marketing(self):
  14. return self._confirmed_marketing
  15. @confirmed_marketing.setter
  16. def confirmed_marketing(self, value):
  17. if isinstance(value, MarketingInfo):
  18. self._confirmed_marketing = value
  19. else:
  20. self._confirmed_marketing = MarketingInfo.from_alipay_dict(value)
  21. @property
  22. def merchant_order_no(self):
  23. return self._merchant_order_no
  24. @merchant_order_no.setter
  25. def merchant_order_no(self, value):
  26. self._merchant_order_no = value
  27. @property
  28. def order_no(self):
  29. return self._order_no
  30. @order_no.setter
  31. def order_no(self, value):
  32. self._order_no = value
  33. def parse_response_content(self, response_content):
  34. response = super(AlipayBusinessOrderCreateResponse, self).parse_response_content(response_content)
  35. if 'confirmed_marketing' in response:
  36. self.confirmed_marketing = response['confirmed_marketing']
  37. if 'merchant_order_no' in response:
  38. self.merchant_order_no = response['merchant_order_no']
  39. if 'order_no' in response:
  40. self.order_no = response['order_no']