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
78c50c93
Commit
78c50c93
authored
Apr 19, 2021
by
etscript
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
ad691edb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
order_service.py
app/service/order_service.py
+5
-4
No files found.
app/service/order_service.py
View file @
78c50c93
...
@@ -29,7 +29,7 @@ from app.utils.wxpay import wx_jsapi_pay
...
@@ -29,7 +29,7 @@ from app.utils.wxpay import wx_jsapi_pay
from
app.utils.wxpay.wx_app_pay
import
WXPay
from
app.utils.wxpay.wx_app_pay
import
WXPay
import
requests
import
requests
# course_price_api = "http://devtamper.tanpuyun.com/course/res/money/price"
# course_price_api = "http
s
://devtamper.tanpuyun.com/course/res/money/price"
course_price_api
=
"http://s-nginx/course/res/money/price"
course_price_api
=
"http://s-nginx/course/res/money/price"
...
@@ -280,7 +280,7 @@ class CurriculumOrderService:
...
@@ -280,7 +280,7 @@ class CurriculumOrderService:
"success": true
"success": true
}
}
'''
'''
amount
=
[
amount
[
"attributes"
][
args
[
'ab_proid'
]][
"finalPrice"
]
]
amount
=
[
int
(
amount
[
"attributes"
][
args
[
'ab_proid'
]][
"finalPrice"
])
]
except
:
except
:
raise
CustomFlaskErr
(
Errors
.
PROD_NOPRICE
)
raise
CustomFlaskErr
(
Errors
.
PROD_NOPRICE
)
else
:
else
:
...
@@ -315,7 +315,7 @@ class CurriculumOrderService:
...
@@ -315,7 +315,7 @@ class CurriculumOrderService:
elif
res
[
0
]
<
args
[
'ab_payment'
]:
elif
res
[
0
]
<
args
[
'ab_payment'
]:
raise
CustomFlaskErr
(
Errors
.
TANGPU_BALANCE_NOT_ENOUGH
)
raise
CustomFlaskErr
(
Errors
.
TANGPU_BALANCE_NOT_ENOUGH
)
else
:
else
:
tamp_pay_session
.
query
(
AccountBalance
.
apple_balance
)
.
filter
(
tamp_pay_session
.
query
(
AccountBalance
)
.
filter
(
AccountBalance
.
user_id
==
args
[
'user_id'
])
.
update
({
AccountBalance
.
user_id
==
args
[
'user_id'
])
.
update
({
'apple_balance'
:
AccountBalance
.
apple_balance
-
args
[
'ab_payment'
]
'apple_balance'
:
AccountBalance
.
apple_balance
-
args
[
'ab_payment'
]
})
})
...
@@ -328,7 +328,7 @@ class CurriculumOrderService:
...
@@ -328,7 +328,7 @@ class CurriculumOrderService:
elif
res
[
0
]
<
args
[
'ab_payment'
]:
elif
res
[
0
]
<
args
[
'ab_payment'
]:
raise
CustomFlaskErr
(
Errors
.
TANGPU_BALANCE_NOT_ENOUGH
)
raise
CustomFlaskErr
(
Errors
.
TANGPU_BALANCE_NOT_ENOUGH
)
else
:
else
:
tamp_pay_session
.
query
(
AccountBalance
.
android_balance
)
.
filter
(
tamp_pay_session
.
query
(
AccountBalance
)
.
filter
(
AccountBalance
.
user_id
==
args
[
'user_id'
])
.
update
({
AccountBalance
.
user_id
==
args
[
'user_id'
])
.
update
({
'android_balance'
:
AccountBalance
.
android_balance
-
args
[
'ab_payment'
]
'android_balance'
:
AccountBalance
.
android_balance
-
args
[
'ab_payment'
]
})
})
...
@@ -354,6 +354,7 @@ class CurriculumOrderService:
...
@@ -354,6 +354,7 @@ class CurriculumOrderService:
args
.
pop
(
'remote_addr'
,
''
)
args
.
pop
(
'remote_addr'
,
''
)
args
.
pop
(
'host_url'
,
''
)
args
.
pop
(
'host_url'
,
''
)
args
.
pop
(
'openid'
,
''
)
args
.
pop
(
'openid'
,
''
)
args
.
pop
(
'tampToken'
,
''
)
order_info
=
OrderFlow
(
**
args
)
order_info
=
OrderFlow
(
**
args
)
tamp_user_session
.
add
(
order_info
)
tamp_user_session
.
add
(
order_info
)
return
pay_params
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