Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
17fe842e
Commit
17fe842e
authored
Aug 05, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_wechat: Make Lint Happy
parent
1bf10285
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
13 deletions
+21
-13
master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_generateWechatId.py
...kins/slapos_wechat/PaymentTransaction_generateWechatId.py
+2
-2
master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechatPayment.py
...apos_wechat/PaymentTransaction_redirectToWechatPayment.py
+1
-1
master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_updateWechatPaymentStatus.py
...os_wechat/PaymentTransaction_updateWechatPaymentStatus.py
+1
-4
master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_generateNavigationPage.py
...ce_workflow/scripts/WechatEvent_generateNavigationPage.py
+1
-1
master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_registerWechat.py
..._interface_workflow/scripts/WechatEvent_registerWechat.py
+11
-2
master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_updateStatus.py
...at_interface_workflow/scripts/WechatEvent_updateStatus.py
+5
-3
No files found.
master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_generateWechatId.py
View file @
17fe842e
...
@@ -5,7 +5,7 @@ if REQUEST is not None:
...
@@ -5,7 +5,7 @@ if REQUEST is not None:
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
integration_site
=
portal
.
restrictedTraverse
(
portal
.
portal_preferences
.
getPreferredWechatIntegrationSite
())
integration_site
=
portal
.
restrictedTraverse
(
portal
.
portal_preferences
.
getPreferredWechatIntegrationSite
())
transaction_date
,
transaction_id
=
context
.
PaymentTransaction_getWechatId
()
_
,
transaction_id
=
context
.
PaymentTransaction_getWechatId
()
if
transaction_id
is
not
None
:
if
transaction_id
is
not
None
:
# XXX raise?
# XXX raise?
return
None
,
None
return
None
,
None
...
@@ -15,7 +15,7 @@ if transaction_id is not None:
...
@@ -15,7 +15,7 @@ if transaction_id is not None:
mapping_id
=
context
.
getId
()
mapping_id
=
context
.
getId
()
try
:
try
:
mapping
=
integration_site
.
getCategoryFromMapping
(
integration_site
.
getCategoryFromMapping
(
'Causality/%s'
%
context
.
getId
().
replace
(
'-'
,
'_'
),
'Causality/%s'
%
context
.
getId
().
replace
(
'-'
,
'_'
),
create_mapping_line
=
True
,
create_mapping_line
=
True
,
create_mapping
=
True
)
create_mapping
=
True
)
...
...
master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechatPayment.py
View file @
17fe842e
...
@@ -6,7 +6,7 @@ def wrapWithShadow(payment_transaction, web_site, person_relative_url):
...
@@ -6,7 +6,7 @@ def wrapWithShadow(payment_transaction, web_site, person_relative_url):
vads_url_dict
=
payment_transaction
.
PaymentTransaction_getVADSUrlDict
(
web_site
)
vads_url_dict
=
payment_transaction
.
PaymentTransaction_getVADSUrlDict
(
web_site
)
# ???
# ???
_
,
transaction_id
=
payment_transaction
.
PaymentTransaction_getPayzen
Id
()
#_ , transaction_id = payment_transaction.PaymentTransaction_getWechat
Id()
# vads_url_already_registered = vads_url_dict.pop('vads_url_already_registered')
# vads_url_already_registered = vads_url_dict.pop('vads_url_already_registered')
# if transaction_id is not None:
# if transaction_id is not None:
# return context.REQUEST.RESPONSE.redirect(vads_url_already_registered)
# return context.REQUEST.RESPONSE.redirect(vads_url_already_registered)
...
...
master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_updateWechatPaymentStatus.py
View file @
17fe842e
from
DateTime
import
DateTime
portal
=
context
.
getPortalObject
()
state
=
context
.
getSimulationState
()
state
=
context
.
getSimulationState
()
if
(
state
!=
'started'
)
or
(
context
.
getPaymentMode
()
!=
'wechat'
):
if
(
state
!=
'started'
)
or
(
context
.
getPaymentMode
()
!=
'wechat'
):
return
"state not started (%s)"
%
state
return
"state not started (%s)"
%
state
else
:
else
:
# ???
# ???
transaction_date
,
transaction_id
=
context
.
PaymentTransaction_getWechatId
()
_
,
transaction_id
=
context
.
PaymentTransaction_getWechatId
()
if
transaction_id
is
not
None
:
if
transaction_id
is
not
None
:
# so the payment is registered in wechat
# so the payment is registered in wechat
...
...
master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_generateNavigationPage.py
View file @
17fe842e
...
@@ -5,7 +5,7 @@ payment_transaction = wechat_event.getDestinationValue(portal_type="Payment Tran
...
@@ -5,7 +5,7 @@ payment_transaction = wechat_event.getDestinationValue(portal_type="Payment Tran
now
=
DateTime
()
now
=
DateTime
()
payment_transaction
.
AccountingTransaction_updateStartDate
(
now
)
payment_transaction
.
AccountingTransaction_updateStartDate
(
now
)
transaction_date
,
transaction_id
=
payment_transaction
.
PaymentTransaction_generateWechatId
()
_
,
transaction_id
=
payment_transaction
.
PaymentTransaction_generateWechatId
()
if
transaction_id
is
None
:
if
transaction_id
is
None
:
raise
ValueError
,
"Transaction already registered"
raise
ValueError
,
"Transaction already registered"
...
...
master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_registerWechat.py
View file @
17fe842e
...
@@ -30,6 +30,15 @@ payzen_dict.update(
...
@@ -30,6 +30,15 @@ payzen_dict.update(
data_kw
,
signature
,
sent_text
,
received_text
=
payment_service
.
soap_duplicate
(
**
payzen_dict
)
data_kw
,
signature
,
sent_text
,
received_text
=
payment_service
.
soap_duplicate
(
**
payzen_dict
)
sent
=
wechat_event
.
newContent
(
title
=
'Sent SOAP'
,
portal_type
=
'Wechat Event Message'
,
text_content
=
sent_text
)
# SENT
received
=
wechat_event
.
newContent
(
title
=
'Received SOAP'
,
text_content
=
received_text
,
predecessor_value
=
sent
,
portal_type
=
'Wechat Event Message'
)
sent
=
wechat_event
.
newContent
(
title
=
'Sent SOAP'
,
portal_type
=
'Wechat Event Message'
,
text_content
=
sent_text
)
# RECEIVED
wechat_event
.
newContent
(
title
=
'Received SOAP'
,
text_content
=
received_text
,
predecessor_value
=
sent
,
portal_type
=
'Wechat Event Message'
)
context
.
WechatEvent_processUpdate
(
state_change
,
data_kw
,
signature
)
context
.
WechatEvent_processUpdate
(
state_change
,
data_kw
,
signature
)
master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_updateStatus.py
View file @
17fe842e
wechat_event
=
state_change
[
'object'
]
wechat_event
=
state_change
[
'object'
]
#raise NotImplementedError(wechat_event, "In WechatEvent_updateStatus")
#raise NotImplementedError(wechat_event, "In WechatEvent_updateStatus")
payment_transaction
=
wechat_event
.
getDestinationValue
(
portal_type
=
"Payment Transaction"
)
payment_transaction
=
wechat_event
.
getDestinationValue
(
portal_type
=
"Payment Transaction"
)
portal
=
payment_transaction
.
getPortalObject
()
transaction_date
,
transaction_id
=
payment_transaction
.
PaymentTransaction_getWechatId
()
_
,
transaction_id
=
payment_transaction
.
PaymentTransaction_getWechatId
()
if
transaction_id
is
None
:
if
transaction_id
is
None
:
raise
ValueError
(
'Transaction not registered in wechat integration tool'
)
raise
ValueError
(
'Transaction not registered in wechat integration tool'
)
...
@@ -12,11 +11,14 @@ payment_service = wechat_event.getSourceValue(portal_type="Wechat Service")
...
@@ -12,11 +11,14 @@ payment_service = wechat_event.getSourceValue(portal_type="Wechat Service")
query_dict
=
{
'out_trade_no'
:
transaction_id
}
query_dict
=
{
'out_trade_no'
:
transaction_id
}
wechat_answer_dict
=
payment_service
.
queryWechatOrderStatus
(
query_dict
)
wechat_answer_dict
=
payment_service
.
queryWechatOrderStatus
(
query_dict
)
# SENT over query
sent
=
wechat_event
.
newContent
(
sent
=
wechat_event
.
newContent
(
title
=
'Query Order Status'
,
title
=
'Query Order Status'
,
portal_type
=
'Wechat Event Message'
,
portal_type
=
'Wechat Event Message'
,
text_content
=
query_dict
)
text_content
=
query_dict
)
received
=
wechat_event
.
newContent
(
# Received
wechat_event
.
newContent
(
title
=
'Received Order Status'
,
title
=
'Received Order Status'
,
portal_type
=
'Wechat Event Message'
,
portal_type
=
'Wechat Event Message'
,
text_content
=
wechat_answer_dict
,
text_content
=
wechat_answer_dict
,
...
...
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