Skip to main content

Common API to use all French online payment credit card processing services

Project description

Interface with French's bank online credit card processing services
===================================================================

Services supported are:
- ATOS/SIPS v2 used by:
- BNP under the name Mercanet,
- Banque Populaire (before 2010/2011) under the name Cyberplus,
- CCF under the name Elysnet,
- HSBC under the name Elysnet,
- Crédit Agricole under the name e-Transactions,
- La Banque Postale under the name ScelliusNet,
- LCL under the name Sherlocks,
- Société Générale under the name Sogenactif
- and Crédit du Nord under the name Webaffaires,
- Payzen/SystemPay v2 by Banque Populaire (since 2010/2011) and Caisse d'Épargne (Natixis)
- TIPI/PayFiP Régie
- PayFiP Régie Web-service
- Ogone
- Paybox
- Payzen
- ATOS/Worldline https://docs.direct.worldline-solutions.com/en/getting-started/

You can emit payment request under a simple API which takes as input a
dictionnary as configuration and an amount to pay. You get back a
transaction_id. Another unique API allows to handle the notifications coming
from those services, reporting whether the transaction was successful and which
one it was. The full content (which is specific to the service) is also
reported for logging purpose.

The paybox module also depend upon the python Cryptodome library for RSA
signature validation on the responses.

Some backends allow to specify the order and transaction ids in different
fields, in order to allow to match them in payment system backoffice. They are:
- Payzen
- SIPS
- SystemPay
- PayFiP Régie Web-Service

For other backends, the order and transaction ids, separated by '!' are sent in
order id field, so they can be matched in backoffice.

PayFiP Régie Web-Service
========================

You can test your PayFiP regie web-service connection with an integrated CLI utility:

$ python3 -m eopayment.payfip_ws info-client --help
Usage: payfip_ws.py info-client [OPTIONS] NUMCLI

Options:
--help Show this message and exit.

$ python3 -m eopayment.payfip_ws get-idop --help
Usage: payfip_ws.py get-idop [OPTIONS] NUMCLI

Options:
--saisie [T|X|W] [required]
--exer TEXT [required]
--montant INTEGER [required]
--refdet TEXT [required]
--mel TEXT [required]
--url-notification TEXT [required]
--url-redirect TEXT [required]
--objet TEXT
--help Show this message and exit.

$ python3 -m eopayment.payfip_ws info-paiement --help
Usage: payfip_ws.py info-paiement [OPTIONS] IDOP

Options:
--help Show this message and exit.


Generic CLI Tool
================

You can put some configuration in ~/.config/eopayment.init ::

[default]
debug=yes

[systempayv2]
# same name as passed in the options argument to Payment.__init__()
vads_site_id=12345678
secret_test=xyzabcdefgh
vads_ctx_mode=TEST

$ python3 -m eopayment --option vads_site_id=56781234 request 10.0 --param transaction_id=1234 --param email=john.doe@example.com
Transaction ID: 1234
<form method="POST" action="https://paiement.systempay.fr/vads-payment/">
<input type="hidden" name="vads_cust_country" value="FR"/>
<input type="hidden" name="vads_validation_mode" value=""/>
<input type="hidden" name="vads_site_id" value="12345678"/>
<input type="hidden" name="vads_payment_config" value="SINGLE"/>
<input type="hidden" name="vads_trans_id" value="GavPXW"/>
<input type="hidden" name="vads_action_mode" value="INTERACTIVE"/>
<input type="hidden" name="vads_contrib" value="eopayment"/>
<input type="hidden" name="vads_page_action" value="PAYMENT"/>
<input type="hidden" name="vads_amount" value="1010"/>
<input type="hidden" name="signature" value="d5690d02fed621687b19c90053a77b37a1c78370"/>
<input type="hidden" name="vads_ctx_mode" value="TEST"/>
<input type="hidden" name="vads_version" value="V2"/>
<input type="hidden" name="vads_payment_cards" value=""/>
<input type="hidden" name="vads_ext_info_eopayment_trans_id" value="1234"/>
<input type="hidden" name="vads_trans_date" value="20201027211254"/>
<input type="hidden" name="vads_language" value="fr"/>
<input type="hidden" name="vads_capture_delay" value=""/>
<input type="hidden" name="vads_currency" value="978"/>
<input type="hidden" name="vads_cust_email" value="john.doe@example.com"/>
<input type="hidden" name="vads_return_mode" value="GET"/>
<input type="submit" name="Submit" value="Submit" />
</form>
[ Local browser is automatically opened with this form which is auto-submitted ]

