remove refund_fee from refund confirmation message and signature

This commit is contained in:
Florian Dold 2020-07-22 19:29:27 +05:30
parent 70090ed9a8
commit 93923c168d
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
5 changed files with 1 additions and 29 deletions

View File

@ -61,8 +61,6 @@ reply_refund_success (struct MHD_Connection *connection,
TALER_amount_hton (&rc.refund_amount, TALER_amount_hton (&rc.refund_amount,
&refund->refund_amount); &refund->refund_amount);
TALER_amount_hton (&rc.refund_fee,
&refund->refund_fee);
if (GNUNET_OK != if (GNUNET_OK !=
TEH_KS_sign (&rc, TEH_KS_sign (&rc,
&pub, &pub,
@ -76,8 +74,7 @@ reply_refund_success (struct MHD_Connection *connection,
return TALER_MHD_reply_json_pack ( return TALER_MHD_reply_json_pack (
connection, connection,
MHD_HTTP_OK, MHD_HTTP_OK,
"{s:o, s:o, s:o}", "{s:o, s:o}",
"refund_fee", TALER_JSON_from_amount (&refund->refund_fee),
"exchange_sig", GNUNET_JSON_from_data_auto (&sig), "exchange_sig", GNUNET_JSON_from_data_auto (&sig),
"exchange_pub", GNUNET_JSON_from_data_auto (&pub)); "exchange_pub", GNUNET_JSON_from_data_auto (&pub));
} }

View File

@ -911,7 +911,6 @@ struct TALER_EXCHANGE_RefundHandle;
* *
* @param cls closure * @param cls closure
* @param hr HTTP response data * @param hr HTTP response data
* @param refund_fee the refund fee the exchange charged us
* @param sign_key exchange key used to sign @a obj, or NULL * @param sign_key exchange key used to sign @a obj, or NULL
* @param signature the actual signature, or NULL on error * @param signature the actual signature, or NULL on error
*/ */
@ -919,7 +918,6 @@ typedef void
(*TALER_EXCHANGE_RefundCallback) ( (*TALER_EXCHANGE_RefundCallback) (
void *cls, void *cls,
const struct TALER_EXCHANGE_HttpResponse *hr, const struct TALER_EXCHANGE_HttpResponse *hr,
const struct TALER_Amount *refund_fee,
const struct TALER_ExchangePublicKeyP *sign_key, const struct TALER_ExchangePublicKeyP *sign_key,
const struct TALER_ExchangeSignatureP *signature); const struct TALER_ExchangeSignatureP *signature);

View File

@ -509,7 +509,6 @@ struct TALER_RefundRequestPS
* exchange to the customer. * exchange to the customer.
*/ */
struct TALER_AmountNBO refund_amount; struct TALER_AmountNBO refund_amount;
}; };
@ -552,18 +551,6 @@ struct TALER_RefundConfirmationPS
* exchange to the customer. * exchange to the customer.
*/ */
struct TALER_AmountNBO refund_amount; struct TALER_AmountNBO refund_amount;
/**
* Refund fee charged by the exchange. This must match the
* Exchange's denomination key's refund fee. If the client puts in
* an invalid refund fee (too high or too low) that does not match
* the Exchange's denomination key, the refund operation is invalid
* and will be rejected by the exchange. The @e amount_with_fee
* minus the @e refund_fee is the amount that will be credited to
* the original coin.
*/
struct TALER_AmountNBO refund_fee; // FIXME: kill! => also do not return refund_fee (from exchange + merchant APIs)
}; };

View File

@ -97,7 +97,6 @@ verify_refund_signature_ok (struct TALER_EXCHANGE_RefundHandle *rh,
struct GNUNET_JSON_Specification spec[] = { struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("exchange_sig", exchange_sig), GNUNET_JSON_spec_fixed_auto ("exchange_sig", exchange_sig),
GNUNET_JSON_spec_fixed_auto ("exchange_pub", exchange_pub), GNUNET_JSON_spec_fixed_auto ("exchange_pub", exchange_pub),
TALER_JSON_spec_amount_nbo ("refund_fee", &rh->depconf.refund_fee),
GNUNET_JSON_spec_end () GNUNET_JSON_spec_end ()
}; };
@ -148,8 +147,6 @@ handle_refund_finished (void *cls,
struct TALER_ExchangeSignatureP exchange_sig; struct TALER_ExchangeSignatureP exchange_sig;
struct TALER_ExchangePublicKeyP *ep = NULL; struct TALER_ExchangePublicKeyP *ep = NULL;
struct TALER_ExchangeSignatureP *es = NULL; struct TALER_ExchangeSignatureP *es = NULL;
struct TALER_Amount ra;
const struct TALER_Amount *rf = NULL;
const json_t *j = response; const json_t *j = response;
struct TALER_EXCHANGE_HttpResponse hr = { struct TALER_EXCHANGE_HttpResponse hr = {
.reply = j, .reply = j,
@ -178,9 +175,6 @@ handle_refund_finished (void *cls,
{ {
ep = &exchange_pub; ep = &exchange_pub;
es = &exchange_sig; es = &exchange_sig;
TALER_amount_ntoh (&ra,
&rh->depconf.refund_fee);
rf = &ra;
} }
break; break;
case MHD_HTTP_BAD_REQUEST: case MHD_HTTP_BAD_REQUEST:
@ -239,7 +233,6 @@ handle_refund_finished (void *cls,
} }
rh->cb (rh->cb_cls, rh->cb (rh->cb_cls,
&hr, &hr,
rf,
ep, ep,
es); es);
TALER_EXCHANGE_refund_cancel (rh); TALER_EXCHANGE_refund_cancel (rh);

View File

@ -76,7 +76,6 @@ struct RefundState
* *
* @param cls closure * @param cls closure
* @param hr HTTP response details * @param hr HTTP response details
* @param refund_fee the refund fee the exchange charged
* @param exchange_pub public key the exchange * @param exchange_pub public key the exchange
* used for signing @a obj. * used for signing @a obj.
* @param exchange_sig actual signature confirming the refund * @param exchange_sig actual signature confirming the refund
@ -84,7 +83,6 @@ struct RefundState
static void static void
refund_cb (void *cls, refund_cb (void *cls,
const struct TALER_EXCHANGE_HttpResponse *hr, const struct TALER_EXCHANGE_HttpResponse *hr,
const struct TALER_Amount *refund_fee,
const struct TALER_ExchangePublicKeyP *exchange_pub, const struct TALER_ExchangePublicKeyP *exchange_pub,
const struct TALER_ExchangeSignatureP *exchange_sig) const struct TALER_ExchangeSignatureP *exchange_sig)
{ {
@ -92,7 +90,6 @@ refund_cb (void *cls,
struct RefundState *rs = cls; struct RefundState *rs = cls;
struct TALER_TESTING_Command *refund_cmd; struct TALER_TESTING_Command *refund_cmd;
(void) refund_fee;
refund_cmd = &rs->is->commands[rs->is->ip]; refund_cmd = &rs->is->commands[rs->is->ip];
rs->rh = NULL; rs->rh = NULL;
if (rs->expected_response_code != hr->http_status) if (rs->expected_response_code != hr->http_status)