Skip to content

Commit

Permalink
Merge branch 'support/1.x/hotfix/1.2.5' into support/1.x/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Alima Grine committed Apr 11, 2023
2 parents dac0a1e + ed8cdc8 commit 8494145
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 48 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion COPYING.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion payment_lyra/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
94 changes: 50 additions & 44 deletions payment_lyra/helpers/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
'LANGUAGE': 'en',

'GATEWAY_VERSION': 'V2',
'PLUGIN_VERSION': '1.2.4',
'PLUGIN_VERSION': '1.2.5',
'CMS_IDENTIFIER': 'Odoo_10-14',
}

Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
}

Expand All @@ -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],
]
9 changes: 7 additions & 2 deletions payment_lyra/models/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
except ImportError:
import urllib.parse as urlparse

import re

_logger = logging.getLogger(__name__)

class AcquirerLyra(models.Model):
Expand Down Expand Up @@ -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,
Expand All @@ -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 '',
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions payment_lyra/views/payment_lyra_templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<input type="hidden" name="vads_version" t-att-value="vads_version" />
<input type="hidden" name="vads_return_mode" t-att-value="vads_return_mode" />
<input type="hidden" name="vads_order_id" t-att-value="vads_order_id" />
<input type="hidden" name="vads_ext_info_order_ref" t-att-value="vads_ext_info_order_ref" />
<input type="hidden" name="vads_contrib" t-att-value="vads_contrib" />
<input type="hidden" name="signature" t-att-value="lyra_signature" />

Expand Down

0 comments on commit 8494145

Please sign in to comment.