diff options
Diffstat (limited to 'src/include/anastasis_database_plugin.h')
-rw-r--r-- | src/include/anastasis_database_plugin.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/include/anastasis_database_plugin.h b/src/include/anastasis_database_plugin.h index 44f6b55..ae414dc 100644 --- a/src/include/anastasis_database_plugin.h +++ b/src/include/anastasis_database_plugin.h @@ -142,6 +142,23 @@ typedef void /** + * Function called to test if a given wire transfer + * satisfied the authentication requirement of the + * IBAN plugin. + * + * @param cls closure + * @param credit amount that was transferred + * @param wire_subject subject provided in the wire transfer + * @return true if this wire transfer satisfied the authentication check + */ +typedef bool +(*ANASTASIS_DB_AuthIbanTransfercheck)( + void *cls, + const struct TALER_Amount *credit, + const char *wire_subject); + + +/** * Handle to interact with the database. * * Functions ending with "_TR" run their OWN transaction scope @@ -715,6 +732,53 @@ struct ANASTASIS_DatabasePlugin /** + * Store inbound IBAN payment made for authentication. + * + * @param cls closure + * @param wire_reference unique identifier inside LibEuFin/Nexus + * @param wire_subject subject of the wire transfer + * @param amount how much was transferred + * @param debit_account account that was debited + * @param credit_account Anastasis operator account credited + * @param execution_date when was the transfer made + * @return transaction status + */ + enum GNUNET_DB_QueryStatus + (*record_auth_iban_payment)( + void *cls, + uint64_t wire_reference, + const char *wire_subject, + const struct TALER_Amount *amount, + const char *debit_account, + const char *credit_account, + struct GNUNET_TIME_Absolute execution_date); + + + /** + * Function to check if we are aware of a wire transfer + * that satisfies the IBAN plugin's authentication check. + * + * @param cls closure + * @param debit_account which debit account to check + * @param earliest_date earliest date to check + * @param cb function to call on all entries found + * @param cb_cls closure for @a cb + * @return transaction status, + * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT if @a cb + * returned 'true' once + * #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if no + * wire transfers existed for which @a cb returned true + */ + enum GNUNET_DB_QueryStatus + (*test_auth_iban_payment)( + void *cls, + const char *debit_account, + struct GNUNET_TIME_Absolute earliest_date, + ANASTASIS_DB_AuthIbanTransfercheck cb, + void *cb_cls); + + + /** * Function called to remove all expired codes from the database. * * @return transaction status |