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

Negate value.

This is script for payable, so in case of receivable its value have to be
negated.
parent eabea7a9
......@@ -85,7 +85,7 @@ context.activate().PaymentTransaction_confirm()\n
payzen_dict = {}\n
payzen_dict.update(\n
vads_currency=integration_site.getMappingFromCategory(\'resource/currency_module/%s\' % context.getResourceReference()).split(\'/\')[-1],\n
vads_amount=str(int(round((context.PaymentTransaction_getTotalPayablePrice() * 100), 0))),\n
vads_amount=str(int(round((context.PaymentTransaction_getTotalPayablePrice() * -100), 0))),\n
vads_trans_date=context.getStartDate().toZone(\'UTC\').asdatetime().strftime(\'%Y%m%d%H%M%S\'),\n
vads_trans_id=transaction_id,\n
vads_language=\'en\',\n
......
......@@ -103,7 +103,7 @@ elif transaction_status in continue_transaction_id_list:\n
# Check authAmount and authDevise and if match, start transaction\n
auth_amount = int(data_kw[\'authAmount\'])\n
auth_devise = data_kw[\'authDevise\']\n
transaction_amount = int(round((transaction.PaymentTransaction_getTotalPayablePrice() * 100), 2))\n
transaction_amount = int(round((transaction.PaymentTransaction_getTotalPayablePrice() * -100), 2))\n
if transaction_amount != auth_amount:\n
payzen_event.confirm(comment=\'Received amount (%r) does not match stored on transaction (%r)\'% (auth_amount, transaction_amount))\n
return\n
......
......@@ -104,7 +104,7 @@ else:\n
payzen_dict = {}\n
payzen_dict.update(\n
devise=integration_site.getMappingFromCategory(\'resource/currency_module/%s\' % transaction.getResourceReference()).split(\'/\')[-1],\n
amount=str(int(round((transaction.PaymentTransaction_getTotalPayablePrice() * 100), 0))),\n
amount=str(int(round((transaction.PaymentTransaction_getTotalPayablePrice() * -100), 0))),\n
presentationDate=transaction.getStartDate().toZone(\'UTC\').asdatetime(),\n
newTransactionId=transaction_id,\n
transmissionDate=DateTime(previous_date).toZone(\'UTC\').asdatetime(),\n
......
51
\ No newline at end of file
52
\ 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