From: Raphael Michel Date: Fri, 7 Dec 2018 16:00:40 +0000 (+0100) Subject: Use code examples in docs that might actually work X-Git-Tag: v2.0.0~1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c87d59a7ad84a0a186587363ac807e02d6e8d7c9;p=thirdparty%2Fpython-fints.git Use code examples in docs that might actually work --- diff --git a/docs/debits.rst b/docs/debits.rst index d9eec20..73bc44e 100644 --- a/docs/debits.rst +++ b/docs/debits.rst @@ -53,25 +53,26 @@ You can easily generate XML using the ``sepaxml`` python library: client.set_tan_medium(media[0]) - res = client.sepa_debit( - account=accounts[0], - data=pain_message, - multiple=False, - control_sum=Decimal('1.00'), - pain_descriptor='urn:iso:std:iso:20022:tech:xsd:pain.008.002.02' - ) - - if isinstance(res, NeedTANResponse): - print(res.challenge) - - if getattr(res, 'challenge_hhduc', None): - try: - terminal_flicker_unix(res.challenge_hhduc) - except KeyboardInterrupt: - pass - - tan = input('Please enter TAN:') - res = client.send_tan(res, tan) - - print(res.status) - print(res.responses) + with client: + res = client.sepa_debit( + account=accounts[0], + data=pain_message, + multiple=False, + control_sum=Decimal('1.00'), + pain_descriptor='urn:iso:std:iso:20022:tech:xsd:pain.008.002.02' + ) + + if isinstance(res, NeedTANResponse): + print(res.challenge) + + if getattr(res, 'challenge_hhduc', None): + try: + terminal_flicker_unix(res.challenge_hhduc) + except KeyboardInterrupt: + pass + + tan = input('Please enter TAN:') + res = client.send_tan(res, tan) + + print(res.status) + print(res.responses) diff --git a/docs/tans.rst b/docs/tans.rst index fa5990c..e8e8dcf 100644 --- a/docs/tans.rst +++ b/docs/tans.rst @@ -21,7 +21,7 @@ The returned dictionary maps identifiers (generally: three-digit numerals) to in :func:`~fints.formals.TwoStepParametersCommon` subclass with varying fields, depending on the version of the two-step process and the bank. -The `name` field of theese objects provides a user-friendly name of the TAN mechanism that you +The `name` field of these objects provides a user-friendly name of the TAN mechanism that you can display to the user to choose from. To select a TAN mechanism, you can use :func:`~fints.client.FinTS3PinTanClient.set_tan_mechanism`, which takes the identifier used as key in the :func:`~fints.client.FinTS3PinTanClient.get_tan_mechanisms` return value. @@ -112,6 +112,9 @@ You SHOULD use this facility together with the client and dialog state restorati :caption: First step client = FinTS3PinTanClient(...) + # Optionally: choose a tan mechanism with + # client.set_tan_mechanism(…) + with client: response = client.sepa_transfer(...) diff --git a/docs/tested.rst b/docs/tested.rst index ea4ea6f..215ff9f 100644 --- a/docs/tested.rst +++ b/docs/tested.rst @@ -1,7 +1,34 @@ Tested banks ============ -The following libraries have been tested with this library: +The following banks have been tested with version 2.x of this library: + +======================================== ============ ======== ======== ====== +Bank Transactions Holdings Transfer Debits + and Balance +======================================== ============ ======== ======== ====== +GLS Bank eG Yes Yes Yes +Postbank Yes +Triodos Bank Yes Yes +Volksbank Darmstadt-Südhessen Yes Yes +Deutsche Skatbank Yes Yes +BBBank eG Yes Yes +MLP Banking AG Yes +======================================== ============ ======== ======== ====== + +Tested security functions +------------------------- + +* ``942`` "mobile TAN" +* ``962`` "Smart-TAN plus manuell" +* ``972`` "Smart-TAN plus optisch" + + + +Legacy results +--------------- + +The following banks have been tested with the old version 1.x of this library: ======================================== ============ ======== ======== ====== Bank Statements Holdings Transfer Debits diff --git a/docs/transfers.rst b/docs/transfers.rst index 4e56dfc..9e0447b 100644 --- a/docs/transfers.rst +++ b/docs/transfers.rst @@ -1,3 +1,5 @@ +.. _transfers: + Sending SEPA transfers ====================== @@ -38,29 +40,30 @@ Full example client.set_tan_medium(media[0]) - res = client.simple_sepa_transfer( - account=accounts[0], - iban='DE12345', - bic='BIC12345', - amount=Decimal('7.00'), - recipient_name='Foo', - account_name='Test', - reason='Birthday gift', - endtoend_id='NOTPROVIDED', - ) - - if isinstance(res, NeedTANResponse): - print(res.challenge) - - if getattr(res, 'challenge_hhduc', None): - try: - terminal_flicker_unix(res.challenge_hhduc) - except KeyboardInterrupt: - pass - - tan = input('Please enter TAN:') - res = client.send_tan(res, tan) - - print(res.status) - print(res.responses) + with client: + res = client.simple_sepa_transfer( + account=accounts[0], + iban='DE12345', + bic='BIC12345', + amount=Decimal('7.00'), + recipient_name='Foo', + account_name='Test', + reason='Birthday gift', + endtoend_id='NOTPROVIDED', + ) + + if isinstance(res, NeedTANResponse): + print(res.challenge) + + if getattr(res, 'challenge_hhduc', None): + try: + terminal_flicker_unix(res.challenge_hhduc) + except KeyboardInterrupt: + pass + + tan = input('Please enter TAN:') + res = client.send_tan(res, tan) + + print(res.status) + print(res.responses)