diff options
author | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-06-24 17:38:09 -0400 |
---|---|---|
committer | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-06-24 17:38:09 -0400 |
commit | 0fbdd6c6cda1c7e0ad0b4ffc3f22bac3e1176c1d (patch) | |
tree | 8935dc12924a27e8c1112314b88fa895e1bf1240 /src/testing/testing_api_cmd_merchant_get_order.c | |
parent | ebfa7888c0cbb461cf70a8d809b1d183011713ce (diff) | |
download | merchant-0fbdd6c6cda1c7e0ad0b4ffc3f22bac3e1176c1d.tar.gz merchant-0fbdd6c6cda1c7e0ad0b4ffc3f22bac3e1176c1d.tar.bz2 merchant-0fbdd6c6cda1c7e0ad0b4ffc3f22bac3e1176c1d.zip |
got refunds working and tested
Diffstat (limited to 'src/testing/testing_api_cmd_merchant_get_order.c')
-rw-r--r-- | src/testing/testing_api_cmd_merchant_get_order.c | 25 |
1 files changed, 24 insertions, 1 deletions
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 = { |