Created
September 5, 2018 14:47
-
-
Save payjscn/b0219141826055ff726c2bfa4a4e3732 to your computer and use it in GitHub Desktop.
PAYJS 扫码支付 DEMO Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib, urllib2, sys | |
import ssl | |
host = 'https://payjs.cn' | |
path = '/api/native' | |
method = 'POST' | |
bodys = {} | |
url = host + path | |
bodys['mchid'] = '''**********''' | |
bodys['total_fee'] = '''**********''' | |
bodys['out_trade_no'] = '''**********''' | |
bodys['notify_url'] = '''**********''' | |
bodys['sign'] = '''**********''' | |
post_data = urllib.urlencode(bodys) | |
request = urllib2.Request(url, post_data) | |
ctx = ssl.create_default_context() | |
ctx.check_hostname = False | |
ctx.verify_mode = ssl.CERT_NONE | |
response = urllib2.urlopen(request, context=ctx) | |
content = response.read() | |
if (content): | |
print(content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment