summaryrefslogtreecommitdiff
path: root/src/include/taler_merchant_testing_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/taler_merchant_testing_lib.h')
-rw-r--r--src/include/taler_merchant_testing_lib.h144
1 files changed, 124 insertions, 20 deletions
diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h
index c7813176..85cd73ef 100644
--- a/src/include/taler_merchant_testing_lib.h
+++ b/src/include/taler_merchant_testing_lib.h
@@ -582,6 +582,18 @@ TALER_TESTING_cmd_merchant_post_reserves (const char *label,
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.
*
@@ -678,6 +690,24 @@ TALER_TESTING_cmd_merchant_get_tip (const char *label,
/**
+ * Define a GET /private/tips/$TIP_ID CMD.
+ *
+ * @param label the command label
+ * @param merchant_url base URL of the merchant which will
+ * serve the request.
+ * @param tip_reference reference to a command that created a tip.
+ * @param pickup_refs a NULL-terminated list of pickup commands
+ * associated with the tip.
+ * @param http_status expected HTTP response code for the request.
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_merchant_get_tip_with_pickups (const char *label,
+ const char *merchant_url,
+ const char *tip_reference,
+ const char *pickup_refs[],
+ unsigned int http_status);
+
+/**
* Define a GET /tips/$TIP_ID CMD.
*
* @param label the command label
@@ -694,6 +724,73 @@ TALER_TESTING_cmd_wallet_get_tip (const char *label,
/**
+ * Define a GET /tips/$TIP_ID CMD.
+ *
+ * @param label the command label
+ * @param merchant_url base URL of the merchant which will
+ * serve the request.
+ * @param tip_reference reference to a command that created a tip.
+ * @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_tip2 (const char *label,
+ const char *merchant_url,
+ const char *tip_reference,
+ const char *amount_remaining,
+ unsigned int http_status);
+
+
+/**
+ * Create a /tip-authorize CMD.
+ *
+ * @param label this command label
+ * @param merchant_url the base URL of the merchant that will
+ * serve the /tip-authorize request.
+ * @param exchange_url the base URL of the exchange that owns
+ * the reserve from which the tip 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
+ * tip authorization.
+ * @param amount the amount to authorize for tipping.
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_tip_authorize (const char *label,
+ const char *merchant_url,
+ const char *exchange_url,
+ unsigned int http_status,
+ const char *justification,
+ const char *amount);
+
+
+/**
+ * Create a /tip-authorize CMD.
+ *
+ * @param label this command label
+ * @param merchant_url the base URL of the merchant that will
+ * serve the /tip-authorize request.
+ * @param exchange_url the base URL of the exchange that owns
+ * the reserve from which the tip 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
+ * tip authorization.
+ * @param amount the amount to authorize for tipping.
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_tip_authorize_from_reserve (const char *label,
+ const char *merchant_url,
+ const char *exchange_url,
+ const char *reserve_refernce,
+ unsigned int http_status,
+ const char *justification,
+ const char *amount);
+
+
+/**
* Create a /tip-authorize CMD, specifying the Taler error code
* that is expected to be returned by the backend.
*
@@ -720,39 +817,46 @@ TALER_TESTING_cmd_tip_authorize_with_ec (const char *label,
/**
- * 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_tip_authorize_fake (const char *label);
-
-
-/**
- * Create a /tip-authorize CMD.
+ * Create a /tip-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 /tip-authorize request.
* @param exchange_url the base URL of the exchange that owns
* the reserve from which the tip 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
* tip authorization.
* @param amount the amount to authorize for tipping.
+ * @param ec expected Taler-defined error code.
*/
struct TALER_TESTING_Command
-TALER_TESTING_cmd_tip_authorize (const char *label,
- const char *merchant_url,
- const char *exchange_url,
- unsigned int http_status,
- const char *justification,
- const char *amount);
+TALER_TESTING_cmd_tip_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_tip_authorize_fake (const char *label);
/**