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
18
Merge Requests
18
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
nexedi
slapos.core
Commits
a6425473
Commit
a6425473
authored
Apr 16, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support planned transactions for user which paid something.
parent
57028e7f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
102 additions
and
19 deletions
+102
-19
master/bt5/vifib_payzen/SkinTemplateItem/portal_skins/vifib_payzen/PaymentTransaction_getPreviousPayzenId.xml
...s/vifib_payzen/PaymentTransaction_getPreviousPayzenId.xml
+88
-0
master/bt5/vifib_payzen/WorkflowTemplateItem/portal_workflow/payzen_interface_workflow/scripts/PayzenEvent_registerPayzen.xml
...interface_workflow/scripts/PayzenEvent_registerPayzen.xml
+2
-17
master/bt5/vifib_payzen/bt/revision
master/bt5/vifib_payzen/bt/revision
+1
-1
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/AccountingTransaction_startPayment.xml
...kins/vifib_hosting/AccountingTransaction_startPayment.xml
+10
-0
master/bt5/vifib_web/bt/revision
master/bt5/vifib_web/bt/revision
+1
-1
No files found.
master/bt5/vifib_payzen/SkinTemplateItem/portal_skins/vifib_payzen/PaymentTransaction_getPreviousPayzenId.xml
0 → 100644
View file @
a6425473
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from DateTime import DateTime\n
transaction = context\n
portal = transaction.getPortalObject()\n
integration_site = portal.restrictedTraverse(portal.portal_preferences.getPreferredPayzenIntegrationSite())\n
state_list = portal.getPortalCurrentInventoryStateList() + portal.getPortalTransitInventoryStateList()\n
previous_transaction = portal.portal_catalog.getResultValue(\n
destination_section_uid = transaction.getDestinationSectionUid(),\n
portal_type=transaction.getPortalType(),\n
simulation_state=state_list,\n
sort_on=((\'delivery.start_date\', \'DESC\'),),\n
limit=1,\n
)\n
\n
if previous_transaction is None:\n
return None\n
\n
previous_id = None\n
possible_previous_id = integration_site.getMappingFromCategory(\'causality/%s\' % previous_transaction.getRelativeUrl())\n
if possible_previous_id != \'Causality/%s\' % transaction.getRelativeUrl():\n
previous_id = possible_previous_id.split(\'/\')[1]\n
\n
return previous_id\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
PaymentTransaction_getPreviousPayzenId
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_payzen/WorkflowTemplateItem/portal_workflow/payzen_interface_workflow/scripts/PayzenEvent_registerPayzen.xml
View file @
a6425473
...
@@ -60,26 +60,11 @@ payzen_event = state_change[\'object\']\n
...
@@ -60,26 +60,11 @@ payzen_event = state_change[\'object\']\n
transaction = payzen_event.getDestinationValue()\n
transaction = payzen_event.getDestinationValue()\n
portal = transaction.getPortalObject()\n
portal = transaction.getPortalObject()\n
integration_site = portal.restrictedTraverse(portal.portal_preferences.getPreferredPayzenIntegrationSite())\n
integration_site = portal.restrictedTraverse(portal.portal_preferences.getPreferredPayzenIntegrationSite())\n
state_list = portal.getPortalCurrentInventoryStateList() + portal.getPortalTransitInventoryStateList()\n
service = portal.portal_secure_payments.find()\n
service = portal.portal_secure_payments.find()\n
previous_transaction = portal.portal_catalog.getResultValue(\n
destination_section_uid = transaction.getDestinationSectionUid(),\n
portal_type=transaction.getPortalType(),\n
simulation_state=state_list,\n
sort_on=((\'delivery.start_date\', \'DESC\'),),\n
limit=1,\n
)\n
\n
if previous_transaction is None:\n
raise ValueError(\'It was not possible to find any previous transaction\')\n
\n
previous_id = None\n
possible_previous_id = integration_site.getMappingFromCategory(\'causality/%s\' % previous_transaction.getRelativeUrl())\n
if possible_previous_id != \'Causality/%s\' % transaction.getRelativeUrl():\n
previous_id = possible_previous_id.split(\'/\')[1]\n
\n
\n
previous_id = transaction.PaymentTransaction_getPreviousPayzenId()\n
if previous_id is None:\n
if previous_id is None:\n
raise ValueError(\'
Transaction %s had not defined payzen integration\' % previous_transaction.getRelativeUrl()
)\n
raise ValueError(\'
No previous id found\'
)\n
\n
\n
previous_date, previous_id = previous_id.split(\'_\')\n
previous_date, previous_id = previous_id.split(\'_\')\n
today = DateTime().toZone(\'UTC\').asdatetime().strftime(\'%Y%m%d\')\n
today = DateTime().toZone(\'UTC\').asdatetime().strftime(\'%Y%m%d\')\n
...
...
master/bt5/vifib_payzen/bt/revision
View file @
a6425473
60
61
\ No newline at end of file
\ No newline at end of file
master/bt5/vifib_
payzen/SkinTemplateItem/portal_skins/vifib_payzen
/AccountingTransaction_startPayment.xml
→
master/bt5/vifib_
web/SkinTemplateItem/portal_skins/vifib_hosting
/AccountingTransaction_startPayment.xml
View file @
a6425473
...
@@ -53,6 +53,16 @@
...
@@ -53,6 +53,16 @@
<value>
<string>
# TODO: Return configured web page in case of system issues.\n
<value>
<string>
# TODO: Return configured web page in case of system issues.\n
from DateTime import DateTime\n
from DateTime import DateTime\n
portal = context.getPortalObject()\n
portal = context.getPortalObject()\n
\n
previous_id = context.PaymentTransaction_getPreviousPayzenId()\n
if context.getSimulationState() == \'planned\' and previous_id is not None:\n
# och, it was possible to register this transaction\n
context.PaymentTransaction_registerPayzen()\n
message = context.Base_translateString("Payment was automatically registered to PayZen system.")\n
return context.getWebSiteValue().Base_redirect(keep_items={\'portal_status_message\': message})\n
\n
# XXX: Support confirmed state similary\n
\n
service = portal.portal_secure_payments.find()\n
service = portal.portal_secure_payments.find()\n
integration_site = portal.restrictedTraverse(portal.portal_preferences.getPreferredPayzenIntegrationSite())\n
integration_site = portal.restrictedTraverse(portal.portal_preferences.getPreferredPayzenIntegrationSite())\n
system_event_kw = {\n
system_event_kw = {\n
...
...
master/bt5/vifib_web/bt/revision
View file @
a6425473
363
364
\ No newline at end of file
\ No newline at end of file
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