Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tamp_course_order
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭熊
tamp_course_order
Commits
eba26a18
Commit
eba26a18
authored
Dec 12, 2020
by
pengxiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信公众号支付
parent
1ae99396
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
order.py
app/controller/order.py
+2
-1
curriculum_order.py
app/model/curriculum_order.py
+1
-1
order_service.py
app/service/order_service.py
+8
-1
No files found.
app/controller/order.py
View file @
eba26a18
...
...
@@ -93,7 +93,8 @@ class ConsumeOrder(Resource):
self
.
parser
.
add_argument
(
'ab_proid'
,
type
=
str
,
required
=
True
,
help
=
'商品ID不能为空'
)
self
.
parser
.
add_argument
(
'prod_name'
,
type
=
str
,
required
=
True
,
help
=
'商品名称不能为空'
)
self
.
parser
.
add_argument
(
'ab_pay_mode'
,
type
=
int
,
required
=
True
,
help
=
'支付方式不能为空'
)
self
.
parser
.
add_argument
(
'ab_pro_siid'
,
type
=
str
,
required
=
False
,
help
=
'商品关联ID不能为空'
)
self
.
parser
.
add_argument
(
'ab_pro_siid'
,
type
=
str
,
required
=
False
)
self
.
parser
.
add_argument
(
'openid'
,
type
=
str
,
required
=
False
)
args
=
self
.
parser
.
parse_args
()
if
'ab_pro_siid'
not
in
args
:
raise
CustomFlaskErr
(
Errors
.
PARAMS_ERROR
)
...
...
app/model/curriculum_order.py
View file @
eba26a18
...
...
@@ -42,7 +42,7 @@ class OrderFlow(Base, BaseModel):
ab_score_deduct
=
Column
(
BIGINT
,
comment
=
'积分抵扣'
)
ab_account_deduct
=
Column
(
BIGINT
,
comment
=
'账户余额抵扣'
)
ab_payment
=
Column
(
BIGINT
,
comment
=
'支付通道付款金额'
)
ab_pay_mode
=
Column
(
String
(
3
),
comment
=
'支付方式 1:免费,2:积分,3现金,4:探普贝,5:app微信支付,6:支付宝支付,7:苹果支付'
)
ab_pay_mode
=
Column
(
String
(
3
),
comment
=
'支付方式 1:免费,2:积分,3现金,4:探普贝,5:app微信支付,6:支付宝支付,7:苹果支付
, 8:微信公众号支付
'
)
ab_total_money
=
Column
(
BIGINT
,
comment
=
'订单总额'
)
ab_type
=
Column
(
String
(
3
),
comment
=
'产品类型 购买类型 1:栏目 3:直播 4:视频 5 音频 6:探普呗'
)
ab_proid
=
Column
(
String
(
64
),
comment
=
'产品ID'
)
...
...
app/service/order_service.py
View file @
eba26a18
...
...
@@ -23,6 +23,7 @@ from xml.etree import cElementTree as etree
from
app.utils.alipay.alipayWap
import
prePay
from
app.utils.apple_pay
import
apple_pay
from
app.utils.wxpay
import
wx_jsapi_pay
from
app.utils.wxpay.wx_app_pay
import
WXPay
...
...
@@ -220,7 +221,7 @@ class CurriculumOrderService:
})
args
[
'ab_status'
]
=
'SUCCESS'
elif
args
[
'ab_pay_mode'
]
==
5
:
# 微信支付
# 微信
App
支付
wx_pay
=
WXPay
(
out_trade_no
,
subject
,
args
[
'ab_payment'
],
args
[
'remote_addr'
],
notify_url
)
params
=
wx_pay
.
getReturnParams
()
pay_params
=
params
...
...
@@ -229,11 +230,17 @@ class CurriculumOrderService:
total_amount
=
args
[
'ab_payment'
]
/
100
res
=
prePay
(
subject
,
out_trade_no
,
total_amount
,
notify_url
)
pay_params
=
res
elif
args
[
'openid'
]
==
8
:
# 微信公众号支付
wx_pay
=
wx_jsapi_pay
.
WXPay
(
args
[
'openid'
],
out_trade_no
,
subject
,
args
[
'ab_payment'
],
args
[
'remote_addr'
],
notify_url
)
params
=
wx_pay
.
getReturnParams
()
pay_params
=
params
args
[
'createby'
]
=
args
.
pop
(
'user_id'
,
''
)
args
.
pop
(
'prod_name'
,
''
)
args
.
pop
(
'env'
,
''
)
args
.
pop
(
'remote_addr'
,
''
)
args
.
pop
(
'host_url'
,
''
)
args
.
pop
(
'openid'
,
''
)
order_info
=
OrderFlow
(
**
args
)
tamp_user_session
.
add
(
order_info
)
return
pay_params
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment