diff options
author | priscilla <priscilla.huang@efrei.net> | 2023-03-27 09:43:00 -0400 |
---|---|---|
committer | priscilla <priscilla.huang@efrei.net> | 2023-03-27 09:43:00 -0400 |
commit | ed3003dd83612628effa105a798f376def2fd33b (patch) | |
tree | a9830203a37bf90e68563e520baab802267d1ebf | |
parent | ecf977438a029f464a9528cd4149d9e70c6da72b (diff) | |
download | merchant-ed3003dd83612628effa105a798f376def2fd33b.tar.gz merchant-ed3003dd83612628effa105a798f376def2fd33b.tar.bz2 merchant-ed3003dd83612628effa105a798f376def2fd33b.zip |
pull
-rw-r--r-- | src/testing/testing_api_cmd_pay_order.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/testing/testing_api_cmd_pay_order.c b/src/testing/testing_api_cmd_pay_order.c index 8077f375..cff679a8 100644 --- a/src/testing/testing_api_cmd_pay_order.c +++ b/src/testing/testing_api_cmd_pay_order.c @@ -93,9 +93,18 @@ struct PayState const char *session_id; /** - * This variable is for the verification of the payment. + * base64-encoded key */ const char *pos_key; + + /** + * Option that add amount of the order + */ + enum TALER_MerchantConfirmationAlgorithm pos_alg; + + /** + * This variable is for the verification of the payment. + */ const char *pos_confirmation; }; @@ -245,23 +254,6 @@ pay_cb (void *cls, if (MHD_HTTP_OK == pr->hr.http_status) { ps->merchant_sig = pr->details.success.merchant_sig; - /* - struct TALER_Amount total_amount; - const char *pos_key; - struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_string ("order_id", - &ps->proposal_reference), - GNUNET_JSON_spec_string ("pos_key", - &pos_key), - TALER_JSON_spec_amount_any ("amount", - &total_amount), - GNUNET_JSON_spec_end () - }; - - ps->pos_confirmation = TALER_build_pos_confirmation (pos_key, - TALER_MCA_WITHOUT_PRICE, - &total_amount, - GNUNET_TIME_timestamp_get());*/ // FIXME: check if pr->details.success.pos_confirmation; // for that, get pos_secret from ps->proposal_reference CMD and amount from pay/order creation cmd using traits struct TALER_Amount amount_with_fee; @@ -269,7 +261,7 @@ pay_cb (void *cls, TALER_string_to_amount (ps->amount_with_fee, &amount_with_fee)); ps->pos_confirmation = TALER_build_pos_confirmation (ps->pos_key, - TALER_MCA_WITHOUT_PRICE, + ps->pos_alg, &amount_with_fee, GNUNET_TIME_timestamp_get()); ps->pos_confirmation = pr->details.success.pos_confirmation; @@ -507,6 +499,7 @@ pay_traits (void *cls, TALER_TESTING_make_trait_merchant_sig (&ps->merchant_sig), TALER_TESTING_make_trait_amount (&amount_with_fee), TALER_TESTING_make_trait_template_pos_key (&ps->pos_key), + TALER_TESTING_make_trait_template_pos_alg (&ps->pos_alg), TALER_TESTING_trait_end () }; |