Exemplo n.º 1
0
    def create(cls, **kwargs):
        """
        发起退款流程
        """

        url = refund_create.format(kwargs.get('payment_id', ''))
        return request_post(url, kwargs)
Exemplo n.º 2
0
    def create(cls, **kwargs):
        """
        创建订单
        """
        if not kwargs.get('currency'):
            kwargs['currency'] = 'cny'

        return request_post(payment_create, kwargs)
Exemplo n.º 3
0
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', ''))
Exemplo n.º 4
0
 def login(cls, **kwargs):
     """
     钱包用户登录
     :param kwargs:
     :return:
     """
     return request_post(request_tools.wallet_login,
                         kwargs,
                         base_url=Wallet.wallet_base_url)
Exemplo n.º 5
0
 def checkout(cls, **kwargs):
     """
     创建收银台对象
     :param kwargs:
     :return:
     """
     return request_post(request_tools.wallet_checkout,
                         kwargs,
                         base_url=Wallet.wallet_base_url)
Exemplo n.º 6
0
 def pay(cls, **kwargs):
     """
     钱包支付
     :param kwargs:
     :return:
     """
     return request_post(request_tools.wallet_pay,
                         kwargs,
                         base_url=Wallet.wallet_base_url)
Exemplo n.º 7
0
 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)
Exemplo n.º 8
0
 def create(cls, **kwargs):
     """
     创建用户
     """
     return request_post(request_tools.member_create, kwargs)
Exemplo n.º 9
0
 def update(cls, **kwargs):
     """
     更新用户
     """
     return request_post(request_tools.member_update, kwargs)
Exemplo n.º 10
0
 def query_union_identity(cls, **kwargs):
     return request_post(request_tools.query_identity, kwargs)
Exemplo n.º 11
0
 def close(cls, **kwargs):
     """
     关单请求
     """
     url = payment_close.format(kwargs['payment_id'])
     return request_post(url, kwargs)
Exemplo n.º 12
0
 def create_reverse(cls, **kwargs):
     """
     支付撤销
     """
     return request_post(payment_reverse, kwargs)
Exemplo n.º 13
0
 def create_confirm(cls, **kwargs):
     """
     创建订单确认
     """
     return request_post(payment_confirm, kwargs)
Exemplo n.º 14
0
 def download(cls, **kwargs):
     return request_post(request_tools.bill_download, kwargs)