Projet

Général

Profil

0001-lingo-list-all-backend-but-keep-custom-labels-66737.patch

Benjamin Dauvergne, 28 juin 2022 17:55

Télécharger (2,26 ko)

Voir les différences:

Subject: [PATCH] lingo: list all backend but keep custom labels (#66737)

 combo/apps/lingo/models.py | 44 ++++++++++++++++++++++++++------------
 1 file changed, 30 insertions(+), 14 deletions(-)
combo/apps/lingo/models.py
78 78
EXPIRED = 9999
79 79

  
80 80

  
81
SERVICES = [
82
    (eopayment.DUMMY, _('Dummy (for tests)')),
83
    (eopayment.SYSTEMPAY, 'systempay (Banque Populaire)'),
84
    (eopayment.SIPS, 'SIPS (Atos, France)'),
85
    (eopayment.SIPS2, _('SIPS (Atos, other countries)')),
86
    (eopayment.OGONE, _('Ingenico (formerly Ogone)')),
87
    (eopayment.PAYBOX, 'Paybox'),
88
    (eopayment.PAYZEN, 'PayZen'),
89
    (eopayment.TIPI, 'PayFiP/TIPI Régie'),
90
    (eopayment.PAYFIP_WS, 'PayFiP Régie Web-Service'),
91
    (eopayment.KEYWARE, 'Keyware'),
92
    (eopayment.MOLLIE, 'Mollie'),
93
    (eopayment.SAGA, 'Saga/PayFiP Régie (Futur System)'),
94
]
81
def _make_services():
82
    EOPAYMENT_BACKEND_NAMES = [
83
        ('DUMMY', _('Dummy (for tests)')),
84
        ('SYSTEMPAY', 'systempay (Banque Populaire)'),
85
        ('SIPS2', _('SIPS (Atos, other countries)')),
86
        ('OGONE', _('Ingenico (formerly Ogone)')),
87
        ('PAYBOX', 'Paybox'),
88
        ('PAYZEN', 'PayZen'),
89
        ('TIPI', 'PayFiP/TIPI Régie'),
90
        ('PAYFIP_WS', 'PayFiP Régie Web-Service'),
91
        ('KEYWARE', 'Keyware'),
92
        ('MOLLIE', 'Mollie'),
93
        ('SAGA', 'Saga/PayFiP Régie (Futur System)'),
94
    ]
95
    kind2name = {}
96
    for key, name in EOPAYMENT_BACKEND_NAMES:
97
        try:
98
            kind = getattr(eopayment, key)
99
        except AttributeError:
100
            continue
101
        kind2name[kind] = name
102
    services = []
103
    for key, backend in eopayment.get_backends():
104
        try:
105
            services.append((key, kind2name.get(kind) or backend.description['caption']))
106
        except (KeyError, AttributeError):
107
            pass
108

  
109

  
110
SERVICES = _make_services()
95 111

  
96 112

  
97 113
def eopayment_response_to_extra_info(response, **kwargs):
98
-