const.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  2. # Mapping of currency ISO 4217 codes AsiaPay's currency codes.
  3. # See https://www.paydollar.com/pdf/op/enpdintguide.pdf for the list of currency codes.
  4. CURRENCY_MAPPING = {
  5. 'AED': '784',
  6. 'AUD': '036',
  7. 'BND': '096',
  8. 'CAD': '124',
  9. 'CNY': '156',
  10. 'EUR': '978',
  11. 'GBP': '826',
  12. 'HKD': '344',
  13. 'IDR': '360',
  14. 'INR': '356',
  15. 'JPY': '392',
  16. 'KRW': '410',
  17. 'MOP': '446',
  18. 'MYR': '458',
  19. 'NZD': '554',
  20. 'PHP': '608',
  21. 'SAR': '682',
  22. 'SGD': '702',
  23. 'THB': '764',
  24. 'TWD': '901',
  25. 'USD': '840',
  26. 'VND': '704',
  27. }
  28. # The keys of the values to use in the calculation of the signature.
  29. SIGNATURE_KEYS = {
  30. 'outgoing': [
  31. 'merchant_id',
  32. 'reference',
  33. 'currency_code',
  34. 'amount',
  35. 'payment_type',
  36. ],
  37. 'incoming': [
  38. 'src',
  39. 'prc',
  40. 'successcode',
  41. 'Ref',
  42. 'PayRef',
  43. 'Cur',
  44. 'Amt',
  45. 'payerAuth',
  46. ],
  47. }
  48. # Mapping of both country codes (e.g., 'es') and IETF language tags (e.g.: 'fr-BE') to AsiaPay
  49. # language codes. If a language tag is not listed, the country code prefix can serve as fallback.
  50. LANGUAGE_CODES_MAPPING = {
  51. 'en': 'E',
  52. 'zh_HK': 'C',
  53. 'zh_TW': 'C',
  54. 'zh_CN': 'X',
  55. 'ja_JP': 'J',
  56. 'th_TH': 'T',
  57. 'fr': 'F',
  58. 'de': 'G',
  59. 'ru_RU': 'R',
  60. 'es': 'S',
  61. 'vi_VN': 'S',
  62. }
  63. # Mapping of transaction states to AsiaPay success codes.
  64. SUCCESS_CODE_MAPPING = {
  65. 'done': ('0',),
  66. 'error': ('1',),
  67. }