Recharge the user balance, the operation of the present.

Source: Internet
Author: User

The

App supports user balances, sometimes requiring balance payments, modifying tables, looking for several tables, and directly modifying the table, the app page does not appear to recharge records. Use Python for interface requests to simulate real operations.

#!/usr/bin/python #coding =utf-8 Import requests Import hashlib import conf def get_cash (UID): #获取余额操作码 Cash_code_url = Conf.cash_code_url cash_code_data = {"UID": uid, "operator_id": "1002543687", "Operator_name": "Zhaoyuzhong"} req_post
        = Requests.post (cash_code_url,data=cash_code_data) try:idx = str (Req_post.json () [' Data '] [' cash_idx ']] Return idx except:print Req_post.json () [' msg '] def recharge (uid,username,count_balance): # Manual Replenishment Interface cash_id X=get_cash (UID) check_str = conf.check_str checksum = MD5 (CHECKSTR) Recharge_url = Conf.recharge_url Recha Rge_data = Conf.recharge_data Req_post = requests.post (recharge_url,data=recharge_data) #post方法使用data参数传递 print "Hand
    Dynamic replenishment Interface ", Req_post.json () [' msg '] def withdraw (uid,username,count_cash,count_balance): #财务提现接口 Cash_idx=get_cash (UID) Check_str = CONF.CHECK_STR checksum = MD5 (CHECKSTR) Withdraw_url = Conf.withdraw_url Withdraw_data = Conf.with Draw_data Req_post = Requests.post (withdraw_url,data=withdraw_data) print "Financial Extract Interface", Req_post.json () [' MSG '] def MD5 (str): #加密字符串为md5 m=h ASHLIB.MD5 () m.update (str) psw=m.hexdigest () return PSW def getbalance (UID): #查询个人余额接口 Get_balance_url = C
    Onf.getbalance_url get_balance_data = {"UID": uid} req_post = Requests.post (get_balance_url,data=get_balance_data) Cash = Myreq_post.json () [' Data '] [' cash '] balance= myreq_post.json () [' Data '] [' balance '] usable = MYREQ_POST.JSO N () [' Data '] [' usable '] print "can be cash=", cash, "Balance balance=", balance, "available usable=", usable if __name__ = ' __main__ ': # To the mobile phone number 18688888888,uid for 933634 users to recharge 1000 yuan GetBalance (933634) # First query the user UID Balance recharge (933634,18688888888,100000) #手动充余额, u
 ID, cell phone number, recharge amount: Unit: getbalance (933634) #再查询下余额

Execution results:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.