[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant] branch master updated: check for compatible currency du
From: |
gnunet |
Subject: |
[taler-merchant] branch master updated: check for compatible currency during POST |
Date: |
Mon, 17 May 2021 21:39:08 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new 81e3d4fe check for compatible currency during POST
81e3d4fe is described below
commit 81e3d4fe0930e964a2012df3d5e994edcff1da26
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon May 17 21:39:05 2021 +0200
check for compatible currency during POST
---
src/backend/taler-merchant-httpd_private-post-reserves.c | 11 +++++++++++
src/backend/taler-merchant-httpd_private-post-transfers.c | 11 +++++++++++
2 files changed, 22 insertions(+)
diff --git a/src/backend/taler-merchant-httpd_private-post-reserves.c
b/src/backend/taler-merchant-httpd_private-post-reserves.c
index f4c001b1..095264d3 100644
--- a/src/backend/taler-merchant-httpd_private-post-reserves.c
+++ b/src/backend/taler-merchant-httpd_private-post-reserves.c
@@ -267,6 +267,17 @@ TMH_private_post_reserves (const struct TMH_RequestHandler
*rh,
? MHD_YES
: MHD_NO;
}
+ if (0 !=
+ strcasecmp (rc->initial_balance.currency,
+ TMH_currency))
+ {
+ GNUNET_break_op (0);
+ return TALER_MHD_reply_with_error (
+ connection,
+ MHD_HTTP_CONFLICT,
+ TALER_EC_GENERIC_CURRENCY_MISMATCH,
+ TMH_currency);
+ }
rc->fo = TMH_EXCHANGES_find_exchange (rc->exchange_url,
wire_method,
GNUNET_NO,
diff --git a/src/backend/taler-merchant-httpd_private-post-transfers.c
b/src/backend/taler-merchant-httpd_private-post-transfers.c
index 505ca33f..76f86ce2 100644
--- a/src/backend/taler-merchant-httpd_private-post-transfers.c
+++ b/src/backend/taler-merchant-httpd_private-post-transfers.c
@@ -928,6 +928,17 @@ TMH_private_post_transfers (const struct
TMH_RequestHandler *rh,
return (GNUNET_NO == res)
? MHD_YES
: MHD_NO;
+ if (0 !=
+ strcasecmp (ptc->amount.currency,
+ TMH_currency))
+ {
+ GNUNET_break_op (0);
+ return TALER_MHD_reply_with_error (
+ connection,
+ MHD_HTTP_CONFLICT,
+ TALER_EC_GENERIC_CURRENCY_MISMATCH,
+ TMH_currency);
+ }
}
/* Check if transfer data is in database, if not, add it. */
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-merchant] branch master updated: check for compatible currency during POST,
gnunet <=