diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-05-28 22:20:21 +0200 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-05-28 22:20:21 +0200 |
commit | 0579b1d9cbc3cff5fcf84d9548e6f5bf0ef64626 (patch) | |
tree | d7a95dcca152e535ab9a3179368dd82fb262dfbd /src | |
parent | 7a1146f147da5446b4b8488cc60d4368aadfe66a (diff) | |
download | exchange-0579b1d9cbc3cff5fcf84d9548e6f5bf0ef64626.tar.xz |
Commenting the "reject" CMD
Diffstat (limited to 'src')
-rw-r--r-- | src/bank-lib/testing_api_cmd_reject.c | 67 |
1 files changed, 46 insertions, 21 deletions
diff --git a/src/bank-lib/testing_api_cmd_reject.c b/src/bank-lib/testing_api_cmd_reject.c index 2eb6d4f9b..b929e262d 100644 --- a/src/bank-lib/testing_api_cmd_reject.c +++ b/src/bank-lib/testing_api_cmd_reject.c @@ -32,25 +32,39 @@ #include "taler_bank_service.h" #include "taler_fakebank_lib.h" + +/** + * State for a "reject" CMD. + */ struct RejectState { + + /** + * Handle of a ongoing "reject" operation. + */ struct TALER_BANK_RejectHandle *rh; + /** + * Reference to any command that can offer a wire + * transfer "row id" and its credit account so as + * to give input data to the "reject" operation. + */ const char *deposit_reference; + /** + * Base URL of the bank implementing the "reject" + * operation. + */ const char *bank_url; }; /** - * Callbacks of this type are used to serve the result - * of asking the bank to reject an incoming wire transfer. + * Check that the response code from the "reject" opetation + * is acceptable, namely it equals "204 No Content". * - * @param cls closure - * @param http_status HTTP response code, #MHD_HTTP_NO_CONTENT - * (204) for successful status request; #MHD_HTTP_NOT_FOUND - * if the rowid is unknown; 0 if the bank's reply is bogus - * (fails to follow the protocol), - * @param ec detailed error code + * @param cls closure. + * @param http_status HTTP response code. + * @param ec taler-specific error code. */ static void reject_cb (void *cls, @@ -74,10 +88,11 @@ reject_cb (void *cls, } /** - * Cleanup the state. + * Cleanup the state of a "reject" CMD, and possibly + * cancel a pending operation thereof. * - * @param cls closure, typically a #struct WireState. - * @param cmd the command which is being cleaned up. + * @param cls closure. + * @param cmd the command. */ void reject_cleanup @@ -98,8 +113,8 @@ reject_cleanup /** * Run the command. * - * @param cls closure, typically a #struct WireState. - * @param cmd the command to execute, a /wire one. + * @param cls closure. + * @param cmd the command to execute. * @param is the interpreter state. */ void @@ -140,13 +155,14 @@ reject_run (void *cls, /** - * @param cls closure - * @param ret[out] result (could be anything) - * @param trait name of the trait - * @param selector more detailed information about which object - * to return in case there were multiple generated - * by the command - * @return #GNUNET_OK on success + * Offer internal data from a "reject" CMD to other commands. + * + * @param cls closure. + * @param ret[out] result. + * @param trait name of the trait. + * @param index index number of the trait to return. + * + * @return #GNUNET_OK on success. */ static int reject_traits (void *cls, @@ -167,7 +183,16 @@ reject_traits (void *cls, } /** - * FIXME. + * Create a "reject" CMD. + * + * @param label command label. + * @param bank_url base URL of the bank implementing the + * "reject" operation. + * @param deposit_reference reference to a command that will + * provide a "row id" and credit (bank) account to craft + * the "reject" request. + * + * @return the command. */ struct TALER_TESTING_Command TALER_TESTING_cmd_bank_reject (const char *label, |