import time from django_redis import get_redis_connection from dspt_api.util.general.get_order_num import general_order_num from dspt_api.util.general.handle_redis import get_data_from_redis from dspt_api.util.api.ecard_order_detail import ApiEcardOrderDetail class ApiEcardRefund: def __init__(self, **kwargs): self.member_type = kwargs.get('member_type') self.api = kwargs.get('api') self.ip = kwargs.get('ip') self.env = kwargs.get('env') self.cid = kwargs.get('cid') self.pid = kwargs.get('pid') self.kwargs = kwargs def get_suggestion(self): # source_order_no source_order_no = ApiEcardOrderDetail(**self.kwargs).get_suggestion()[0] # partner_order_no order_num = general_order_num('REF', self.api, self.member_type, self.ip, self.env, self.pid, self.cid) return [{'param': 'source_order_no', 'value': source_order_no['value'], 'is_checked': True, 'result': True, 'timestamp': int(time.time() * 1000)}, {'param': 'partner_order_no', 'value': order_num, 'is_checked': True, 'result': True, 'timestamp': int(time.time() * 1000)}] def get_timestamp(self): return int(time.time() * 1000)