Commit ea27cc28a881afa56cc3aab437bfba59c1aeb9fa

Authored by lixi
1 parent bb595420

1

Showing 1 changed file with 14 additions and 14 deletions
commons/basic/recharge.py
@@ -8,33 +8,33 @@ from commons import common as com @@ -8,33 +8,33 @@ from commons import common as com
8 from commons.MySession import hg 8 from commons.MySession import hg
9 from commons.basic.duplicateToken import duplicateToken 9 from commons.basic.duplicateToken import duplicateToken
10 10
  11 +
11 class recharge(): 12 class recharge():
12 url = "http://test.gateway.diligrp.com:8285/card-web/fund/recharge.action" 13 url = "http://test.gateway.diligrp.com:8285/card-web/fund/recharge.action"
13 header = { 14 header = {
14 - "UAP_accessToken":"demo",  
15 - "UAP_refreshToken":"demo", 15 + "UAP_accessToken": "demo",
  16 + "UAP_refreshToken": "demo",
16 "duplicate_commit_token": "demo", 17 "duplicate_commit_token": "demo",
17 - "Content-Type":"application/json;charset=utf-8",  
18 - "Host":"test.gateway.diligrp.com:8285",  
19 - "Content-Length":"740" } 18 + "Content-Type": "application/json;charset=utf-8",
  19 + "Host": "test.gateway.diligrp.com:8285",
  20 + "Content-Length": "740"}
20 21
21 # body = {"amount":500000000,"cardNo":"888810043394","accountId":107791,"customerId":141995,"tradePwd":"","tradeChannel":2} 22 # body = {"amount":500000000,"cardNo":"888810043394","accountId":107791,"customerId":141995,"tradePwd":"","tradeChannel":2}
22 - body = {"amount":500000000,"cardNo":"888810026785","accountId":107792,"customerId":141992,"tradePwd":"","tradeChannel":2} 23 + body = {"amount": 500000000, "cardNo": "888810026785", "accountId": 107792, "customerId": 141992, "tradePwd": "",
  24 + "tradeChannel": 2}
23 25
24 - def __init__(self,market): 26 + def __init__(self, market):
25 self.market = market 27 self.market = market
26 - self.url = recharge.url.replace("http://test.",com.get_global_config("global_data", "environment", "en") ) 28 + self.url = recharge.url.replace("http://test.", com.get_global_config("global_data", "environment", "en"))
27 self.header = recharge.header 29 self.header = recharge.header
28 self.header["UAP_accessToken"] = self.market.cookies["UAP_accessToken"] 30 self.header["UAP_accessToken"] = self.market.cookies["UAP_accessToken"]
29 self.header["UAP_refreshToken"] = self.market.cookies["UAP_refreshToken"] 31 self.header["UAP_refreshToken"] = self.market.cookies["UAP_refreshToken"]
30 self.body = recharge.body 32 self.body = recharge.body
31 33
32 -  
33 def refresh_commit_token(self): 34 def refresh_commit_token(self):
34 self.header["duplicate_commit_token"] = duplicateToken(self.market).duplicate_commit_token() 35 self.header["duplicate_commit_token"] = duplicateToken(self.market).duplicate_commit_token()
35 36
36 -tt = recharge(hg)  
37 -for i in range(0,100):  
38 - tt.refresh_commit_token()  
39 - hg.post(url=tt.url, json=tt.body, headers=tt.header, proxies=hg.myproxies)  
40 - 37 +# tt = recharge(hg)
  38 +# for i in range(0,100):
  39 +# tt.refresh_commit_token()
  40 +# hg.post(url=tt.url, json=tt.body, headers=tt.header, proxies=hg.myproxies)