Projet

Général

Profil

Development #30272

tipi: incompatible avec lingo

Ajouté par Benjamin Dauvergne il y a environ 5 ans. Mis à jour il y a environ 5 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
31 janvier 2019
Echéance:
% réalisé:

100%

Temps estimé:
Patch proposed:
Oui
Planning:

Description

Lingo ne passe pas de paramètre orderid, qu'oblige à utiliser le backend tipi pour générer son paramètre obligatoire refdet.

https://www.collectivites-locales.gouv.fr/files/files/finances_locales/moy_paiement/tipi/guide_tipi_regies_2016.pdf on lit page 11 :

de 6 à 30 caractères,
SAISIE LIBRE (caractères alphanumériques, pas de caractères spéciaux, proscrire les tirets)

L'API d'eopayment étant un peu déterminé par ceux qui l'utilisent, i.e. désormais lingo je suis tout prêt à dire qu'orderid doit être toujours optionnel et donc :
  • si orderid et refdet, erreur
  • si orderid est passé mais ne correspond pas au format voulu, on génère un refdet, YYYYMMDDHHMM+<RANDOM>, orderid mis dans objet convertir en ASCII, tronquer à 100 caractères + ' ' + YYYYMMDDHHMM
  • si orderid au format refdet, on l'utilise tel quel
  • si refdet est passé mais pas dans le format, erreur
  • si ni orderid ni refdet, on génère refdet comme plus haut
Deux pistes :
  • si refdet/orderid sont None, générer un truc rentrant dans le format et le renvoyer comme transaction_id
    • passer orderid dans objet
  • forcer lingo à passer un orderid (c'est plus propre mais ça pourrait casser les autres backends), par exemple transaction.id

Fichiers

0001-tipi-PEP8ness-30272.patch (7,69 ko) 0001-tipi-PEP8ness-30272.patch Benjamin Dauvergne, 31 janvier 2019 16:55
0006-tox.ini-remove-basepython-30272.patch (858 octets) 0006-tox.ini-remove-basepython-30272.patch Benjamin Dauvergne, 31 janvier 2019 16:55
0002-tipi-update-TIPI_URL-30272.patch (705 octets) 0002-tipi-update-TIPI_URL-30272.patch Benjamin Dauvergne, 31 janvier 2019 16:55
0007-tipi-implement-automatic-generation-of-REFDET-fixes-.patch (6,64 ko) 0007-tipi-implement-automatic-generation-of-REFDET-fixes-.patch Benjamin Dauvergne, 31 janvier 2019 16:55
0003-tipi-use-english-labels-for-parameters-30272.patch (1,63 ko) 0003-tipi-use-english-labels-for-parameters-30272.patch Benjamin Dauvergne, 31 janvier 2019 16:55
0004-tipi-add-possible-choice-for-saisie-parameter-30272.patch (881 octets) 0004-tipi-add-possible-choice-for-saisie-parameter-30272.patch Benjamin Dauvergne, 31 janvier 2019 16:55
0005-pep8-merge.patch (2,03 ko) 0005-pep8-merge.patch Benjamin Dauvergne, 31 janvier 2019 16:55
0001-tipi-PEP8ness-30272.patch (7,69 ko) 0001-tipi-PEP8ness-30272.patch Benjamin Dauvergne, 01 février 2019 10:05
0006-tox.ini-remove-basepython-30272.patch (858 octets) 0006-tox.ini-remove-basepython-30272.patch Benjamin Dauvergne, 01 février 2019 10:05
0002-tipi-update-TIPI_URL-30272.patch (705 octets) 0002-tipi-update-TIPI_URL-30272.patch Benjamin Dauvergne, 01 février 2019 10:05
0007-tipi-implement-automatic-generation-of-REFDET-fixes-.patch (6,8 ko) 0007-tipi-implement-automatic-generation-of-REFDET-fixes-.patch Benjamin Dauvergne, 01 février 2019 10:05
0003-tipi-use-english-labels-for-parameters-30272.patch (1,63 ko) 0003-tipi-use-english-labels-for-parameters-30272.patch Benjamin Dauvergne, 01 février 2019 10:05
0004-tipi-add-possible-choice-for-saisie-parameter-30272.patch (881 octets) 0004-tipi-add-possible-choice-for-saisie-parameter-30272.patch Benjamin Dauvergne, 01 février 2019 10:05
0005-pep8-merge.patch (2,03 ko) 0005-pep8-merge.patch Benjamin Dauvergne, 01 février 2019 10:05

Révisions associées

Révision d5d31b35 (diff)
Ajouté par Benjamin Dauvergne il y a environ 5 ans

tipi: PEP8ness (#30272)

Révision 354815c5 (diff)
Ajouté par Benjamin Dauvergne il y a environ 5 ans

tipi: update TIPI_URL (#30272)

Révision b128e66e (diff)
Ajouté par Benjamin Dauvergne il y a environ 5 ans

tipi: use english labels for parameters (#30272)

Révision 0d6a6a86 (diff)
Ajouté par Benjamin Dauvergne il y a environ 5 ans

tipi: add possible choices for saisie parameter (#30272)

Révision 51a51d12 (diff)
Ajouté par Benjamin Dauvergne il y a environ 5 ans

tox.ini: remove basepython (#30272)

It becomes useless if python version is in the environment descriptors.

Révision 7ac96b4f (diff)
Ajouté par Benjamin Dauvergne il y a environ 5 ans

tipi: implement automatic generation of REFDET (fixes #30272)

Historique

#1

Mis à jour par Benjamin Dauvergne il y a environ 5 ans

  • Assigné à mis à Benjamin Dauvergne
#4

Mis à jour par Benjamin Dauvergne il y a environ 5 ans

Pour rappel lingo fait ça :

        kwargs = {
            'email': email, 'first_name': firstname, 'last_name': lastname
        }
        if items:
            capture_date = items[0].capture_date
            if capture_date:
                kwargs['capture_date'] = capture_date
        (order_id, kind, data) = payment.request(total_amount, **kwargs)

Donc on passe, amount, email, first_name, last_name et éventuellement capture_date dont tipi n'a rien à foutre.

Je pousse des test modifiés qui mettent plus cela en valeur.

#6

Mis à jour par Serghei Mihai il y a environ 5 ans

  • Statut changé de Solution proposée à Solution validée

Si tu peux, merge les 2 commits PEP8 et go.

#7

Mis à jour par Benjamin Dauvergne il y a environ 5 ans

  • Statut changé de Solution validée à Résolu (à déployer)
  • % réalisé changé de 0 à 100
#8

Mis à jour par Frédéric Péters il y a environ 5 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF