Commit 4a39958d authored by Łukasz Nowak's avatar Łukasz Nowak

Switch to searchAndActivate.

Analyze one transaction per transaction.
parent b9072f02
...@@ -51,19 +51,18 @@ ...@@ -51,19 +51,18 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
for payment_transaction in portal.portal_catalog(\n portal.portal_catalog.searchAndActivate(\n
portal_type="Payment Transaction", \n portal_type="Payment Transaction", \n
simulation_state="planned",\n simulation_state="planned",\n
limit=10\n method_id=\'PaymentTransaction_registerPayzen\',\n
):\n packet_size=1, # just one to minimise errors\n
# do not trust catalog\n activate_kw={\'tag\': tag}\n
if payment_transaction.getSimulationState() == \'planned\':\n )\n
payment_transaction.PaymentTransaction_registerPayzen()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>tag, fixit, params</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -51,18 +51,18 @@ ...@@ -51,18 +51,18 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
for payment_transaction in portal.portal_catalog(\n portal.portal_catalog.searchAndActivate(\n
portal_type="Payment Transaction", \n portal_type="Payment Transaction", \n
simulation_state="confirmed",\n simulation_state="confirmed",\n
):\n method_id=\'PaymentTransaction_updateStatus\',\n
# do not trust catalog\n packet_size=1, # just one to minimise errors\n
if payment_transaction.getSimulationState() == \'confirmed\':\n activate_kw={\'tag\': tag}\n
payment_transaction.activate().PaymentTransaction_updateStatus()\n )\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>tag, fixit, params</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
if context.getSimulationState() != \'planned\':\n
return\n
service = portal.portal_secure_payments.find()\n service = portal.portal_secure_payments.find()\n
portal.system_event_module.newContent(title=\'Transaction %s Payzen registration\' % context.getTitle(), portal_type=\'Payzen Event\', source_value=service, destination_value=context).registerPayzen()\n portal.system_event_module.newContent(title=\'Transaction %s Payzen registration\' % context.getTitle(), portal_type=\'Payzen Event\', source_value=service, destination_value=context).registerPayzen()\n
</string> </value> </string> </value>
......
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
if context.getSimulationState() != \'confirmed\':\n
return\n
service = portal.portal_secure_payments.find()\n service = portal.portal_secure_payments.find()\n
portal.system_event_module.newContent(title=\'Transaction %s Payzen status update\' % context.getTitle(), portal_type=\'Payzen Event\', source_value=service, destination_value=context).updateStatus()\n portal.system_event_module.newContent(title=\'Transaction %s Payzen status update\' % context.getTitle(), portal_type=\'Payzen Event\', source_value=service, destination_value=context).updateStatus()\n
</string> </value> </string> </value>
......
50 51
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment