recharge.py 1.22 KB
# -*- coding: utf-8 -*-

"""
卡片充值
"""

from commons import common as com
from commons.MySession import hg
from commons.basic.duplicateToken import duplicateToken


class recharge():
    url = "http://test.gateway.diligrp.com:8285/card-web/fund/recharge.action"
    header = {
        "UAP_accessToken": "demo",
        "UAP_refreshToken": "demo",
        "duplicate_commit_token": "demo",
        "Content-Type": "application/json;charset=utf-8",
        "Host": "test.gateway.diligrp.com:8285",
        "Content-Length": "740"}

    # body = {"amount":500000000,"cardNo":"888810043394","accountId":107791,"customerId":141995,"tradePwd":"","tradeChannel":2}
    body = {"amount": 500000000, "cardNo": "888810026785", "accountId": 107792, "customerId": 141992, "tradePwd": "",
            "tradeChannel": 2}

    def __init__(self, ):
        self.url = recharge.url
        self.header = recharge.header
        self.body = recharge.body

    def refresh_commit_token(self,market):
        self.header["duplicate_commit_token"] = duplicateToken().duplicate_commit_token(market)
#
# tt = recharge()
# for  i in range(0,10):
#     tt.refresh_commit_token(hg)
#     hg.post(url=tt.url, json=tt.body, headers=tt.header, proxies=hg.myproxies)