diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_bank_service.h | 122 | ||||
-rw-r--r-- | src/include/taler_exchange_service.h | 123 | ||||
-rw-r--r-- | src/include/taler_exchangedb_plugin.h | 8 | ||||
-rw-r--r-- | src/include/taler_extensions.h | 12 |
4 files changed, 209 insertions, 56 deletions
diff --git a/src/include/taler_bank_service.h b/src/include/taler_bank_service.h index 5ce5e254..e0970cb1 100644 --- a/src/include/taler_bank_service.h +++ b/src/include/taler_bank_service.h @@ -100,26 +100,64 @@ struct TALER_BANK_AdminAddIncomingHandle; /** + * Response details for a history request. + */ +struct TALER_BANK_AdminAddIncomingResponse +{ + + /** + * HTTP status. + */ + unsigned int http_status; + + /** + * Taler error code, #TALER_EC_NONE on success. + */ + enum TALER_ErrorCode ec; + + /** + * Full response, NULL if body was not in JSON format. + */ + const json_t *response; + + /** + * Details returned depending on the @e http_status. + */ + union + { + + /** + * Details if status was #MHD_HTTP_OK + */ + struct + { + /** + * unique ID of the wire transfer in the bank's records + */ + uint64_t serial_id; + + /** + * time when the transaction was made. + */ + struct GNUNET_TIME_Timestamp timestamp; + + } ok; + + } details; + +}; + +/** * Callbacks of this type are used to return the result of submitting * a request to transfer funds to the exchange. * * @param cls closure - * @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request - * 0 if the bank's reply is bogus (fails to follow the protocol) - * @param ec detailed error code - * @param serial_id unique ID of the wire transfer in the bank's records; UINT64_MAX on error - * @param timestamp time when the transaction was made. - * @param json detailed response from the HTTPD, or NULL if reply was not in JSON + * @param air response details */ -// FIXME: bad API typedef void (*TALER_BANK_AdminAddIncomingCallback) ( void *cls, - unsigned int http_status, - enum TALER_ErrorCode ec, - uint64_t serial_id, - struct GNUNET_TIME_Timestamp timestamp, - const json_t *json); + const struct TALER_BANK_AdminAddIncomingResponse *air); /** @@ -192,22 +230,64 @@ struct TALER_BANK_TransferHandle; /** + * Response details for a history request. + */ +struct TALER_BANK_TransferResponse +{ + + /** + * HTTP status. + */ + unsigned int http_status; + + /** + * Taler error code, #TALER_EC_NONE on success. + */ + enum TALER_ErrorCode ec; + + /** + * Full response, NULL if body was not in JSON format. + */ + const json_t *response; + + /** + * Details returned depending on the @e http_status. + */ + union + { + + /** + * Details if status was #MHD_HTTP_OK + */ + struct + { + + + /** + * unique ID of the wire transfer in the bank's records + */ + uint64_t row_id; + + /** + * when did the transaction go into effect + */ + struct GNUNET_TIME_Timestamp timestamp; + + } ok; + } details; +}; + + +/** * Function called with the result from the execute step. * * @param cls closure - * @param response_code HTTP status code - * @param ec taler error code - * @param row_id unique ID of the wire transfer in the bank's records - * @param timestamp when did the transaction go into effect + * @param tr response details */ -// FIXME: bad API typedef void (*TALER_BANK_TransferCallback)( void *cls, - unsigned int response_code, - enum TALER_ErrorCode ec, - uint64_t row_id, - struct GNUNET_TIME_Timestamp timestamp); + const struct TALER_BANK_TransferResponse *tr); /** diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index 6d4ca109..c6c1d3a1 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -3592,7 +3592,7 @@ enum GNUNET_GenericReturnValue TALER_EXCHANGE_verify_coin_history ( const struct TALER_EXCHANGE_DenomPublicKey *dk, const struct TALER_CoinSpendPublicKeyP *coin_pub, - json_t *history, + const json_t *history, struct TALER_Amount *total); @@ -4498,7 +4498,7 @@ TALER_EXCHANGE_post_management_keys_cancel ( */ struct TALER_EXCHANGE_ManagementPostExtensionsData { - json_t *extensions; + const json_t *extensions; struct TALER_MasterSignatureP extensions_sig; }; @@ -4548,7 +4548,7 @@ struct TALER_EXCHANGE_ManagementPostExtensionsHandle * TALER_EXCHANGE_management_post_extensions ( struct GNUNET_CURL_Context *ctx, const char *url, - struct TALER_EXCHANGE_ManagementPostExtensionsData *ped, + const struct TALER_EXCHANGE_ManagementPostExtensionsData *ped, TALER_EXCHANGE_ManagementPostExtensionsCallback cb, void *cb_cls); @@ -5091,7 +5091,7 @@ TALER_EXCHANGE_lookup_aml_decision ( /** - * Cancel #TALER_EXCHANGE_add_aml_decision() operation. + * Cancel #TALER_EXCHANGE_lookup_aml_decision() operation. * * @param rh handle of the operation to cancel */ @@ -5105,18 +5105,30 @@ TALER_EXCHANGE_lookup_aml_decision_cancel ( */ struct TALER_EXCHANGE_AddAmlDecision; + +/** + * Response when making an AML decision. + */ +struct TALER_EXCHANGE_AddAmlDecisionResponse +{ + /** + * HTTP response data. + */ + struct TALER_EXCHANGE_HttpResponse hr; +}; + + /** * Function called with information about storing an * an AML decision. * * @param cls closure - * @param hr HTTP response data + * @param adr response data */ -// FIXME: bad API typedef void (*TALER_EXCHANGE_AddAmlDecisionCallback) ( void *cls, - const struct TALER_EXCHANGE_HttpResponse *hr); + const struct TALER_EXCHANGE_AddAmlDecisionResponse *adr); /** * Inform the exchange that an AML decision has been taken. @@ -5162,17 +5174,27 @@ TALER_EXCHANGE_add_aml_decision_cancel ( /** + * Response when adding a partner exchange. + */ +struct TALER_EXCHANGE_ManagementAddPartnerResponse +{ + /** + * HTTP response data. + */ + struct TALER_EXCHANGE_HttpResponse hr; +}; + +/** * Function called with information about the change to * an AML officer status. * * @param cls closure - * @param hr HTTP response data + * @param apr response data */ -// FIXME: bad API typedef void (*TALER_EXCHANGE_ManagementAddPartnerCallback) ( void *cls, - const struct TALER_EXCHANGE_HttpResponse *hr); + const struct TALER_EXCHANGE_ManagementAddPartnerResponse *apr); /** @@ -5224,16 +5246,26 @@ TALER_EXCHANGE_management_add_partner_cancel ( /** + * Response when enabling an auditor. + */ +struct TALER_EXCHANGE_ManagementAuditorEnableResponse +{ + /** + * HTTP response data. + */ + struct TALER_EXCHANGE_HttpResponse hr; +}; + +/** * Function called with information about the auditor setup operation result. * * @param cls closure - * @param hr HTTP response data + * @param aer response data */ -// FIXME: bad API typedef void (*TALER_EXCHANGE_ManagementAuditorEnableCallback) ( void *cls, - const struct TALER_EXCHANGE_HttpResponse *hr); + const struct TALER_EXCHANGE_ManagementAuditorEnableResponse *aer); /** @@ -5278,18 +5310,27 @@ void TALER_EXCHANGE_management_enable_auditor_cancel ( struct TALER_EXCHANGE_ManagementAuditorEnableHandle *ah); +/** + * Response when disabling an auditor. + */ +struct TALER_EXCHANGE_ManagementAuditorDisableResponse +{ + /** + * HTTP response data. + */ + struct TALER_EXCHANGE_HttpResponse hr; +}; /** * Function called with information about the auditor disable operation result. * * @param cls closure - * @param hr HTTP response data + * @param adr HTTP response data */ -// FIXME: bad API typedef void (*TALER_EXCHANGE_ManagementAuditorDisableCallback) ( void *cls, - const struct TALER_EXCHANGE_HttpResponse *hr); + const struct TALER_EXCHANGE_ManagementAuditorDisableResponse *adr); /** @@ -5468,16 +5509,26 @@ TALER_EXCHANGE_management_disable_wire_cancel ( /** + * Response when setting wire fees. + */ +struct TALER_EXCHANGE_ManagementSetWireFeeResponse +{ + /** + * HTTP response data. + */ + struct TALER_EXCHANGE_HttpResponse hr; +}; + +/** * Function called with information about the wire enable operation result. * * @param cls closure - * @param hr HTTP response data + * @param wfr response data */ -// FIXME: bad API typedef void (*TALER_EXCHANGE_ManagementSetWireFeeCallback) ( void *cls, - const struct TALER_EXCHANGE_HttpResponse *hr); + const struct TALER_EXCHANGE_ManagementSetWireFeeResponse *wfr); /** @@ -5525,16 +5576,27 @@ TALER_EXCHANGE_management_set_wire_fees_cancel ( /** + * Response when setting global fees. + */ +struct TALER_EXCHANGE_ManagementSetGlobalFeeResponse +{ + /** + * HTTP response data. + */ + struct TALER_EXCHANGE_HttpResponse hr; +}; + + +/** * Function called with information about the global fee setting operation result. * * @param cls closure - * @param hr HTTP response data + * @param gfr HTTP response data */ -// FIXME: bad API typedef void (*TALER_EXCHANGE_ManagementSetGlobalFeeCallback) ( void *cls, - const struct TALER_EXCHANGE_HttpResponse *hr); + const struct TALER_EXCHANGE_ManagementSetGlobalFeeResponse *gfr); /** @@ -5586,17 +5648,28 @@ TALER_EXCHANGE_management_set_global_fees_cancel ( /** + * Response when adding denomination signature by auditor. + */ +struct TALER_EXCHANGE_AuditorAddDenominationResponse +{ + /** + * HTTP response data. + */ + struct TALER_EXCHANGE_HttpResponse hr; +}; + + +/** * Function called with information about the POST * /auditor/$AUDITOR_PUB/$H_DENOM_PUB operation result. * * @param cls closure - * @param hr HTTP response data + * @param adr HTTP response data */ -// FIXME: bad API typedef void (*TALER_EXCHANGE_AuditorAddDenominationCallback) ( void *cls, - const struct TALER_EXCHANGE_HttpResponse *hr); + const struct TALER_EXCHANGE_AuditorAddDenominationResponse *adr); /** diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 92fb36fb..5404f0b1 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -5577,8 +5577,8 @@ struct TALER_EXCHANGEDB_Plugin (*insert_wire)(void *cls, const char *payto_uri, const char *conversion_url, - json_t *debit_restrictions, - json_t *credit_restrictions, + const json_t *debit_restrictions, + const json_t *credit_restrictions, struct GNUNET_TIME_Timestamp start_date, const struct TALER_MasterSignatureP *master_sig); @@ -5600,8 +5600,8 @@ struct TALER_EXCHANGEDB_Plugin (*update_wire)(void *cls, const char *payto_uri, const char *conversion_url, - json_t *debit_restrictions, - json_t *credit_restrictions, + const json_t *debit_restrictions, + const json_t *credit_restrictions, struct GNUNET_TIME_Timestamp change_date, bool enabled); diff --git a/src/include/taler_extensions.h b/src/include/taler_extensions.h index 75f22534..cd9d7ddd 100644 --- a/src/include/taler_extensions.h +++ b/src/include/taler_extensions.h @@ -259,13 +259,13 @@ TALER_extensions_parse_manifest ( */ enum GNUNET_GenericReturnValue TALER_extensions_load_manifests ( - json_t *manifests); + const json_t *manifests); /* * @brief Returns the head of the linked list of extensions. */ const struct TALER_Extensions * -TALER_extensions_get_head (); +TALER_extensions_get_head (void); /** * @brief Finds and returns a supported extension by a given type. @@ -323,7 +323,7 @@ TALER_extensions_is_enabled ( */ enum GNUNET_GenericReturnValue TALER_extensions_verify_manifests_signature ( - json_t *manifests, + const json_t *manifests, struct TALER_MasterSignatureP *extensions_sig, struct TALER_MasterPublicKeyP *master_pub); @@ -363,7 +363,7 @@ struct TALER_AgeRestrictionConfig * @return age restriction configuration if present, otherwise NULL. */ const struct TALER_AgeRestrictionConfig * -TALER_extensions_get_age_restriction_config (); +TALER_extensions_get_age_restriction_config (void); /** * @brief Check if age restriction is enabled @@ -371,7 +371,7 @@ TALER_extensions_get_age_restriction_config (); * @return true, if age restriction is loaded, configured and enabled; otherwise false. */ bool -TALER_extensions_is_age_restriction_enabled (); +TALER_extensions_is_age_restriction_enabled (void); /** * @brief Return the age mask for age restriction @@ -379,6 +379,6 @@ TALER_extensions_is_age_restriction_enabled (); * @return configured age mask, if age restriction is loaded, configured and enabled; otherwise zero mask. */ struct TALER_AgeMask -TALER_extensions_get_age_restriction_mask (); +TALER_extensions_get_age_restriction_mask (void); #endif |