$ python3 -m eopayment --debug response 'vads_amount=1010&vads_auth_mode=FULL&vads_auth_number=3fd070&vads_auth_result=00&vads_capture_delay=0&vads_card_brand=CB&vads_card_number=597010XXXXXX0018&vads_payment_certificate=f582e920616a33bdaa0c242ee3fc3d435d367575&vads_ctx_mode=TEST&vads_currency=978&vads_effective_amount=1010&vads_effective_currency=978&vads_site_id=12345678&vads_trans_date=20201029093825&vads_trans_id=Vlco55&vads_trans_uuid=e8defc7bd32c418c93c4b2be676d2796&vads_validation_mode=0&vads_version=V2&vads_warranty_result=&vads_payment_src=EC&vads_cust_country=FR&vads_contrib=eopayment&vads_tid=001&vads_sequence_number=1&vads_contract_used=2334410&vads_trans_status=AUTHORISED&vads_expiry_month=6&vads_expiry_year=2021&vads_bank_label=Banque+de+d%C3%A9mo+et+de+l%27innovation&vads_bank_product=MCW&vads_pays_ip=FR&vads_presentation_date=20201029093826&vads_effective_creation_date=20201029093826&vads_operation_type=DEBIT&vads_result=00&vads_extra_result=&vads_card_country=FR&vads_language=fr&vads_brand_management=%7B%22userChoice%22%3Afalse%2C%22brandList%22%3A%22CB%7CMASTERCARD%22%2C%22brand%22%3A%22CB%22%7D&vads_action_mode=INTERACTIVE&vads_payment_config=SINGLE&vads_page_action=PAYMENT&vads_threeds_enrolled=Y&vads_threeds_auth_type=CHALLENGE&vads_threeds_eci=02&vads_threeds_xid=RFBSMkdWdFE0Wk15VWw0RkJjMzU%3D&vads_threeds_cavvAlgorithm=2&vads_threeds_status=Y&vads_threeds_sign_valid=1&vads_threeds_error_code=&vads_threeds_exit_status=10&vads_threeds_cavv=jG26AYSjvclBARFYSf%2FtXRmjGXM%3D&signature=5594aa2bc35c9e45e759b08df339e5f8ecf2c410'
result : 3
signed : True
bank_data :
{'__bank_id': '3fd070',
'signature': '5594aa2bc35c9e45e759b08df339e5f8ecf2c410',
'vads_action_mode': 'INTERACTIVE',
'vads_amount': '1010',
'vads_auth_mode': 'FULL',
'vads_auth_number': '3fd070',
'vads_auth_result': '00',
'vads_auth_result_message': 'Transaction approuvée ou traitée avec succès',
'vads_bank_label': "Banque de démo et de l'innovation",
'vads_bank_product': 'MCW',
'vads_brand_management': '{"userChoice":false,"brandList":"CB|MASTERCARD","brand":"CB"}',
'vads_capture_delay': '0',
'vads_card_brand': 'CB',
'vads_card_country': 'FR',
'vads_card_number': '597010XXXXXX0018',
'vads_contract_used': '2334410',
'vads_contrib': 'eopayment',
'vads_ctx_mode': 'TEST',
'vads_currency': '978',
'vads_cust_country': 'FR',
'vads_effective_amount': '1010',
'vads_effective_creation_date': '20201029093826',
'vads_effective_currency': '978',
'vads_expiry_month': '6',
'vads_expiry_year': '2021',
'vads_extra_result': '',
'vads_extra_result_message': 'Pas de contrôle effectué.',
'vads_language': 'fr',
'vads_operation_type': 'DEBIT',
'vads_page_action': 'PAYMENT',
'vads_payment_certificate': 'f582e920616a33bdaa0c242ee3fc3d435d367575',
'vads_payment_config': 'SINGLE',
'vads_payment_src': 'EC',
'vads_pays_ip': 'FR',
'vads_presentation_date': '20201029093826',
'vads_result': '00',
'vads_result_message': 'Paiement réalisé avec succés.',
'vads_sequence_number': '1',
'vads_site_id': '12345678',
'vads_threeds_auth_type': 'CHALLENGE',
'vads_threeds_cavv': 'jG26AYSjvclBARFYSf/tXRmjGXM=',
'vads_threeds_cavvAlgorithm': '2',
'vads_threeds_eci': '02',
'vads_threeds_enrolled': 'Y',
'vads_threeds_error_code': '',
'vads_threeds_exit_status': '10',
'vads_threeds_sign_valid': '1',
'vads_threeds_status': 'Y',
'vads_threeds_xid': 'RFBSMkdWdFE0Wk15VWw0RkJjMzU=',
'vads_tid': '001',
'vads_trans_date': '20201029093825',
'vads_trans_id': 'Vlco55',
'vads_trans_status': 'AUTHORISED',
'vads_trans_uuid': 'e8defc7bd32c418c93c4b2be676d2796',
'vads_validation_mode': '0',
'vads_version': 'V2',
'vads_warranty_result': ''}
return_content : None
bank_status : Paiement réalisé avec succés.
transaction_id : 3fd070
order_id : 20201029093825_Vlco55
test : True
transaction_date : 2020-10-29 09:38:26+00:00

Code Style
==========

black is used to format the code, using thoses parameters:

black --target-version py35 --skip-string-normalization --line-length 110

isort is used to format the imports, using those parameters:

isort --profile black --line-length 110

pyupgrade is used to automatically upgrade syntax, using those parameters:

pyupgrade --keep-percent-format --py37-plus

There is .pre-commit-config.yaml to use pre-commit to automatically run black,
isort and pyupgrade before commits. (execute `pre-commit install` to install
the git hook.)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eopayment-3.15.tar.gz (108.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eopayment-3.15-py3-none-any.whl (82.7 kB view details)

Uploaded Python 3

File details

Details for the file eopayment-3.15.tar.gz.

File metadata

  • Download URL: eopayment-3.15.tar.gz
  • Upload date:
  • Size: 108.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for eopayment-3.15.tar.gz
Algorithm Hash digest
SHA256 61fef14226c1e2c65f1218ab5ca1b499070003b47ca76f62ad7db7ca423ef7db
MD5 47ff4a5b028882dfe61d227eb55a7361
BLAKE2b-256 4315808d2e1dbc6c75bab1bac9e994f4799e82bb65973f6834b602a78e83865c

See more details on using hashes here.

File details

Details for the file eopayment-3.15-py3-none-any.whl.

File metadata

  • Download URL: eopayment-3.15-py3-none-any.whl
  • Upload date:
  • Size: 82.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for eopayment-3.15-py3-none-any.whl
Algorithm Hash digest
SHA256 7f144d3ec1cd3b95b4780d31eea4b57eab0ad3e73bebe58787614c01dfa7d9a8
MD5 d245908be7d1218ed652aa3165df14dc
BLAKE2b-256 d5198ea85e4e6d646a3f76a569cb57f8b21e37ae749d56dfcc97c83250694694

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page