-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathinit.py
More file actions
38 lines (32 loc) · 1.19 KB
/
Copy pathinit.py
File metadata and controls
38 lines (32 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#coding:utf-8
from __future__ import division
import requests
import math
from tornado.escape import json_decode
from model.customer import Customer
from model.account import Account
from model.shop import Shop
from model.account_to_shop import AccountToShop
from model.shipment_supplier import ShipmentSupplier
from model.shipment_template import ShipmentTemplate
from model.shipment_template_method import ShipmentTemplateMethod
from model.coupon import Coupon
from decimal import getcontext, Decimal
'''
shop = Shop.objects.get(entity_id = 1)
account_to_shop = AccountToShop.objects.get(shop = shop)
'''
from itertools import groupby
from operator import itemgetter
from random import choice
from string import ascii_uppercase as uc, digits as dg
from weixin.pay import WeixinPay, WeixinPayError
pay = WeixinPay('xx', 'xx', 'xx', 'notify_url', '../cert/apiclient_key.pem', '../cert/apiclient_cert.pem') # 后两个参数可选
try:
out_trade_no = "test_001"
product_id = "test_001"
raw = pay.unified_order(trade_type="NATIVE", body=u"测试", out_trade_no=out_trade_no, total_fee=1, attach="other info", product_id = product_id)
print raw
except WeixinPayError, e:
print e.message
pass