Commit 66bb674d authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_payzen_secure_payment: Payzen Service encode text as UTF-8

parent ba498122
...@@ -75,7 +75,9 @@ else: ...@@ -75,7 +75,9 @@ else:
data_kw = dict(data) data_kw = dict(data)
for k in data_kw.keys(): for k in data_kw.keys():
v = data_kw[k] v = data_kw[k]
if not isinstance(v, str): if isinstance(v, suds.sax.text.Text):
data_kw[k] = v.encode('UTF-8')
elif not isinstance(v, str):
data_kw[k] = str(v) data_kw[k] = str(v)
except Exception: except Exception:
data_kw = {} data_kw = {}
...@@ -208,6 +210,8 @@ class PayzenService(XMLObject, PayzenSOAP): ...@@ -208,6 +210,8 @@ class PayzenService(XMLObject, PayzenSOAP):
if v is None: if v is None:
# empty or not transmitted -- add as empty # empty or not transmitted -- add as empty
v = '' v = ''
elif isinstance(v, suds.sax.text.Text):
v = v.encode('UTF-8')
elif isinstance(v, datetime.datetime): elif isinstance(v, datetime.datetime):
# for sure date # for sure date
v = v.strftime('%Y%m%d') v = v.strftime('%Y%m%d')
......
...@@ -6,10 +6,22 @@ ...@@ -6,10 +6,22 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>PayzenService</string> </value> <value> <string>PayzenService</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>document.erp5.PayzenService</string> </value> <value> <string>document.erp5.PayzenService</string> </value>
...@@ -24,6 +36,22 @@ ...@@ -24,6 +36,22 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W:259, 4: Unreachable code (unreachable)</string>
<string>W:264, 4: Unreachable code (unreachable)</string>
<string>W:269, 4: Unreachable code (unreachable)</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>version</string> </key> <key> <string>version</string> </key>
<value> <string>erp5</string> </value> <value> <string>erp5</string> </value>
...@@ -31,13 +59,28 @@ ...@@ -31,13 +59,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -50,7 +93,7 @@ ...@@ -50,7 +93,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -59,7 +102,7 @@ ...@@ -59,7 +102,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
...@@ -72,33 +115,6 @@ ...@@ -72,33 +115,6 @@
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string>validate</string> </value> <value> <string>validate</string> </value>
</item> </item>
<item>
<key> <string>actor</string> </key>
<value> <string>ERP5TypeTestCase</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1377844605.75</float>
<string>GMT+9</string>
</tuple>
</state>
</object>
</value>
</item>
<item> <item>
<key> <string>validation_state</string> </key> <key> <string>validation_state</string> </key>
<value> <string>validated</string> </value> <value> <string>validated</string> </value>
......
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