diff options
Diffstat (limited to 'src/authorization/anastasis_authorization_plugin_iban.c')
-rw-r--r-- | src/authorization/anastasis_authorization_plugin_iban.c | 32 |
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, | |||
319 | /* Build HTTP response */ | 319 | /* Build HTTP response */ |
320 | { | 320 | { |
321 | struct MHD_Response *resp; | 321 | struct MHD_Response *resp; |
322 | const char *end; | ||
323 | size_t slen; | ||
324 | |||
325 | slen = strlen (as->iban_number); | ||
326 | if (slen > 4) | ||
327 | end = &as->iban_number[slen - 4]; | ||
328 | else | ||
329 | end = &as->iban_number[slen / 2]; | ||
330 | 322 | ||
331 | if (TALER_MHD_xmime_matches (mime, | 323 | if (TALER_MHD_xmime_matches (mime, |
332 | "application/json")) | 324 | "application/json")) |
@@ -334,16 +326,17 @@ respond_with_challenge (struct ANASTASIS_AUTHORIZATION_State *as, | |||
334 | resp = TALER_MHD_MAKE_JSON_PACK ( | 326 | resp = TALER_MHD_MAKE_JSON_PACK ( |
335 | GNUNET_JSON_pack_string ("method", | 327 | GNUNET_JSON_pack_string ("method", |
336 | "iban"), | 328 | "iban"), |
337 | TALER_JSON_pack_amount ("challenge_amount", | 329 | GNUNET_JSON_pack_object_steal ( |
338 | &ctx->expected_amount), | 330 | "details", |
339 | GNUNET_JSON_pack_string ("credit_iban", | 331 | GNUNET_JSON_PACK ( |
340 | ctx->business_iban), | 332 | TALER_JSON_pack_amount ("challenge_amount", |
341 | GNUNET_JSON_pack_string ("business_name", | 333 | &ctx->expected_amount), |
342 | ctx->business_name), | 334 | GNUNET_JSON_pack_string ("credit_iban", |
343 | GNUNET_JSON_pack_uint64 ("wire_transfer_subject", | 335 | ctx->business_iban), |
344 | as->code), | 336 | GNUNET_JSON_pack_string ("business_name", |
345 | GNUNET_JSON_pack_string ("debit_account_hint", | 337 | ctx->business_name), |
346 | end)); | 338 | GNUNET_JSON_pack_uint64 ("wire_transfer_subject", |
339 | as->code)))); | ||
347 | } | 340 | } |
348 | else | 341 | else |
349 | { | 342 | { |
@@ -357,8 +350,7 @@ respond_with_challenge (struct ANASTASIS_AUTHORIZATION_State *as, | |||
357 | TALER_amount2s (&ctx->expected_amount), | 350 | TALER_amount2s (&ctx->expected_amount), |
358 | ctx->business_name, | 351 | ctx->business_name, |
359 | ctx->business_iban, | 352 | ctx->business_iban, |
360 | (unsigned long long) as->code, | 353 | (unsigned long long) as->code); |
361 | end); | ||
362 | resp = MHD_create_response_from_buffer (reply_len, | 354 | resp = MHD_create_response_from_buffer (reply_len, |
363 | reply, | 355 | reply, |
364 | MHD_RESPMEM_MUST_COPY); | 356 | MHD_RESPMEM_MUST_COPY); |