merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 536f91572e268e34b0b007aca3a047c445e06a7c
parent dbc78e917cb1cfd8eb5d0f5b1749fcdb2f8006ad
Author: Florian Dold <florian.dold@gmail.com>
Date:   Wed, 22 Jul 2020 20:14:26 +0530

adapt to exchange refund response message changes

Diffstat:
Msrc/backend/taler-merchant-httpd_get-orders-ID.c | 3---
Msrc/backend/taler-merchant-httpd_post-orders-ID-abort.c | 3---
Msrc/backenddb/merchant-0001.sql | 4----
Msrc/backenddb/plugin_merchantdb_postgres.c | 9++-------
Msrc/backenddb/test_merchantdb.c | 4----
Msrc/include/taler_merchant_service.h | 6------
Msrc/include/taler_merchantdb_plugin.h | 2--
Msrc/lib/merchant_api_post_order_abort.c | 4----
8 files changed, 2 insertions(+), 33 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.c b/src/backend/taler-merchant-httpd_get-orders-ID.c @@ -434,14 +434,12 @@ check_resume_god (struct GetOrderData *god) * * @param cls a `struct CoinRefund` * @param hr HTTP response data - * @param refund_fee fee the exchange charged * @param exchange_pub exchange key used to sign refund confirmation * @param exchange_sig exchange's signature over refund */ static void refund_cb (void *cls, const struct TALER_EXCHANGE_HttpResponse *hr, - const struct TALER_Amount *refund_fee, const struct TALER_ExchangePublicKeyP *exchange_pub, const struct TALER_ExchangeSignatureP *exchange_sig) { @@ -466,7 +464,6 @@ refund_cb (void *cls, cr->exchange_sig = *exchange_sig; qs = TMH_db->insert_refund_proof (TMH_db->cls, cr->refund_serial, - refund_fee, exchange_sig, exchange_pub); if (0 >= qs) diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-abort.c b/src/backend/taler-merchant-httpd_post-orders-ID-abort.c @@ -438,14 +438,12 @@ find_next_exchange (struct AbortContext *ac); * * @param cls closure * @param hr HTTP response data - * @param refund_fee fee the exchange charged * @param sign_key exchange key used to sign @a obj, or NULL * @param signature the actual signature, or NULL on error */ static void refund_cb (void *cls, const struct TALER_EXCHANGE_HttpResponse *hr, - const struct TALER_Amount *refund_fee, const struct TALER_ExchangePublicKeyP *sign_key, const struct TALER_ExchangeSignatureP *signature) { @@ -454,7 +452,6 @@ refund_cb (void *cls, (void) sign_key; (void) signature; - (void) refund_fee; rd->rh = NULL; rd->http_status = hr->http_status; rd->exchange_reply = json_incref ((json_t*) hr->reply); diff --git a/src/backenddb/merchant-0001.sql b/src/backenddb/merchant-0001.sql @@ -334,15 +334,11 @@ CREATE TABLE IF NOT EXISTS merchant_refund_proofs (refund_serial BIGINT PRIMARY KEY REFERENCES merchant_refunds (refund_serial) ON DELETE CASCADE ,exchange_sig BYTEA NOT NULL CHECK (LENGTH(exchange_sig)=64) - ,refund_fee_val INT8 NOT NULL - ,refund_fee_frac INT4 NOT NULL ,signkey_serial BIGINT NOT NULL REFERENCES merchant_exchange_signing_keys (signkey_serial) ON DELETE CASCADE ); COMMENT ON TABLE merchant_refund_proofs IS 'Refunds confirmed by the exchange (not all approved refunds are grabbed by the wallet)'; -COMMENT ON COLUMN merchant_refund_proofs.refund_fee_val - IS 'Refund fee exchange charged'; -------------------- Wire transfers --------------------------- diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c @@ -3133,7 +3133,6 @@ postgres_lookup_refunds_detailed ( * * @param cls closure * @param refund_serial serial number of the refund - * @param refund_fee refund fee the exchange said it charged * @param exchange_sig signature from exchange that coin was refunded * @param exchange_pub signing key that was used for @a exchange_sig * @return transaction status @@ -3142,7 +3141,6 @@ static enum GNUNET_DB_QueryStatus postgres_insert_refund_proof ( void *cls, uint64_t refund_serial, - const struct TALER_Amount *refund_fee, const struct TALER_ExchangeSignatureP *exchange_sig, const struct TALER_ExchangePublicKeyP *exchange_pub) { @@ -3150,7 +3148,6 @@ postgres_insert_refund_proof ( struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&refund_serial), GNUNET_PQ_query_param_auto_from_type (exchange_sig), - TALER_PQ_query_param_amount (refund_fee), GNUNET_PQ_query_param_auto_from_type (exchange_pub), GNUNET_PQ_query_param_end }; @@ -7472,12 +7469,10 @@ libtaler_plugin_merchantdb_postgres_init (void *cls) "INSERT INTO merchant_refund_proofs" "(refund_serial" ",exchange_sig" - ",refund_fee_val" - ",refund_fee_frac" ",signkey_serial)" - "SELECT $1, $2, $3, $4, signkey_serial" + "SELECT $1, $2, signkey_serial" " FROM merchant_exchange_signing_keys" - " WHERE exchange_pub=$5" + " WHERE exchange_pub=$3" " ORDER BY start_date DESC" " LIMIT 1", 5), diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c @@ -6162,8 +6162,6 @@ run_test_refunds (struct TestRefunds_Closure *cls) plugin->insert_refund_proof (plugin->cls, refund_serial, &cls->refund_proof. - refund_fee, - &cls->refund_proof. exchange_sig, &cls->signkey.exchange_pub), "Insert refund proof failed\n"); @@ -6171,8 +6169,6 @@ run_test_refunds (struct TestRefunds_Closure *cls) plugin->insert_refund_proof (plugin->cls, refund_serial, &cls->refund_proof. - refund_fee, - &cls->refund_proof. exchange_sig, &cls->signkey.exchange_pub), "Insert refund proof failed\n"); diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h @@ -2103,12 +2103,6 @@ struct TALER_MERCHANT_AbortedCoin * Exchange public key affirming the refund. */ struct TALER_ExchangePublicKeyP exchange_pub; - - /** - * Refund fee charged by the exchange. The API will have checked the - * signature, but NOT that this is the expected fee. - */ - struct TALER_Amount refund_fee; }; diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h @@ -1408,7 +1408,6 @@ struct TALER_MERCHANTDB_Plugin * * @param cls closure * @param refund_serial serial number of the refund - * @param refund_fee refund fee the exchange said it charged * @param exchange_sig signature from exchange that coin was refunded * @param exchange_pub signing key that was used for @a exchange_sig * @return transaction status @@ -1416,7 +1415,6 @@ struct TALER_MERCHANTDB_Plugin enum GNUNET_DB_QueryStatus (*insert_refund_proof)(void *cls, uint64_t refund_serial, - const struct TALER_Amount *refund_fee, const struct TALER_ExchangeSignatureP *exchange_sig, const struct TALER_ExchangePublicKeyP *exchange_pub); diff --git a/src/lib/merchant_api_post_order_abort.c b/src/lib/merchant_api_post_order_abort.c @@ -161,8 +161,6 @@ check_abort_refund (struct TALER_MERCHANT_OrderAbortHandle *oah, &res[i].exchange_sig), GNUNET_JSON_spec_fixed_auto ("exchange_pub", &res[i].exchange_pub), - TALER_JSON_spec_amount ("refund_fee", - &res[i].refund_fee), GNUNET_JSON_spec_end () }; @@ -189,8 +187,6 @@ check_abort_refund (struct TALER_MERCHANT_OrderAbortHandle *oah, TALER_amount_hton (&rr.refund_amount, &oah->coins[i].amount_with_fee); - TALER_amount_hton (&rr.refund_fee, - &res[i].refund_fee); if (GNUNET_OK != GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND, &rr,