diff options
Diffstat (limited to 'src/include/taler_merchant_testing_lib.h')
-rw-r--r-- | src/include/taler_merchant_testing_lib.h | 400 |
1 files changed, 1 insertions, 399 deletions
diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h index 54d7f888..cb7e6042 100644 --- a/src/include/taler_merchant_testing_lib.h +++ b/src/include/taler_merchant_testing_lib.h @@ -581,7 +581,7 @@ TALER_TESTING_cmd_merchant_post_orders2 ( * GET /orders request. * @param http_status expected HTTP response code. * @param ... NULL-terminated list of labels (const char *) of - * reserve (commands) we expect to be returned in the list + * order (commands) we expect to be returned in the list * (assuming @a http_code is #MHD_HTTP_OK) * @return the command. */ @@ -1071,403 +1071,6 @@ TALER_TESTING_cmd_merchant_delete_transfer (const char *label, unsigned int http_status); -/* ******************* /reserves *************** */ - - -/** - * Define a "POST /reserves" CMD - * - * @param label command label. - * @param merchant_url url to the murchant. - * @param initial_balance initial amount in the reserve. - * @param exchange_url url to the exchange - * @param wire_method wire transfer method to use for this reserve - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_reserves (const char *label, - const char *merchant_url, - const char *initial_balance, - const char *exchange_url, - const char *wire_method, - unsigned int http_status); - - -/** - * This commands does not query the backend at all, - * but just makes up a fake reserve. - * - * @param label command label. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_reserves_fake (const char *label); - - -/** - * Define a "GET reserve" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the request. - * @param http_status expected HTTP response code. - * @param reserve_reference reference to a "POST /reserves" that provides the - * information we are expecting. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_reserve (const char *label, - const char *merchant_url, - unsigned int http_status, - const char *reserve_reference); - - -/** - * Define a "GET reserve" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the request. - * @param http_status expected HTTP response code. - * @param reserve_reference reference to a "POST /reserves" that provides the - * information we are expecting. - * @param ... NULL-terminated list of labels (const char *) of - * reward (commands) we expect to be returned in the list - * (assuming @a http_code is #MHD_HTTP_OK) - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_reserve_with_rewards (const char *label, - const char *merchant_url, - unsigned int http_status, - const char * - reserve_reference, - ...); - - -/** - * Define a "GET /reserves" CMD - * - * @param label command label. - * @param merchant_url url to the merchant. - * @param http_status expected HTTP response code. - * @param ... NULL-terminated list of labels (const char *) of - * reserve (commands) we expect to be returned in the list - * (assuming @a http_code is #MHD_HTTP_OK) - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_reserves (const char *label, - const char *merchant_url, - unsigned int http_status, - ...); - - -/** - * Define a "DELETE reserve" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * DELETE /reserves/$RESERVE_PUB request. - * @param reserve_reference command label of a command providing a reserve - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_delete_reserve (const char *label, - const char *merchant_url, - const char *reserve_reference, - unsigned int http_status); - - -/** - * Define a "PURGE reserve" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * DELETE /reserves/$RESERVE_PUB request. - * @param reserve_reference command label of a command providing a reserve - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_purge_reserve (const char *label, - const char *merchant_url, - const char *reserve_reference, - unsigned int http_status); - - -/** - * Define a get rewards CMD. - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * server the /reward-query request. - * @param http_status expected HTTP response code for the - * /reward-query request. - * @param ... NULL-terminated list of labels (const char *) of - * reward (commands) we expect to be returned in the list - * (assuming @a http_code is #MHD_HTTP_OK) - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_get_rewards (const char *label, - const char *merchant_url, - unsigned int http_status, - ...); - - -/** - * Define a get rewards CMD. - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * server the /reward-query request. - * @param http_status expected HTTP response code for the - * /reward-query request. - * @param offset row to start querying the database from. - * @param limit how many rows to return (with direction). - * @param ... NULL-terminated list of labels (const char *) of - * reward (commands) we expect to be returned in the list - * (assuming @a http_code is #MHD_HTTP_OK) - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_get_rewards2 (const char *label, - const char *merchant_url, - uint64_t offset, - int64_t limit, - unsigned int http_status, - ...); - - -/** - * Define a GET /private/rewards/$REWARD_ID CMD. - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * serve the request. - * @param reward_reference reference to a command that created a reward. - * @param http_status expected HTTP response code for the request. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_reward (const char *label, - const char *merchant_url, - const char *reward_reference, - unsigned int http_status); - - -/** - * Define a GET /private/rewards/$REWARD_ID CMD. - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * serve the request. - * @param reward_reference reference to a command that created a reward. - * @param http_status expected HTTP response code for the request. - * @param ... NULL-terminated list of labels (const char *) of - * pickup (commands) we expect to be returned in the list - * (assuming @a http_code is #MHD_HTTP_OK) - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_reward_with_pickups (const char *label, - const char *merchant_url, - const char *reward_reference, - unsigned int http_status, - ...); - -/** - * Define a GET /rewards/$REWARD_ID CMD. - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * serve the request. - * @param reward_reference reference to a command that created a reward. - * @param http_status expected HTTP response code for the request. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_wallet_get_reward (const char *label, - const char *merchant_url, - const char *reward_reference, - unsigned int http_status); - - -/** - * Define a GET /rewards/$REWARD_ID CMD. - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * serve the request. - * @param reward_reference reference to a command that created a reward. - * @param amount_remaining the balance remaining after pickups. - * @param http_status expected HTTP response code for the request. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_wallet_get_reward2 (const char *label, - const char *merchant_url, - const char *reward_reference, - const char *amount_remaining, - unsigned int http_status); - - -/** - * Create a /reward-authorize CMD. - * - * @param label this command label - * @param merchant_url the base URL of the merchant that will - * serve the /reward-authorize request. - * @param exchange_url the base URL of the exchange that owns - * the reserve from which the reward is going to be gotten. - * @param http_status the HTTP response code which is expected - * for this operation. - * @param justification human-readable justification for this - * reward authorization. - * @param amount the amount to authorize for rewardping. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_reward_authorize (const char *label, - const char *merchant_url, - const char *exchange_url, - unsigned int http_status, - const char *justification, - const char *amount); - - -/** - * Create a /reward-authorize CMD. - * - * @param label this command label - * @param merchant_url the base URL of the merchant that will - * serve the /reward-authorize request. - * @param exchange_url the base URL of the exchange that owns - * the reserve from which the reward is going to be gotten. - * @param reserve_reference reference to a command that created - * a reserve. - * @param http_status the HTTP response code which is expected - * for this operation. - * @param justification human-readable justification for this - * reward authorization. - * @param amount the amount to authorize for rewardping. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_reward_authorize_from_reserve (const char *label, - const char *merchant_url, - const char *exchange_url, - const char *reserve_reference, - unsigned int http_status, - const char *justification, - const char *amount); - - -/** - * Create a /reward-authorize CMD, specifying the Taler error code - * that is expected to be returned by the backend. - * - * @param label this command label - * @param merchant_url the base URL of the merchant that will - * serve the /reward-authorize request. - * @param exchange_url the base URL of the exchange that owns - * the reserve from which the reward is going to be gotten. - * @param http_status the HTTP response code which is expected - * for this operation. - * @param justification human-readable justification for this - * reward authorization. - * @param amount the amount to authorize for rewardping. - * @param ec expected Taler-defined error code. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_reward_authorize_with_ec (const char *label, - const char *merchant_url, - const char *exchange_url, - unsigned int http_status, - const char *justification, - const char *amount, - enum TALER_ErrorCode ec); - - -/** - * Create a /reward-authorize CMD, specifying the Taler error code - * that is expected to be returned by the backend. - * - * @param label this command label - * @param merchant_url the base URL of the merchant that will - * serve the /reward-authorize request. - * @param exchange_url the base URL of the exchange that owns - * the reserve from which the reward is going to be gotten. - * @param reserve_reference reference to a command that created - * a reserve. - * @param http_status the HTTP response code which is expected - * for this operation. - * @param justification human-readable justification for this - * reward authorization. - * @param amount the amount to authorize for rewardping. - * @param ec expected Taler-defined error code. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_reward_authorize_from_reserve_with_ec ( - const char *label, - const char *merchant_url, - const char *exchange_url, - const char *reserve_reference, - unsigned int http_status, - const char *justification, - const char *amount, - enum TALER_ErrorCode ec); - - -/** - * This commands does not query the backend at all, - * but just makes up a fake authorization id that will - * be subsequently used by the "pick up" CMD in order - * to test against such a case. - * - * @param label command label. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_reward_authorize_fake (const char *label); - - -/** - * Define a /reward-pickup CMD, equipped with the expected error - * code. - * - * @param label the command label - * @param merchant_url base URL of the backend which will serve - * the /reward-pickup request. - * @param http_status expected HTTP response code. - * @param authorize_reference reference to a /reward-autorize CMD - * that offers a reward id to pick up. - * @param amounts array of string-defined amounts that specifies - * which denominations will be accepted for rewardping. - * @param ec expected Taler error code. - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_reward_pickup_with_ec (const char *label, - const char *merchant_url, - unsigned int http_status, - const char *authorize_reference, - const char **amounts, - enum TALER_ErrorCode ec); - -/** - * Define a /reward-pickup CMD. - * - * @param label the command label - * @param merchant_url base URL of the backend which will serve - * the /reward-pickup request. - * @param http_status expected HTTP response code. - * @param authorize_reference reference to a /reward-autorize CMD - * that offers a reward id to pick up. - * @param amounts array of string-defined amounts that specifies - * which denominations will be accepted for rewardping. - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_reward_pickup (const char *label, - const char *merchant_url, - unsigned int http_status, - const char *authorize_reference, - const char **amounts); - - /** * Run a command to fetch the KYC status of a merchant. * @@ -1981,7 +1584,6 @@ TALER_TESTING_cmd_checkserver2 (const char *label, // FIXME: rename: refund_entry->refund_detail #define TALER_MERCHANT_TESTING_SIMPLE_TRAITS(op) \ op (claim_nonce, const struct GNUNET_CRYPTO_EddsaPublicKey) \ - op (reward_id, const struct TALER_RewardIdentifierP) \ op (pickup_id, const struct TALER_PickupIdentifierP) \ op (instance_name, const char) \ op (instance_id, const char) \ |