Commit e97b86be authored by Łukasz Nowak's avatar Łukasz Nowak

Invert logic.

There is nothing to do if transaction is not yet registered in integration tool.
parent bf91dfd1
...@@ -67,7 +67,8 @@ if context.PaymentTransaction_getPreviousPayzenId() is not None and context.getS ...@@ -67,7 +67,8 @@ if context.PaymentTransaction_getPreviousPayzenId() is not None and context.getS
context.updateCausalityState()\n context.updateCausalityState()\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
else:\n else:\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 if portal.restrictedTraverse(portal.portal_preferences.getPreferredPayzenIntegrationSite()).getMappingFromCategory(\'causality/%s\' % context.getRelativeUrl()) != \'Causality/%s\' % context.getRelativeUrl():\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>
</item> </item>
<item> <item>
......
...@@ -58,8 +58,7 @@ integration_tool = portal.restrictedTraverse(portal.portal_preferences.getPrefer ...@@ -58,8 +58,7 @@ integration_tool = portal.restrictedTraverse(portal.portal_preferences.getPrefer
\n \n
transaction_id = integration_tool.getMappingFromCategory(\'causality/%s\' % payment_transaction.getRelativeUrl())\n transaction_id = integration_tool.getMappingFromCategory(\'causality/%s\' % payment_transaction.getRelativeUrl())\n
if transaction_id == \'Causality/%s\' % payment_transaction.getRelativeUrl():\n if transaction_id == \'Causality/%s\' % payment_transaction.getRelativeUrl():\n
payzen_event.confirm(comment=\'Transaction not registered in payzen integration tool\')\n raise ValueError(\'Transaction not registered in payzen integration tool\')\n
return\n
transaction_id = transaction_id.split(\'/\')[1]\n transaction_id = transaction_id.split(\'/\')[1]\n
transmissionDate, transactionId = transaction_id.split(\'_\')\n transmissionDate, transactionId = transaction_id.split(\'_\')\n
\n \n
......
65 66
\ 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