
├── README.md ├── requirements.txt ├── sell.py └── static ├── dist ├── semantic.css ├── semantic.js ├── semantic.min.css └── semantic.min.js ├── js ├── jquery.js └── package.js └── sell.html /README.md: -------------------------------------------------------------------------------- 1 | # -python-paysolution 2 | 3 | 目前只有一个python flask的服务器版本做demo,核心功能都在服务器端,如果你是开发者请进群我们一起来。 4 | ### 下载(下载不了clone到gitee上然后下载速度快很多) 5 | 6 | 安卓端 https://github.com/MarsDiplomatToEarth/paysolution/blob/master/getpayment.apk?raw=true 7 | 8 | 服务器端(python flask版本) https://github.com/MarsDiplomatToEarth/-python-paysolution/tree/master 9 | 10 | ### 联系我们(热烈欢迎有想法的开发者加入我们项目一起开发) 11 | 12 | 邮箱 mr3317952@gmail.com 13 | 14 | QQ 1908215058 15 | 16 | telegram @AutoServer 17 | 18 | QQ群 783129197 19 | 20 | telegram group @AutoServergroup 21 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | adbutils==0.7.1 2 | aiohttp==3.6.2 3 | apkutils2==1.0.0 4 | APScheduler==3.6.3 5 | async-lru==1.0.2 6 | async-timeout==3.0.1 7 | attrs==19.3.0 8 | backcall==0.1.0 9 | bleach==3.1.0 10 | certifi==2019.11.28 11 | chardet==3.0.4 12 | cigam==0.0.3 13 | Click==7.0 14 | colorama==0.4.3 15 | colored==1.4.2 16 | decorator==4.4.1 17 | defusedxml==0.6.0 18 | Deprecated==1.2.7 19 | deprecation==2.0.7 20 | entrypoints==0.3 21 | facebook-wda==0.4.2 22 | Flask==1.1.1 23 | Flask-APScheduler==1.11.0 24 | Flask-Cors==3.0.8 25 | Flask-Login==0.5.0 26 | Flask-SocketIO==4.2.1 27 | humanize==0.5.1 28 | idna==2.8 29 | importlib-metadata==1.4.0 30 | ipykernel==5.1.3 31 | ipython==7.11.1 32 | ipython-genutils==0.2.0 33 | itchat==1.3.10 34 | itsdangerous==1.1.0 35 | jedi==0.15.2 36 | Jinja2==2.10.3 37 | jsonschema==3.2.0 38 | jupyter-client==5.3.4 39 | jupyter-core==4.6.1 40 | kuriyama==0.3.2 41 | Logbook==1.5.3 42 | logzero==1.5.0 43 | lxml==4.4.2 44 | MarkupSafe==1.1.1 45 | mistune==0.8.4 46 | more-itertools==8.1.0 47 | multidict==4.7.5 48 | nbconvert==5.6.1 49 | nbformat==5.0.3 50 | notebook==6.0.2 51 | packaging==20.0 52 | pandocfilters==1.4.2 53 | parso==0.5.2 54 | pickleshare==0.7.5 55 | Pillow==7.0.0 56 | progress==1.5 57 | prometheus-client==0.7.1 58 | prompt-toolkit==3.0.2 59 | py==1.8.1 60 | pydantic==1.5.1 61 | pyelftools==0.26 62 | Pygments==2.5.2 63 | pyparsing==2.4.6 64 | pypng==0.0.20 65 | PyQRCode==1.2.1 66 | pyrsistent==0.15.6 67 | python-dateutil==2.8.1 68 | python-engineio==3.11.2 69 | python-socketio==4.4.0 70 | pytz==2020.1 71 | pywin32==225 72 | pywinpty==0.5.7 73 | pyzmq==18.1.1 74 | requests==2.22.0 75 | retry==0.9.2 76 | schedule==0.6.0 77 | Send2Trash==1.5.0 78 | six==1.14.0 79 | speech-recognition==0.1 80 | SpeechRecognition==3.8.1 81 | terminado==0.8.3 82 | testpath==0.4.4 83 | tornado==6.0.3 84 | traitlets==4.3.3 85 | tzlocal==2.0.0 86 | uiautomator2==2.5.3 87 | urllib3==1.25.8 88 | wcwidth==0.1.8 89 | webencodings==0.5.1 90 | weditor==0.4.2 91 | Werkzeug==0.16.0 92 | whichcraft==0.6.1 93 | wincertstore==0.2 94 | wrapt==1.11.2 95 | xmltodict==0.12.0 96 | yarl==1.4.2 97 | zipp==1.0.0 98 | -------------------------------------------------------------------------------- /sell.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | import flask,schedule 3 | from flask import Flask,request,render_template,session 4 | from flask_cors import CORS 5 | import json,socket,re,time,datetime,threading 6 | 7 | global t 8 | app = Flask(__name__, static_url_path='') 9 | app.config['SECRET_KEY'] = 'jiemaweb' 10 | 11 | moneydic = {"订单号(由金额转化而成)":["是否付款(wait)(payed)","变量(比如邮箱,成功付款后执行这个)"],} 12 | 13 | def sendlearninformation(mail): 14 | print(mail) 15 | 16 | CORS(app, resources=r'/*') 17 | #支付消息接收接口 18 | @app.route('/httppaymsg',methods=['POST','GET']) 19 | def httppaymsg(): 20 | try: 21 | money = re.findall( '(([1-9]\\d*[\\d,,]*\\.?\\d*)|(0\\.[0-9]+))',str(request.form.get('paynum')) )[0][0] 22 | except: 23 | print("this is not pay msg") 24 | return "this is not pay msg" 25 | money = re.findall( '(([1-9]\\d*[\\d,,]*\\.?\\d*)|(0\\.[0-9]+))',str(request.form.get('paynum')) )[0][0] 26 | paynum0 = "00"+str(money.replace(".","")) 27 | print(money) 28 | print(paynum0) 29 | moneydic[paynum0][0] = "payed" 30 | print(moneydic) 31 | return moneydic 32 | 33 | #创建订单 34 | @app.route('/httpcreatepayment',methods=['POST']) 35 | def httpcreatepayment(): 36 | global t 37 | paynum = str(request.form.get('paynum')) 38 | mail = str(request.form.get('mail')) 39 | moneydic[paynum] = ["wait",mail] 40 | print(moneydic) 41 | t.cancel() 42 | t = threading.Timer(120, job3) 43 | t.start() 44 | return str(moneydic) 45 | 46 | #订单状态 47 | @app.route('/httppaystatus',methods=['POST']) 48 | def httppaystatus(): 49 | try: 50 | paynum2 = str(request.form.get('paynum')) 51 | if moneydic[paynum2][0] == "wait": 52 | print(moneydic) 53 | return "f" 54 | else: 55 | print(moneydic) 56 | sendlearninformation(moneydic[paynum2][1]) 57 | #支付成功代码 58 | del moneydic[paynum2] 59 | return "s"+ "商品已发送到指定邮箱" 60 | except: 61 | return "q" 62 | 63 | #取消订单 64 | @app.route('/httpquitpayment',methods=['POST','GET']) 65 | def httpquitpayment(): 66 | global t 67 | paynum = str(request.form.get('paynum')) 68 | del moneydic[paynum] 69 | print(moneydic) 70 | t.cancel() 71 | t = threading.Timer(120, job3) 72 | t.start() 73 | return str(moneydic) 74 | 75 | #web controller 76 | @app.route('/') 77 | def index(): 78 | #return "123" 79 | return app.send_static_file('sell.html') 80 | 81 | 82 | def job3(): 83 | global t 84 | print('Job3:每隔2分钟执行一次') 85 | print('Job3-startTime:%s' % (datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))) 86 | moneydic = {} 87 | # for key in list(moneydic.keys()): 88 | # if moneydic[key]=='wait': 89 | # del moneydic[key] 90 | # continue 91 | print('Job3-endTime:%s' % (datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))) 92 | print('------------------------------------------------------------------------') 93 | t = threading.Timer(120, job3) 94 | t.start() 95 | 96 | if __name__ == '__main__': 97 | global t 98 | print(socket.gethostbyname(socket.gethostname())) 99 | t = threading.Timer(5, job3) 100 | t.start() 101 | #app.run(host="0.0.0.0", port=5000, debug=True,ssl_context='adhoc') 102 | app.run(host="0.0.0.0", port=666, debug=True) 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /static/js/package.js: -------------------------------------------------------------------------------- 1 | //判断访问终端 2 | var browser = { 3 | versions: function() { 4 | var u = navigator.userAgent, 5 | app = navigator.appVersion; 6 | return { 7 | trident: u.indexOf('Trident') > -1, //IE内核 8 | presto: u.indexOf('Presto') > -1, //opera内核 9 | webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核 10 | gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核 11 | mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端 12 | ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端 13 | android: u.indexOf('Android') > -1 || u.indexOf('Adr') > -1, //android终端 14 | iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器 15 | iPad: u.indexOf('iPad') > -1, //是否iPad 16 | webApp: u.indexOf('Safari') == -1, //是否web应该程序,没有头部与底部 17 | weixin: u.indexOf('MicroMessenger') > -1, //是否微信 (2015-01-22新增) 18 | qq: u.match(/\sQQ/i) == " qq" //是否QQ 19 | }; 20 | }(), 21 | language: (navigator.browserLanguage || navigator.language).toLowerCase() 22 | } 23 | //睡眠,非假死 24 | const sleep = (timeountMS) => new Promise((resolve) => { setTimeout(resolve, timeountMS); }); 25 | //http get函数,需要加头部 26 | function getjson(link) { return $.ajax({ url: link, async: false }).responseJSON; }; 27 | 28 | function getnoresponse(link) { return $.ajax({ url: link, async: false }); }; 29 | 30 | function gettext(link) { return $.ajax({ url: link, async: false }).responseText; }; 31 | 32 | function getdata(link) { return $.ajax({ url: link, async: false }).responseJSON["data"]; }; 33 | 34 | //打印在html上 35 | function log(msg) { 36 | try { document.getElementById("jslog").innerHTML = document.getElementById("jslog").innerHTML + '