Skip to content

Instantly share code, notes, and snippets.

@payjscn
Created September 5, 2018 14:47
Show Gist options
  • Save payjscn/b0219141826055ff726c2bfa4a4e3732 to your computer and use it in GitHub Desktop.
Save payjscn/b0219141826055ff726c2bfa4a4e3732 to your computer and use it in GitHub Desktop.
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