const.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  2. # Endpoints of the API.
  3. # See https://docs.adyen.com/api-explorer/#/CheckoutService/v67/overview for Checkout API
  4. # See https://docs.adyen.com/api-explorer/#/Recurring/v49/overview for Recurring API
  5. API_ENDPOINT_VERSIONS = {
  6. '/disable': 49, # Recurring API
  7. '/paymentMethods': 67, # Checkout API
  8. '/payments': 67, # Checkout API
  9. '/payments/details': 67, # Checkout API
  10. '/payments/{}/cancels': 67, # Checkout API
  11. '/payments/{}/captures': 67, # Checkout API
  12. '/payments/{}/refunds': 67, # Checkout API
  13. }
  14. # Adyen-specific mapping of currency codes in ISO 4217 format to the number of decimals.
  15. # Only currencies for which Adyen does not follow the ISO 4217 norm are listed here.
  16. # See https://docs.adyen.com/development-resources/currency-codes
  17. CURRENCY_DECIMALS = {
  18. 'CLP': 2,
  19. 'CVE': 0,
  20. 'IDR': 0,
  21. 'ISK': 2,
  22. }
  23. # Mapping of transaction states to Adyen result codes.
  24. # See https://docs.adyen.com/checkout/payment-result-codes for the exhaustive list of result codes.
  25. RESULT_CODES_MAPPING = {
  26. 'pending': (
  27. 'ChallengeShopper', 'IdentifyShopper', 'Pending', 'PresentToShopper', 'Received',
  28. 'RedirectShopper'
  29. ),
  30. 'done': ('Authorised',),
  31. 'cancel': ('Cancelled',),
  32. 'error': ('Error',),
  33. 'refused': ('Refused',),
  34. }