summaryrefslogtreecommitdiff
path: root/src/backenddb/plugin_merchantdb_postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backenddb/plugin_merchantdb_postgres.c')
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
index 5afe7f0a..9f07d3aa 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -907,7 +907,8 @@ kyc_status_cb (void *cls,
char *exchange_url;
char *payto_uri;
struct GNUNET_TIME_Timestamp last_check;
- uint8_t kyc_ok;
+ bool kyc_ok;
+ uint32_t aml_decision;
struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_auto_from_type ("h_wire",
&h_wire),
@@ -919,8 +920,10 @@ kyc_status_cb (void *cls,
&exchange_url),
GNUNET_PQ_result_spec_timestamp ("kyc_timestamp",
&last_check),
- GNUNET_PQ_result_spec_auto_from_type ("kyc_ok",
- &kyc_ok),
+ GNUNET_PQ_result_spec_bool ("kyc_ok",
+ &kyc_ok),
+ GNUNET_PQ_result_spec_uint32 ("aml_decision",
+ &aml_decision),
GNUNET_PQ_result_spec_end
};
@@ -954,7 +957,8 @@ kyc_status_cb (void *cls,
payto_uri,
exchange_url,
last_check,
- 0 != kyc_ok);
+ kyc_ok,
+ (enum TALER_AmlDecisionState) aml_decision);
GNUNET_PQ_cleanup_result (rs);
}
}
@@ -1023,6 +1027,7 @@ postgres_account_kyc_get_status (void *cls,
* @param exchange_pub public key of the exchange, or NULL for none
* @param timestamp timestamp to store
* @param kyc_ok current KYC status (true for satisfied)
+ * @param aml_decision current AML decision state at the exchange
* @return database result code
*/
static enum GNUNET_DB_QueryStatus
@@ -1035,23 +1040,25 @@ postgres_account_kyc_set_status (
const struct TALER_ExchangeSignatureP *exchange_sig,
const struct TALER_ExchangePublicKeyP *exchange_pub,
struct GNUNET_TIME_Timestamp timestamp,
- bool kyc_ok)
+ bool kyc_ok,
+ enum TALER_AmlDecisionState aml_decision)
{
struct PostgresClosure *pg = cls;
- uint8_t ok = kyc_ok;
+ uint32_t aml32 = (uint32_t) aml_decision;
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_string (merchant_id),
GNUNET_PQ_query_param_auto_from_type (h_wire),
GNUNET_PQ_query_param_string (exchange_url),
GNUNET_PQ_query_param_uint64 (&exchange_kyc_serial),
GNUNET_PQ_query_param_timestamp (&timestamp),
- GNUNET_PQ_query_param_auto_from_type (&ok),
+ GNUNET_PQ_query_param_bool (kyc_ok),
exchange_pub
? GNUNET_PQ_query_param_auto_from_type (exchange_pub)
: GNUNET_PQ_query_param_null (),
exchange_sig
? GNUNET_PQ_query_param_auto_from_type (exchange_sig)
: GNUNET_PQ_query_param_null (),
+ GNUNET_PQ_query_param_uint32 (&aml32),
GNUNET_PQ_query_param_end
};
@@ -7923,8 +7930,9 @@ postgres_connect (void *cls)
",account_serial"
",exchange_url"
",exchange_pub"
- ",exchange_sig)"
- " SELECT $5, $6, $4, account_serial, $3, $7, $8"
+ ",exchange_sig"
+ ",aml_decision)"
+ " SELECT $5, $6, $4, account_serial, $3, $7, $8, $9"
" FROM merchant_instances"
" JOIN merchant_accounts USING (merchant_serial)"
" WHERE merchant_id=$1"
@@ -7935,7 +7943,8 @@ postgres_connect (void *cls)
" ,kyc_timestamp=$5"
" ,kyc_ok=$6"
" ,exchange_pub=$7"
- " ,exchange_sig=$8"),
+ " ,exchange_sig=$8"
+ " ,aml_decision=$9"),
/* for postgres_account_kyc_get_status */
GNUNET_PQ_make_prepare ("lookup_kyc_status",
"SELECT"
@@ -7945,6 +7954,7 @@ postgres_connect (void *cls)
",exchange_url"
",kyc_timestamp"
",kyc_ok"
+ ",aml_decision"
" FROM merchant_instances"
" JOIN merchant_accounts"
" USING (merchant_serial)"