123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import json
- from alipay.aop.api.constant.ParamConstants import *
- class TradeFundBill(object):
- def __init__(self):
- self._amount = None
- self._bank_code = None
- self._fund_channel = None
- self._fund_type = None
- self._real_amount = None
- @property
- def amount(self):
- return self._amount
- @amount.setter
- def amount(self, value):
- self._amount = value
- @property
- def bank_code(self):
- return self._bank_code
- @bank_code.setter
- def bank_code(self, value):
- self._bank_code = value
- @property
- def fund_channel(self):
- return self._fund_channel
- @fund_channel.setter
- def fund_channel(self, value):
- self._fund_channel = value
- @property
- def fund_type(self):
- return self._fund_type
- @fund_type.setter
- def fund_type(self, value):
- self._fund_type = value
- @property
- def real_amount(self):
- return self._real_amount
- @real_amount.setter
- def real_amount(self, value):
- self._real_amount = value
- def to_alipay_dict(self):
- params = dict()
- if self.amount:
- if hasattr(self.amount, 'to_alipay_dict'):
- params['amount'] = self.amount.to_alipay_dict()
- else:
- params['amount'] = self.amount
- if self.bank_code:
- if hasattr(self.bank_code, 'to_alipay_dict'):
- params['bank_code'] = self.bank_code.to_alipay_dict()
- else:
- params['bank_code'] = self.bank_code
- if self.fund_channel:
- if hasattr(self.fund_channel, 'to_alipay_dict'):
- params['fund_channel'] = self.fund_channel.to_alipay_dict()
- else:
- params['fund_channel'] = self.fund_channel
- if self.fund_type:
- if hasattr(self.fund_type, 'to_alipay_dict'):
- params['fund_type'] = self.fund_type.to_alipay_dict()
- else:
- params['fund_type'] = self.fund_type
- if self.real_amount:
- if hasattr(self.real_amount, 'to_alipay_dict'):
- params['real_amount'] = self.real_amount.to_alipay_dict()
- else:
- params['real_amount'] = self.real_amount
- return params
- @staticmethod
- def from_alipay_dict(d):
- if not d:
- return None
- o = TradeFundBill()
- if 'amount' in d:
- o.amount = d['amount']
- if 'bank_code' in d:
- o.bank_code = d['bank_code']
- if 'fund_channel' in d:
- o.fund_channel = d['fund_channel']
- if 'fund_type' in d:
- o.fund_type = d['fund_type']
- if 'real_amount' in d:
- o.real_amount = d['real_amount']
- return o
|