Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PAYJS 扫码支付 DEMO Python
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
You can’t perform that action at this time.