Skip to content

[ADD] support for EsaLink#7

Open
remi-filament wants to merge 1 commit into
akretion:mainfrom
lefilament:add-esalink
Open

[ADD] support for EsaLink#7
remi-filament wants to merge 1 commit into
akretion:mainfrom
lefilament:add-esalink

Conversation

@remi-filament

Copy link
Copy Markdown

Hi @alexis-via I asked for an account on EsaLink in order to test both your library and module l10n_fr_einvoicing with another PA.

Thanks for you work, most of API is working without a change.

I have added support for EsaLink PA in your library with this PR.

There are a few divergences :

  • SuperPDP added /afnor-flow/ or /afnor-directory/ in their URLs (probably to distinguish with their internal API routes, which Esalink did not add. So I added a configuration Entry on SuperPDP config : add_afnor_type_uri which I used in a function called _get_platform_base_url(session, type) which factors the retrieval of base_url which is called in most of functions
  • EsaLink added a firewall in front of their API which you have to bypass using a specific header key : hubtimize-api-key which I added in config with a key name "extra-header-expected" and I add to session so that it is reused everywhere the oauth2 session is used.
  • SuperPDP uses sortingOrder in directory-line/search sorting parameter when AFNOR API specifies that "order" should be used, so I added a configuration parameter on SuperPDP sorting_key to use this parameter instead of default "order"
  • AFNOR API in PDF makes reference to totalNumberOfResults (used by SuperPDP) when annex specifies total_number_results (used by EsaLink) so I tweaked the code to support both

I also renamed plateform to platform everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant