Files
odoo_source/addons/payment_adyen/const.py
T
Demesmaeker 8442ea9c1a [IMP] payment_adyen: allow splitting authorization and capture
Being able to first authorize then capture a payment has several
advantages:
- Confirm a quotation when the payment is authorized and capture it
  when the order is shipped.
- Review orders before capturing the payment.
- Prevent credit card fees in the case of a refund

This commit implements this feature for the payment acquirer Adyen.

task-2507304

closes odoo/odoo#70591

Related: odoo/upgrade#3088
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-02-18 09:49:20 +00:00

38 lines
1.4 KiB
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Endpoints of the API.
# See https://docs.adyen.com/api-explorer/#/CheckoutService/v67/overview for Checkout API
# See https://docs.adyen.com/api-explorer/#/Recurring/v49/overview for Recurring API
API_ENDPOINT_VERSIONS = {
'/disable': 49, # Recurring API
'/paymentMethods': 67, # Checkout API
'/payments': 67, # Checkout API
'/payments/details': 67, # Checkout API
'/payments/{}/cancels': 67, # Checkout API
'/payments/{}/captures': 67, # Checkout API
'/payments/{}/refunds': 67, # Checkout API
}
# Adyen-specific mapping of currency codes in ISO 4217 format to the number of decimals.
# Only currencies for which Adyen does not follow the ISO 4217 norm are listed here.
# See https://docs.adyen.com/development-resources/currency-codes
CURRENCY_DECIMALS = {
'CLP': 2,
'CVE': 0,
'IDR': 0,
'ISK': 2,
}
# Mapping of transaction states to Adyen result codes.
# See https://docs.adyen.com/checkout/payment-result-codes for the exhaustive list of result codes.
RESULT_CODES_MAPPING = {
'pending': (
'ChallengeShopper', 'IdentifyShopper', 'Pending', 'PresentToShopper', 'Received',
'RedirectShopper'
),
'done': ('Authorised',),
'cancel': ('Cancelled',),
'error': ('Error',),
'refused': ('Refused',),
}