Files
odoo_source/addons/payment_ogone/models/const.py
T
Denis Ledoux 89df4b5faa [FIX] payment_ogone: better error reason when payment is declined
Before this revision, when a payment was declined,
for instance because the authorization is declined by the bank,
or the credit card amount limit is exceeded,
the error was marked as
"Received data with invalid payment status: 2"
which is not very meaningful for the users.

This revision aims to set the reason why the payment
was declined with the meaningful error from ogone.

closes odoo/odoo#80742

X-original-commit: 758f94a173379ba7bd22813b2050e3a6f98210a9
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2021-12-02 12:55:38 +00:00

79 lines
1.7 KiB
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
# See https://epayments-support.ingenico.com/en/integration-solutions/integrations/directlink#directlink_integration_guides_request_a_new_order
# See https://epayments-support.ingenico.com/en/integration-solutions/integrations/directlink#directlink_integration_guides_order_response
VALID_KEYS = [
'AAVADDRESS',
'AAVCHECK',
'AAVMAIL',
'AAVNAME',
'AAVPHONE',
'AAVZIP',
'ACCEPTANCE',
'ALIAS',
'AMOUNT',
'BIC',
'BIN',
'BRAND',
'CARDNO',
'CCCTY',
'CN',
'COLLECTOR_BIC',
'COLLECTOR_IBAN',
'COMPLUS',
'CREATION_STATUS',
'CREDITDEBIT',
'CURRENCY',
'CVCCHECK',
'DCC_COMMPERCENTAGE',
'DCC_CONVAMOUNT',
'DCC_CONVCCY',
'DCC_EXCHRATE',
'DCC_EXCHRATESOURCE',
'DCC_EXCHRATETS',
'DCC_INDICATOR',
'DCC_MARGINPERCENTAGE',
'DCC_VALIDHOURS',
'DEVICEID',
'DIGESTCARDNO',
'ECI',
'ED',
'EMAIL',
'ENCCARDNO',
'FXAMOUNT',
'FXCURRENCY',
'IP',
'IPCTY',
'MANDATEID',
'MOBILEMODE',
'NBREMAILUSAGE',
'NBRIPUSAGE',
'NBRIPUSAGE_ALLTX',
'NBRUSAGE',
'NCERROR',
'ORDERID',
'PAYID',
'PAYIDSUB',
'PAYMENT_REFERENCE',
'PM',
'SCO_CATEGORY',
'SCORING',
'SEQUENCETYPE',
'SIGNDATE',
'STATUS',
'SUBBRAND',
'SUBSCRIPTION_ID',
'TICKET',
'TRXDATE',
'VC',
]
# See https://epayments-support.ingenico.com/en/get-started/transaction-status-full/
PAYMENT_STATUS_MAPPING = {
'pending': (41, 46, 50, 51, 52, 55, 56, 81, 82, 91, 92, 99), # 46 = 3DS
'done': (5, 8, 9),
'cancel': (1,),
'declined': (2,),
}