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

Switch to searchAndActivate.

Analyze one transaction per transaction.
parent b9072f02
......@@ -51,19 +51,18 @@
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
for payment_transaction in portal.portal_catalog(\n
portal.portal_catalog.searchAndActivate(\n
portal_type="Payment Transaction", \n
simulation_state="planned",\n
limit=10\n
):\n
# do not trust catalog\n
if payment_transaction.getSimulationState() == \'planned\':\n
payment_transaction.PaymentTransaction_registerPayzen()\n
method_id=\'PaymentTransaction_registerPayzen\',\n
packet_size=1, # just one to minimise errors\n
activate_kw={\'tag\': tag}\n
)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>tag, fixit, params</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -51,18 +51,18 @@
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
for payment_transaction in portal.portal_catalog(\n
portal.portal_catalog.searchAndActivate(\n
portal_type="Payment Transaction", \n
simulation_state="confirmed",\n
):\n
# do not trust catalog\n
if payment_transaction.getSimulationState() == \'confirmed\':\n
payment_transaction.activate().PaymentTransaction_updateStatus()\n
method_id=\'PaymentTransaction_updateStatus\',\n
packet_size=1, # just one to minimise errors\n
activate_kw={\'tag\': tag}\n
)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>tag, fixit, params</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -51,6 +51,8 @@
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
if context.getSimulationState() != \'planned\':\n
return\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
</string> </value>
......
......@@ -51,6 +51,8 @@
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
if context.getSimulationState() != \'confirmed\':\n
return\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
</string> </value>
......
50
\ No newline at end of file
51
\ 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