summaryrefslogtreecommitdiff
path: root/src/authorization/anastasis_authorization_plugin_iban.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/authorization/anastasis_authorization_plugin_iban.c')
-rw-r--r--src/authorization/anastasis_authorization_plugin_iban.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/authorization/anastasis_authorization_plugin_iban.c b/src/authorization/anastasis_authorization_plugin_iban.c
index 49c2ad5..9aa0b96 100644
--- a/src/authorization/anastasis_authorization_plugin_iban.c
+++ b/src/authorization/anastasis_authorization_plugin_iban.c
@@ -277,17 +277,20 @@ bank_event_cb (void *cls,
struct ANASTASIS_AUTHORIZATION_State *as = cls;
char *amount_s;
- amount_s = GNUNET_strndup (extra,
- extra_size);
- if (GNUNET_OK !=
- TALER_string_to_amount (amount_s,
- &as->amount))
+ if (NULL != extra)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Expected amount in event notification, got `%s'\n",
- amount_s);
+ amount_s = GNUNET_strndup (extra,
+ extra_size);
+ if (GNUNET_OK !=
+ TALER_string_to_amount (amount_s,
+ &as->amount))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Expected amount in event notification, got `%s'\n",
+ amount_s);
+ }
+ GNUNET_free (amount_s);
}
- GNUNET_free (amount_s);
MHD_resume_connection (as->connection);
as->trigger (as->trigger_cls);
}
@@ -463,12 +466,9 @@ test_wire_transfers (struct ANASTASIS_AUTHORIZATION_State *as)
limit = GNUNET_TIME_absolute_subtract (now,
CODE_VALIDITY_PERIOD);
(void) GNUNET_TIME_round_abs (&limit);
- GNUNET_asprintf (&debit_account_uri,
- "payto://iban/%s",
- as->iban_number);
qs = db->test_auth_iban_payment (
db->cls,
- debit_account_uri,
+ as->iban_number,
limit,
&check_payment_ok,
as);
@@ -489,6 +489,8 @@ test_wire_transfers (struct ANASTASIS_AUTHORIZATION_State *as)
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
break;
}
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Marking IBAN challenge as satisfied!\n");
qs = db->mark_challenge_code_satisfied (
db->cls,
&as->truth_uuid,
@@ -562,6 +564,8 @@ iban_process (struct ANASTASIS_AUTHORIZATION_State *as,
switch (test_wire_transfers (as))
{
case WTS_SUCCESS:
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "IBAN authorization finished!\n");
return ANASTASIS_AUTHORIZATION_RES_FINISHED;
case WTS_NOT_READY:
break; /* continue below */
@@ -579,6 +583,8 @@ iban_process (struct ANASTASIS_AUTHORIZATION_State *as,
return respond_with_challenge (as,
connection);
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "IBAN authorization finished!\n");
return ANASTASIS_AUTHORIZATION_RES_FINISHED;
}
/* should be impossible */