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>
79 lines
1.7 KiB
Python
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,),
|
|
}
|