<?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>payzen_event = state_change[\'object\']\n
payment_transaction = payzen_event.getDestinationValue(portal_type="Payment Transaction")\n
portal = payment_transaction.getPortalObject()\n
\n
transaction_date, transaction_id = payment_transaction.PaymentTransaction_getPayzenId()\n
if transaction_id is None:\n
  raise ValueError(\'Transaction not registered in payzen integration tool\')\n
\n
payment_service = payzen_event.getSourceValue(portal_type="Payzen Service")\n
data_kw, signature, sent_text, received_text = payment_service.soap_getInfo(\n
  transaction_date.toZone(\'UTC\').asdatetime(),\n
  transaction_id)\n
\n
sent = payzen_event.newContent(\n
  title=\'Sent SOAP\', \n
  portal_type=\'Payzen Event Message\', \n
  text_content=sent_text)\n
received = payzen_event.newContent(\n
  title=\'Received SOAP\', \n
  portal_type=\'Payzen Event Message\', \n
  text_content=received_text, \n
  predecessor_value=sent)\n
payzen_event.PayzenEvent_processUpdate(data_kw, signature)\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>state_change</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>PayzenEvent_updateStatus</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
