summaryrefslogtreecommitdiff
path: root/src/authorization/anastasis_authorization_plugin_iban.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-19 15:11:17 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-19 15:11:17 +0200
commit5b3ded24a329d25b77372f17d75ff6b3d68bfa5d (patch)
treef80c75ed651c0180ae4467dd96f51d6610ad80ce /src/authorization/anastasis_authorization_plugin_iban.c
parent677c7e87a5da584e68194c9cca19a91191c3140c (diff)
downloadanastasis-5b3ded24a329d25b77372f17d75ff6b3d68bfa5d.tar.gz
anastasis-5b3ded24a329d25b77372f17d75ff6b3d68bfa5d.tar.bz2
anastasis-5b3ded24a329d25b77372f17d75ff6b3d68bfa5d.zip
document reducer return values for IBAN auth
Diffstat (limited to 'src/authorization/anastasis_authorization_plugin_iban.c')
-rw-r--r--src/authorization/anastasis_authorization_plugin_iban.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/authorization/anastasis_authorization_plugin_iban.c b/src/authorization/anastasis_authorization_plugin_iban.c
index 4f43d3f..ef11b88 100644
--- a/src/authorization/anastasis_authorization_plugin_iban.c
+++ b/src/authorization/anastasis_authorization_plugin_iban.c
@@ -319,14 +319,6 @@ respond_with_challenge (struct ANASTASIS_AUTHORIZATION_State *as,
/* Build HTTP response */
{
struct MHD_Response *resp;
- const char *end;
- size_t slen;
-
- slen = strlen (as->iban_number);
- if (slen > 4)
- end = &as->iban_number[slen - 4];
- else
- end = &as->iban_number[slen / 2];
if (TALER_MHD_xmime_matches (mime,
"application/json"))
@@ -334,16 +326,17 @@ respond_with_challenge (struct ANASTASIS_AUTHORIZATION_State *as,
resp = TALER_MHD_MAKE_JSON_PACK (
GNUNET_JSON_pack_string ("method",
"iban"),
- TALER_JSON_pack_amount ("challenge_amount",
- &ctx->expected_amount),
- GNUNET_JSON_pack_string ("credit_iban",
- ctx->business_iban),
- GNUNET_JSON_pack_string ("business_name",
- ctx->business_name),
- GNUNET_JSON_pack_uint64 ("wire_transfer_subject",
- as->code),
- GNUNET_JSON_pack_string ("debit_account_hint",
- end));
+ GNUNET_JSON_pack_object_steal (
+ "details",
+ GNUNET_JSON_PACK (
+ TALER_JSON_pack_amount ("challenge_amount",
+ &ctx->expected_amount),
+ GNUNET_JSON_pack_string ("credit_iban",
+ ctx->business_iban),
+ GNUNET_JSON_pack_string ("business_name",
+ ctx->business_name),
+ GNUNET_JSON_pack_uint64 ("wire_transfer_subject",
+ as->code))));
}
else
{
@@ -357,8 +350,7 @@ respond_with_challenge (struct ANASTASIS_AUTHORIZATION_State *as,
TALER_amount2s (&ctx->expected_amount),
ctx->business_name,
ctx->business_iban,
- (unsigned long long) as->code,
- end);
+ (unsigned long long) as->code);
resp = MHD_create_response_from_buffer (reply_len,
reply,
MHD_RESPMEM_MUST_COPY);