def create(cls, **kwargs): """ 发起退款流程 """ url = refund_create.format(kwargs.get('payment_id', '')) return request_post(url, kwargs)
def create(cls, **kwargs): """ 创建订单 """ if not kwargs.get('currency'): kwargs['currency'] = 'cny' return request_post(payment_create, kwargs)
def get_message_manager(): expire_time = 30_000_000_000 data = request_post(pay_message_token, {'expire_time': expire_time}) if 'succeeded' != data.get('status'): log_info('token request failed') return AdapayMessage(adapay.api_key, data.get('token', ''))
def login(cls, **kwargs): """ 钱包用户登录 :param kwargs: :return: """ return request_post(request_tools.wallet_login, kwargs, base_url=Wallet.wallet_base_url)
def checkout(cls, **kwargs): """ 创建收银台对象 :param kwargs: :return: """ return request_post(request_tools.wallet_checkout, kwargs, base_url=Wallet.wallet_base_url)
def pay(cls, **kwargs): """ 钱包支付 :param kwargs: :return: """ return request_post(request_tools.wallet_pay, kwargs, base_url=Wallet.wallet_base_url)
def create(cls, **kwargs): """ 创建企业用户 """ file_path = kwargs.get('attach_file') files = { 'attach_file': (os.path.basename(file_path), open(file_path, 'rb'), 'application/octet-stream') } kwargs.pop('attach_file') return request_post(request_tools.corp_member_create, kwargs, files)
def create(cls, **kwargs): """ 创建用户 """ return request_post(request_tools.member_create, kwargs)
def update(cls, **kwargs): """ 更新用户 """ return request_post(request_tools.member_update, kwargs)
def query_union_identity(cls, **kwargs): return request_post(request_tools.query_identity, kwargs)
def close(cls, **kwargs): """ 关单请求 """ url = payment_close.format(kwargs['payment_id']) return request_post(url, kwargs)
def create_reverse(cls, **kwargs): """ 支付撤销 """ return request_post(payment_reverse, kwargs)
def create_confirm(cls, **kwargs): """ 创建订单确认 """ return request_post(payment_confirm, kwargs)
def download(cls, **kwargs): return request_post(request_tools.bill_download, kwargs)