diff --git a/CHANGELOG.md b/CHANGELOG.md index d9a8fd1..e3e6f9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +1.2.5, 2023-04-11 +============= +- Fix invoice payment with payment links. +- Update list of supported payment means. +- Update list of supported currencies. + 1.2.4, 2022-05-06 ============= - Update list of supported payment means. diff --git a/COPYING.md b/COPYING.md index 5c1f0c9..42b664f 100644 --- a/COPYING.md +++ b/COPYING.md @@ -1,4 +1,4 @@ -Copyright © 2017-2022 Lyra Network. +Copyright © 2017-2023 Lyra Network. Lyra Collect plugin for Odoo is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/payment_lyra/__manifest__.py b/payment_lyra/__manifest__.py index 4ffcb42..81c5781 100644 --- a/payment_lyra/__manifest__.py +++ b/payment_lyra/__manifest__.py @@ -9,7 +9,7 @@ { 'name': 'Lyra Collect Payment Acquirer', - 'version': '1.2.4', + 'version': '1.2.5', 'summary': 'Accept payments with Lyra Collect secure payment gateway.', 'category': 'Accounting', 'author': 'Lyra Network', diff --git a/payment_lyra/helpers/constants.py b/payment_lyra/helpers/constants.py index a62d75e..be69b14 100644 --- a/payment_lyra/helpers/constants.py +++ b/payment_lyra/helpers/constants.py @@ -31,7 +31,7 @@ 'LANGUAGE': 'en', 'GATEWAY_VERSION': 'V2', - 'PLUGIN_VERSION': '1.2.4', + 'PLUGIN_VERSION': '1.2.5', 'CMS_IDENTIFIER': 'Odoo_10-14', } @@ -70,35 +70,37 @@ 'ALLOBEBE_CDX': u'Carte Cadeau Allobébé', 'ALLOBEBE_CDX_SB': u'Carte Cadeau Allobébé (sandbox)', 'APETIZ': u'Apetiz', - 'AUCHAN': u'Carte Auchan', - 'AUCHAN_SB': u'Carte Auchan (sandbox)', + 'APPLE_PAY': u'Apple Pay', + 'AUCHAN': u'Carte Auchan', + 'AUCHAN_SB': u'Carte Auchan (sandbox)', 'AURORE-MULTI': u'Cpay Aurore', - 'BANCONTACT': u'Bancontact Mistercash', - 'BIZZBEE_CDX': u'Carte Cadeau Bizzbee', - 'BIZZBEE_CDX_SB': u'Carte Cadeau Bizzbee (sandbox)', - 'BOULANGER': u'Carte b+', + 'BANCONTACT': u'Bancontact Mistercash', + 'BIZUM': u'Bizum', + 'BIZZBEE_CDX': u'Carte Cadeau Bizzbee', + 'BIZZBEE_CDX_SB': u'Carte Cadeau Bizzbee (sandbox)', + 'BOULANGER': u'Carte b+', 'BOULANGER_SB': u'Carte b+ (sandbox)', - 'BRICE_CDX': u'Carte Cadeau Brice', - 'BRICE_CDX_SB': u'Carte Cadeau Brice (sandbox)', + 'BRICE_CDX': u'Carte Cadeau Brice', + 'BRICE_CDX_SB': u'Carte Cadeau Brice (sandbox)', 'BUT': u'But', - 'CA_DO_CARTE': u'CA DO Carte', + 'CA_DO_CARTE': u'CA DO Carte', 'CABAL': u'Cabal', - 'CARNET': u'Carnet', + 'CARNET': u'Carnet', 'CHQ_DEJ': u'Chèque Déjeuner', - 'COM_BARRY_CDX': u'Carte Cadeau Comtesse du Barry', - 'COM_BARRY_CDX_SB': u'Carte Cadeau Comtesse du Barry (sandbox)', - 'CONECS': u'Conecs', + 'COM_BARRY_CDX': u'Carte Cadeau Comtesse du Barry', + 'COM_BARRY_CDX_SB': u'Carte Cadeau Comtesse du Barry (sandbox)', + 'CONECS': u'Conecs', 'CONFORAMA': u'Conforama', - 'CORA': u'Cora', + 'CORA': u'Cora', 'CORA_BLANCHE': u'Cora blanche', - 'CORA_PREM': u'Cora Visa Premier', + 'CORA_PREM': u'Cora Visa Premier', 'CORA_VISA': u'Cora Visa', - 'CVCO': u'Chèque-Vacances Connect', - 'DINERS': u'Diners', + 'CVCO': u'Chèque-Vacances Connect', + 'DINERS': u'Diners', 'DISCOVER': u'Discover', 'ECCARD': u'EC Card', - 'EDENRED': u'Ticket Restaurant', - 'EDENRED_EC': u'Ticket EcoCheque', + 'EDENRED': u'Ticket Restaurant', + 'EDENRED_EC': u'Ticket EcoCheque', 'EDENRED_SC': u'Ticket Sport & Culture', 'EDENRED_TC': u'Ticket Compliments', 'EDENRED_TR': u'Ticket Restaurant', @@ -110,30 +112,33 @@ 'GEMO_CDX': u'Carte Cadeau Gémo', 'GEMO_CDX_SB': u'Carte Cadeau Gémo (sandbox)', 'GIROPAY': u'Giropay', - 'GOOGLEPAY': u'Google Pay', - 'HIPER': u'Hiper', - 'HIPERCARD': u'Hipercard', + 'HIPER': u'Hiper', + 'HIPERCARD': u'Hipercard', 'IDEAL': u'iDEAL', 'ILLICADO': u'Carte Illicado', 'ILLICADO_SB': u'Carte Illicado (sandbox)', - 'JCB': u'JCB', + 'IP_WIRE': u'Virement SEPA', + 'IP_WIRE_INST': u'Virement SEPA Instantané', + 'JCB': u'JCB', 'JOUECLUB_CDX': u'Carte Cadeau Joué Club', - 'JOUECLUB_CDX_SB': u'Carte Cadeau Joué Club (sandbox)', - 'JULES_CDX': u'Carte Cadeau Jules', - 'JULES_CDX_SB': u'Carte Cadeau Jules (sandbox)', - 'LEROY-MERLIN': u'Carte Maison Financement', - 'LEROY-MERLIN_SB': u'Carte Maison Financement (sandbox)', - 'MASTERPASS': u'MasterPass', - 'MC_CORDOBESA': u'Mastercard Cordobesa', + 'JOUECLUB_CDX_SB': u'Carte Cadeau Joué Club (sandbox)', + 'JULES_CDX': u'Carte Cadeau Jules', + 'JULES_CDX_SB': u'Carte Cadeau Jules (sandbox)', + 'LECLERC': u'Carte Reglo', + 'LEROY-MERLIN': u'Carte Maison Financement', + 'LEROY-MERLIN_SB': u'Carte Maison Financement (sandbox)', + 'MASTERPASS': u'MasterPass', + 'MC_CORDOBESA': u'Mastercard Cordobesa', 'MULTIBANCO': u'Multibanco', - 'MYBANK': u'MyBank', + 'MYBANK': u'MyBank', 'NARANJA': u'Naranja', - 'NORAUTO': u'Carte Norauto option Financement', - 'NORAUTO_SB': u'Carte Norauto option Financement (sandbox)', + 'NORAUTO': u'Carte Norauto option Financement', + 'NORAUTO_SB': u'Carte Norauto option Financement (sandbox)', + 'ONEY_10X_12X': u'Paiement en 10 ou 12 fois Oney', 'ONEY_3X_4X': u'Paiement en 3 ou 4 fois Oney', 'ONEY_ENSEIGNE': u'Cartes enseignes Oney', - 'PAYDIREKT': u'Paydirekt', - 'PAYLIB': u'Paylib', + 'ONEY_PAYLATER': u'Pay Later Oney', + 'PAYDIREKT': u'Paydirekt', 'PAYPAL': u'PayPal', 'PAYPAL_SB': u'PayPal Sandbox', 'PICWIC': u'Carte Picwic', @@ -142,13 +147,15 @@ 'POSTFINANCE_EFIN': u'PostFinance E-Finance', 'PRESTO': u'Presto', 'PRZELEWY24': u'Przelewy24', - 'SDD': u'SEPA direct debit', + 'S-MONEY': u'S-money', + 'SCT': u'Virement SEPA', + 'SDD': u'SEPA direct debit', 'SODEXO': u'Pass Restaurant', - 'SOFORT_BANKING': u'Sofort', - 'SOROCRED': u'Sorocred', + 'SOFORT_BANKING': u'Sofort', + 'SOROCRED': u'Sorocred', 'UNION_PAY': u'UnionPay', - 'VILLAVERDE': u'Carte Cadeau VillaVerde', - 'VILLAVERDE_SB': u'Carte Cadeau VillaVerde (sandbox)', + 'VILLAVERDE': u'Carte Cadeau VillaVerde', + 'VILLAVERDE_SB': u'Carte Cadeau VillaVerde (sandbox)', 'WECHAT': u'WeChat Pay', } @@ -159,9 +166,8 @@ ['EUR', '978', 2], ['GBP', '826', 2], ['JPY', '392', 0], - ['DKK', '208', 2], ['NOK', '578', 2], - ['PLN', '985', 2], - ['SEK', '752', 2], + ['PLN', '985', 2], + ['SEK', '752', 2], ['USD', '840', 2], ] diff --git a/payment_lyra/models/payment.py b/payment_lyra/models/payment.py index 951a8cb..e015fd6 100644 --- a/payment_lyra/models/payment.py +++ b/payment_lyra/models/payment.py @@ -34,6 +34,8 @@ except ImportError: import urllib.parse as urlparse +import re + _logger = logging.getLogger(__name__) class AcquirerLyra(models.Model): @@ -197,6 +199,8 @@ def lyra_form_generate_values(self, values): # Enable redirection? AcquirerLyra.lyra_redirect = True if str(self.lyra_redirect_enabled) == '1' else False + order_id = re.sub("[^0-9a-zA-Z_-]+", "", values.get('reference')) + tx_values = dict() # Values to sign in unicode. tx_values.update({ 'vads_site_id': self.lyra_site_id, @@ -210,7 +214,8 @@ def lyra_form_generate_values(self, values): 'vads_payment_config': self._get_payment_config(amount), 'vads_version': constants.LYRA_PARAMS.get('GATEWAY_VERSION'), 'vads_url_return': urlparse.urljoin(base_url, LyraController._return_url), - 'vads_order_id': str(values.get('reference')), + 'vads_order_id': str(order_id), + 'vads_ext_info_order_ref': str(values.get('reference')), 'vads_contrib': constants.LYRA_PARAMS.get('CMS_IDENTIFIER') + u'_' + constants.LYRA_PARAMS.get('PLUGIN_VERSION') + u'/' + release.version, 'vads_language': self.lyra_language or '', @@ -294,7 +299,7 @@ def _compute_provider(self): @api.model def _lyra_form_get_tx_from_data(self, data): - shasign, status, reference = data.get('signature'), data.get('vads_trans_status'), data.get('vads_order_id') + shasign, status, reference = data.get('signature'), data.get('vads_trans_status'), data.get('vads_ext_info_order_ref') or data.get('vads_order_id') if not reference or not shasign or not status: error_msg = 'Lyra Collect : received bad data {}'.format(data) diff --git a/payment_lyra/views/payment_lyra_templates.xml b/payment_lyra/views/payment_lyra_templates.xml index 973e664..6e1888e 100644 --- a/payment_lyra/views/payment_lyra_templates.xml +++ b/payment_lyra/views/payment_lyra_templates.xml @@ -34,6 +34,7 @@ +