diff options
Diffstat (limited to 'src/include/taler_merchant_testing_lib.h')
-rw-r--r-- | src/include/taler_merchant_testing_lib.h | 170 |
1 files changed, 61 insertions, 109 deletions
diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h index 63becbc7..77c6b57d 100644 --- a/src/include/taler_merchant_testing_lib.h +++ b/src/include/taler_merchant_testing_lib.h @@ -444,6 +444,67 @@ TALER_TESTING_cmd_merchant_claim_order (const char *label, const char *order_id); +/** + * Make a "pay" test command. + * + * @param label command label. + * @param merchant_url merchant base url + * @param http_status expected HTTP response code. + * @param proposal_reference the proposal whose payment status + * is going to be checked. + * @param coin_reference reference to any command which is able + * to provide coins to use for paying. + * @param amount_with_fee amount to pay, including the deposit + * fee + * @param amount_without_fee amount to pay, no fees included. + * @return the command + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_merchant_pay_order (const char *label, + const char *merchant_url, + unsigned int http_status, + const char *proposal_reference, + const char *coin_reference, + const char *amount_with_fee, + const char *amount_without_fee); + +/** + * Make an "abort" test command. + * + * @param label command label + * @param merchant_url merchant base URL + * @param pay_reference reference to the payment to abort + * @param http_status expected HTTP response code + * @return the command + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_merchant_order_abort (const char *label, + const char *merchant_url, + const char *pay_reference, + unsigned int http_status); + + +/** + * Define a "refund" order CMD. + * + * @param label command label. + * @param merchant_url base URL of the backend serving the + * "refund increase" request. + * @param reason refund justification, human-readable. + * @param order_id order id of the contract to refund. + * @param refund_amount amount to be refund-increased. + * @param http_code expected HTTP response code. + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_merchant_order_refund (const char *label, + const char *merchant_url, + const char *reason, + const char *order_id, + const char *refund_amount, + unsigned int http_code); + + /* ******************** OLD ******************* */ @@ -540,92 +601,6 @@ TALER_TESTING_cmd_poll_payment_conclude (const char *label, /** - * Make a "pay" test command. - * - * @param label command label. - * @param merchant_url merchant base url - * @param http_status expected HTTP response code. - * @param proposal_reference the proposal whose payment status - * is going to be checked. - * @param coin_reference reference to any command which is able - * to provide coins to use for paying. - * @param amount_with_fee amount to pay, including the deposit - * fee - * @param amount_without_fee amount to pay, no fees included. - * @param refund_fee fee for refunding this payment. - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_pay (const char *label, - const char *merchant_url, - unsigned int http_status, - const char *proposal_reference, - const char *coin_reference, - const char *amount_with_fee, - const char *amount_without_fee, - const char *refund_fee); - -/** - * Make a "pay again" test command. Its purpose is to - * take all the data from a aborted "pay" CMD, and use - * good coins - found in @a coin_reference - to correctly - * pay for it. - * - * @param label command label - * @param merchant_url merchant base URL - * @param pay_reference reference to the payment to replay - * @param coin_reference reference to the coins to use - * @param http_status expected HTTP response code - * - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_pay_again (const char *label, - const char *merchant_url, - const char *pay_reference, - const char *coin_reference, - const char *refund_fee, - unsigned int http_status); - -/** - * Make a "pay abort" test command. - * - * @param label command label - * @param merchant_url merchant base URL - * @param pay_reference reference to the payment to abort - * @param http_status expected HTTP response code - * - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_pay_abort (const char *label, - const char *merchant_url, - const char *pay_reference, - unsigned int http_status); - -/** - * Make a "pay abort refund" CMD. This command uses the - * refund permission from a "pay abort" CMD, and redeems it - * at the exchange. - * - * @param label command label. - * @param abort_reference reference to the "pay abort" CMD that - * will offer the refund permission. - * @param num_coins how many coins are expected to be refunded. - * @param refund_amount the amount we are going to redeem as - * refund. - * @param refund_fee the refund fee (FIXME: who pays it?) - * @param http_status expected HTTP response code. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_pay_abort_refund (const char *label, - const char *abort_reference, - unsigned int num_coins, - const char *refund_amount, - const char *refund_fee, - unsigned int http_status); - -/** * Define a "refund lookup" CMD. * * @param label command label. @@ -682,29 +657,6 @@ TALER_TESTING_cmd_refund_lookup_with_amount (const char *label, /** - * Define a "refund increase" CMD. - * - * @param label command label. - * @param merchant_url base URL of the backend serving the - * "refund increase" request. - * @param reason refund justification, human-readable. - * @param order_id order id of the contract to refund. - * @param refund_amount amount to be refund-increased. - * @param refund_fee refund fee. - * @param http_code expected HTTP response code. - * - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_refund_increase (const char *label, - const char *merchant_url, - const char *reason, - const char *order_id, - const char *refund_amount, - const char *refund_fee, - unsigned int http_code); - -/** * Make a "history" command. * * @param label command label. |