AlipayTradeWapPayModel.py 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  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.ExtUserInfo import ExtUserInfo
  6. from alipay.aop.api.domain.ExtendParams import ExtendParams
  7. from alipay.aop.api.domain.InvoiceInfo import InvoiceInfo
  8. from alipay.aop.api.domain.RoyaltyInfo import RoyaltyInfo
  9. from alipay.aop.api.domain.SettleInfo import SettleInfo
  10. from alipay.aop.api.domain.SubMerchant import SubMerchant
  11. class AlipayTradeWapPayModel(object):
  12. def __init__(self):
  13. self._auth_token = None
  14. self._body = None
  15. self._business_params = None
  16. self._disable_pay_channels = None
  17. self._enable_pay_channels = None
  18. self._ext_user_info = None
  19. self._extend_params = None
  20. self._goods_type = None
  21. self._invoice_info = None
  22. self._merchant_order_no = None
  23. self._out_trade_no = None
  24. self._passback_params = None
  25. self._product_code = None
  26. self._promo_params = None
  27. self._quit_url = None
  28. self._royalty_info = None
  29. self._seller_id = None
  30. self._settle_info = None
  31. self._specified_channel = None
  32. self._store_id = None
  33. self._sub_merchant = None
  34. self._subject = None
  35. self._time_expire = None
  36. self._timeout_express = None
  37. self._total_amount = None
  38. @property
  39. def auth_token(self):
  40. return self._auth_token
  41. @auth_token.setter
  42. def auth_token(self, value):
  43. self._auth_token = value
  44. @property
  45. def body(self):
  46. return self._body
  47. @body.setter
  48. def body(self, value):
  49. self._body = value
  50. @property
  51. def business_params(self):
  52. return self._business_params
  53. @business_params.setter
  54. def business_params(self, value):
  55. self._business_params = value
  56. @property
  57. def disable_pay_channels(self):
  58. return self._disable_pay_channels
  59. @disable_pay_channels.setter
  60. def disable_pay_channels(self, value):
  61. self._disable_pay_channels = value
  62. @property
  63. def enable_pay_channels(self):
  64. return self._enable_pay_channels
  65. @enable_pay_channels.setter
  66. def enable_pay_channels(self, value):
  67. self._enable_pay_channels = value
  68. @property
  69. def ext_user_info(self):
  70. return self._ext_user_info
  71. @ext_user_info.setter
  72. def ext_user_info(self, value):
  73. if isinstance(value, ExtUserInfo):
  74. self._ext_user_info = value
  75. else:
  76. self._ext_user_info = ExtUserInfo.from_alipay_dict(value)
  77. @property
  78. def extend_params(self):
  79. return self._extend_params
  80. @extend_params.setter
  81. def extend_params(self, value):
  82. if isinstance(value, ExtendParams):
  83. self._extend_params = value
  84. else:
  85. self._extend_params = ExtendParams.from_alipay_dict(value)
  86. @property
  87. def goods_type(self):
  88. return self._goods_type
  89. @goods_type.setter
  90. def goods_type(self, value):
  91. self._goods_type = value
  92. @property
  93. def invoice_info(self):
  94. return self._invoice_info
  95. @invoice_info.setter
  96. def invoice_info(self, value):
  97. if isinstance(value, InvoiceInfo):
  98. self._invoice_info = value
  99. else:
  100. self._invoice_info = InvoiceInfo.from_alipay_dict(value)
  101. @property
  102. def merchant_order_no(self):
  103. return self._merchant_order_no
  104. @merchant_order_no.setter
  105. def merchant_order_no(self, value):
  106. self._merchant_order_no = value
  107. @property
  108. def out_trade_no(self):
  109. return self._out_trade_no
  110. @out_trade_no.setter
  111. def out_trade_no(self, value):
  112. self._out_trade_no = value
  113. @property
  114. def passback_params(self):
  115. return self._passback_params
  116. @passback_params.setter
  117. def passback_params(self, value):
  118. self._passback_params = value
  119. @property
  120. def product_code(self):
  121. return self._product_code
  122. @product_code.setter
  123. def product_code(self, value):
  124. self._product_code = value
  125. @property
  126. def promo_params(self):
  127. return self._promo_params
  128. @promo_params.setter
  129. def promo_params(self, value):
  130. self._promo_params = value
  131. @property
  132. def quit_url(self):
  133. return self._quit_url
  134. @quit_url.setter
  135. def quit_url(self, value):
  136. self._quit_url = value
  137. @property
  138. def royalty_info(self):
  139. return self._royalty_info
  140. @royalty_info.setter
  141. def royalty_info(self, value):
  142. if isinstance(value, RoyaltyInfo):
  143. self._royalty_info = value
  144. else:
  145. self._royalty_info = RoyaltyInfo.from_alipay_dict(value)
  146. @property
  147. def seller_id(self):
  148. return self._seller_id
  149. @seller_id.setter
  150. def seller_id(self, value):
  151. self._seller_id = value
  152. @property
  153. def settle_info(self):
  154. return self._settle_info
  155. @settle_info.setter
  156. def settle_info(self, value):
  157. if isinstance(value, SettleInfo):
  158. self._settle_info = value
  159. else:
  160. self._settle_info = SettleInfo.from_alipay_dict(value)
  161. @property
  162. def specified_channel(self):
  163. return self._specified_channel
  164. @specified_channel.setter
  165. def specified_channel(self, value):
  166. self._specified_channel = value
  167. @property
  168. def store_id(self):
  169. return self._store_id
  170. @store_id.setter
  171. def store_id(self, value):
  172. self._store_id = value
  173. @property
  174. def sub_merchant(self):
  175. return self._sub_merchant
  176. @sub_merchant.setter
  177. def sub_merchant(self, value):
  178. if isinstance(value, SubMerchant):
  179. self._sub_merchant = value
  180. else:
  181. self._sub_merchant = SubMerchant.from_alipay_dict(value)
  182. @property
  183. def subject(self):
  184. return self._subject
  185. @subject.setter
  186. def subject(self, value):
  187. self._subject = value
  188. @property
  189. def time_expire(self):
  190. return self._time_expire
  191. @time_expire.setter
  192. def time_expire(self, value):
  193. self._time_expire = value
  194. @property
  195. def timeout_express(self):
  196. return self._timeout_express
  197. @timeout_express.setter
  198. def timeout_express(self, value):
  199. self._timeout_express = value
  200. @property
  201. def total_amount(self):
  202. return self._total_amount
  203. @total_amount.setter
  204. def total_amount(self, value):
  205. self._total_amount = value
  206. def to_alipay_dict(self):
  207. params = dict()
  208. if self.auth_token:
  209. if hasattr(self.auth_token, 'to_alipay_dict'):
  210. params['auth_token'] = self.auth_token.to_alipay_dict()
  211. else:
  212. params['auth_token'] = self.auth_token
  213. if self.body:
  214. if hasattr(self.body, 'to_alipay_dict'):
  215. params['body'] = self.body.to_alipay_dict()
  216. else:
  217. params['body'] = self.body
  218. if self.business_params:
  219. if hasattr(self.business_params, 'to_alipay_dict'):
  220. params['business_params'] = self.business_params.to_alipay_dict()
  221. else:
  222. params['business_params'] = self.business_params
  223. if self.disable_pay_channels:
  224. if hasattr(self.disable_pay_channels, 'to_alipay_dict'):
  225. params['disable_pay_channels'] = self.disable_pay_channels.to_alipay_dict()
  226. else:
  227. params['disable_pay_channels'] = self.disable_pay_channels
  228. if self.enable_pay_channels:
  229. if hasattr(self.enable_pay_channels, 'to_alipay_dict'):
  230. params['enable_pay_channels'] = self.enable_pay_channels.to_alipay_dict()
  231. else:
  232. params['enable_pay_channels'] = self.enable_pay_channels
  233. if self.ext_user_info:
  234. if hasattr(self.ext_user_info, 'to_alipay_dict'):
  235. params['ext_user_info'] = self.ext_user_info.to_alipay_dict()
  236. else:
  237. params['ext_user_info'] = self.ext_user_info
  238. if self.extend_params:
  239. if hasattr(self.extend_params, 'to_alipay_dict'):
  240. params['extend_params'] = self.extend_params.to_alipay_dict()
  241. else:
  242. params['extend_params'] = self.extend_params
  243. if self.goods_type:
  244. if hasattr(self.goods_type, 'to_alipay_dict'):
  245. params['goods_type'] = self.goods_type.to_alipay_dict()
  246. else:
  247. params['goods_type'] = self.goods_type
  248. if self.invoice_info:
  249. if hasattr(self.invoice_info, 'to_alipay_dict'):
  250. params['invoice_info'] = self.invoice_info.to_alipay_dict()
  251. else:
  252. params['invoice_info'] = self.invoice_info
  253. if self.merchant_order_no:
  254. if hasattr(self.merchant_order_no, 'to_alipay_dict'):
  255. params['merchant_order_no'] = self.merchant_order_no.to_alipay_dict()
  256. else:
  257. params['merchant_order_no'] = self.merchant_order_no
  258. if self.out_trade_no:
  259. if hasattr(self.out_trade_no, 'to_alipay_dict'):
  260. params['out_trade_no'] = self.out_trade_no.to_alipay_dict()
  261. else:
  262. params['out_trade_no'] = self.out_trade_no
  263. if self.passback_params:
  264. if hasattr(self.passback_params, 'to_alipay_dict'):
  265. params['passback_params'] = self.passback_params.to_alipay_dict()
  266. else:
  267. params['passback_params'] = self.passback_params
  268. if self.product_code:
  269. if hasattr(self.product_code, 'to_alipay_dict'):
  270. params['product_code'] = self.product_code.to_alipay_dict()
  271. else:
  272. params['product_code'] = self.product_code
  273. if self.promo_params:
  274. if hasattr(self.promo_params, 'to_alipay_dict'):
  275. params['promo_params'] = self.promo_params.to_alipay_dict()
  276. else:
  277. params['promo_params'] = self.promo_params
  278. if self.quit_url:
  279. if hasattr(self.quit_url, 'to_alipay_dict'):
  280. params['quit_url'] = self.quit_url.to_alipay_dict()
  281. else:
  282. params['quit_url'] = self.quit_url
  283. if self.royalty_info:
  284. if hasattr(self.royalty_info, 'to_alipay_dict'):
  285. params['royalty_info'] = self.royalty_info.to_alipay_dict()
  286. else:
  287. params['royalty_info'] = self.royalty_info
  288. if self.seller_id:
  289. if hasattr(self.seller_id, 'to_alipay_dict'):
  290. params['seller_id'] = self.seller_id.to_alipay_dict()
  291. else:
  292. params['seller_id'] = self.seller_id
  293. if self.settle_info:
  294. if hasattr(self.settle_info, 'to_alipay_dict'):
  295. params['settle_info'] = self.settle_info.to_alipay_dict()
  296. else:
  297. params['settle_info'] = self.settle_info
  298. if self.specified_channel:
  299. if hasattr(self.specified_channel, 'to_alipay_dict'):
  300. params['specified_channel'] = self.specified_channel.to_alipay_dict()
  301. else:
  302. params['specified_channel'] = self.specified_channel
  303. if self.store_id:
  304. if hasattr(self.store_id, 'to_alipay_dict'):
  305. params['store_id'] = self.store_id.to_alipay_dict()
  306. else:
  307. params['store_id'] = self.store_id
  308. if self.sub_merchant:
  309. if hasattr(self.sub_merchant, 'to_alipay_dict'):
  310. params['sub_merchant'] = self.sub_merchant.to_alipay_dict()
  311. else:
  312. params['sub_merchant'] = self.sub_merchant
  313. if self.subject:
  314. if hasattr(self.subject, 'to_alipay_dict'):
  315. params['subject'] = self.subject.to_alipay_dict()
  316. else:
  317. params['subject'] = self.subject
  318. if self.time_expire:
  319. if hasattr(self.time_expire, 'to_alipay_dict'):
  320. params['time_expire'] = self.time_expire.to_alipay_dict()
  321. else:
  322. params['time_expire'] = self.time_expire
  323. if self.timeout_express:
  324. if hasattr(self.timeout_express, 'to_alipay_dict'):
  325. params['timeout_express'] = self.timeout_express.to_alipay_dict()
  326. else:
  327. params['timeout_express'] = self.timeout_express
  328. if self.total_amount:
  329. if hasattr(self.total_amount, 'to_alipay_dict'):
  330. params['total_amount'] = self.total_amount.to_alipay_dict()
  331. else:
  332. params['total_amount'] = self.total_amount
  333. return params
  334. @staticmethod
  335. def from_alipay_dict(d):
  336. if not d:
  337. return None
  338. o = AlipayTradeWapPayModel()
  339. if 'auth_token' in d:
  340. o.auth_token = d['auth_token']
  341. if 'body' in d:
  342. o.body = d['body']
  343. if 'business_params' in d:
  344. o.business_params = d['business_params']
  345. if 'disable_pay_channels' in d:
  346. o.disable_pay_channels = d['disable_pay_channels']
  347. if 'enable_pay_channels' in d:
  348. o.enable_pay_channels = d['enable_pay_channels']
  349. if 'ext_user_info' in d:
  350. o.ext_user_info = d['ext_user_info']
  351. if 'extend_params' in d:
  352. o.extend_params = d['extend_params']
  353. if 'goods_type' in d:
  354. o.goods_type = d['goods_type']
  355. if 'invoice_info' in d:
  356. o.invoice_info = d['invoice_info']
  357. if 'merchant_order_no' in d:
  358. o.merchant_order_no = d['merchant_order_no']
  359. if 'out_trade_no' in d:
  360. o.out_trade_no = d['out_trade_no']
  361. if 'passback_params' in d:
  362. o.passback_params = d['passback_params']
  363. if 'product_code' in d:
  364. o.product_code = d['product_code']
  365. if 'promo_params' in d:
  366. o.promo_params = d['promo_params']
  367. if 'quit_url' in d:
  368. o.quit_url = d['quit_url']
  369. if 'royalty_info' in d:
  370. o.royalty_info = d['royalty_info']
  371. if 'seller_id' in d:
  372. o.seller_id = d['seller_id']
  373. if 'settle_info' in d:
  374. o.settle_info = d['settle_info']
  375. if 'specified_channel' in d:
  376. o.specified_channel = d['specified_channel']
  377. if 'store_id' in d:
  378. o.store_id = d['store_id']
  379. if 'sub_merchant' in d:
  380. o.sub_merchant = d['sub_merchant']
  381. if 'subject' in d:
  382. o.subject = d['subject']
  383. if 'time_expire' in d:
  384. o.time_expire = d['time_expire']
  385. if 'timeout_express' in d:
  386. o.timeout_express = d['timeout_express']
  387. if 'total_amount' in d:
  388. o.total_amount = d['total_amount']
  389. return o