const.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  2. # ISO 4217 Data for currencies supported by sips
  3. # NOTE: these are listed on the Atos Wordline SIPS POST documentation page
  4. # at https://documentation.sips.worldline.com/en/WLSIPS.001-GD-Data-dictionary.html#Sips.001_DD_en-Value-currencyCode
  5. # Yet with the simu environment, some of these currencies are *not* working
  6. # I have no way to know if this is caused by the SIMU environment, or if it's
  7. # the doc of SIPS that lists currencies that don't work, but since this list is
  8. # restrictive, I'm gonna assume they are supported when using the right flow
  9. # and payment methods, which may not work in SIMU...
  10. # Since SIPS advises to use 'in production', well...
  11. SUPPORTED_CURRENCIES = {
  12. 'ARS': '032',
  13. 'AUD': '036',
  14. 'BHD': '048',
  15. 'KHR': '116',
  16. 'CAD': '124',
  17. 'LKR': '144',
  18. 'CNY': '156',
  19. 'HRK': '191',
  20. 'CZK': '203',
  21. 'DKK': '208',
  22. 'HKD': '344',
  23. 'HUF': '348',
  24. 'ISK': '352',
  25. 'INR': '356',
  26. 'ILS': '376',
  27. 'JPY': '392',
  28. 'KRW': '410',
  29. 'KWD': '414',
  30. 'MYR': '458',
  31. 'MUR': '480',
  32. 'MXN': '484',
  33. 'NPR': '524',
  34. 'NZD': '554',
  35. 'NOK': '578',
  36. 'QAR': '634',
  37. 'RUB': '643',
  38. 'SAR': '682',
  39. 'SGD': '702',
  40. 'ZAR': '710',
  41. 'SEK': '752',
  42. 'CHF': '756',
  43. 'THB': '764',
  44. 'AED': '784',
  45. 'TND': '788',
  46. 'GBP': '826',
  47. 'USD': '840',
  48. 'TWD': '901',
  49. 'RSD': '941',
  50. 'RON': '946',
  51. 'TRY': '949',
  52. 'XOF': '952',
  53. 'XPF': '953',
  54. 'BGN': '975',
  55. 'EUR': '978',
  56. 'UAH': '980',
  57. 'PLN': '985',
  58. 'BRL': '986',
  59. }
  60. # Mapping of transaction states to Sips response codes.
  61. # See https://documentation.sips.worldline.com/en/WLSIPS.001-GD-Data-dictionary.html#Sips.001_DD_en-Value-currencyCode
  62. RESPONSE_CODES_MAPPING = {
  63. 'pending': ('60',),
  64. 'done': ('00',),
  65. 'cancel': (
  66. '03', '05', '12', '14', '17', '24', '25', '30', '34', '40', '51', '54', '63', '75', '90',
  67. '94', '97', '99'
  68. ),
  69. }