From 0fbdd6c6cda1c7e0ad0b4ffc3f22bac3e1176c1d Mon Sep 17 00:00:00 2001 From: Jonathan Buchanan Date: Wed, 24 Jun 2020 17:38:09 -0400 Subject: got refunds working and tested --- src/testing/testing_api_cmd_merchant_get_order.c | 25 +++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/testing/testing_api_cmd_merchant_get_order.c') diff --git a/src/testing/testing_api_cmd_merchant_get_order.c b/src/testing/testing_api_cmd_merchant_get_order.c index 985e9116..739e4efa 100644 --- a/src/testing/testing_api_cmd_merchant_get_order.c +++ b/src/testing/testing_api_cmd_merchant_get_order.c @@ -57,6 +57,16 @@ struct MerchantGetOrderState * Reference to a command that created an order. */ const char *order_reference; + + /** + * Whether the order was paid or not. + */ + bool paid; + + /** + * Whether the order was refunded or not. + */ + bool refunded; }; @@ -97,6 +107,13 @@ merchant_get_order_cb ( case MHD_HTTP_OK: // FIXME: use gts->tip_reference here to // check if the data returned matches that from the POST / PATCH + if (gos->paid != osr->paid) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Order paid does not match\n"); + TALER_TESTING_interpreter_fail (gos->is); + return; + } break; default: GNUNET_log (GNUNET_ERROR_TYPE_WARNING, @@ -174,18 +191,22 @@ merchant_get_order_cleanup (void *cls, /** - * Define a GET /private/tips/$TIP_ID CMD. + * Define a GET /private/orders/$ORDER_ID CMD. * * @param label the command label * @param merchant_url base URL of the merchant which will * serve the request. * @param order_reference reference to a command that created an order. + * @param paid whether the order has been paid for or not. + * @param refunded whether the order has been refunded. * @param http_status expected HTTP response code for the request. */ struct TALER_TESTING_Command TALER_TESTING_cmd_merchant_get_order (const char *label, const char *merchant_url, const char *order_reference, + bool paid, + bool refunded, unsigned int http_status) { struct MerchantGetOrderState *gos; @@ -193,6 +214,8 @@ TALER_TESTING_cmd_merchant_get_order (const char *label, gos = GNUNET_new (struct MerchantGetOrderState); gos->merchant_url = merchant_url; gos->order_reference = order_reference; + gos->paid = paid; + gos->refunded = refunded; gos->http_status = http_status; { struct TALER_TESTING_Command cmd = { -- cgit v1.2.3