Method to mark merchant as KYC-checked.
This commit is contained in:
parent
c13973626b
commit
7c94a71def
@ -1298,6 +1298,7 @@ postgres_prepare (PGconn *db_conn)
|
|||||||
* 4 Put money flow event for a merchant.
|
* 4 Put money flow event for a merchant.
|
||||||
* 5 Delete money flow records for a fresh-checked merchant.
|
* 5 Delete money flow records for a fresh-checked merchant.
|
||||||
* 6 Put a merchant.
|
* 6 Put a merchant.
|
||||||
|
* 7 Change KYC status flag for a merchant.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GNUNET_PQ_make_prepare ("insert_kyc_merchant",
|
GNUNET_PQ_make_prepare ("insert_kyc_merchant",
|
||||||
@ -1306,6 +1307,14 @@ postgres_prepare (PGconn *db_conn)
|
|||||||
"($1, FALSE)",
|
"($1, FALSE)",
|
||||||
1),
|
1),
|
||||||
|
|
||||||
|
GNUNET_PQ_make_prepare ("mark_kyc_merchant",
|
||||||
|
"UPDATE kyc_merchants"
|
||||||
|
" SET"
|
||||||
|
" kyc_checked=TRUE"
|
||||||
|
" WHERE"
|
||||||
|
" payto_url=$1",
|
||||||
|
1),
|
||||||
|
|
||||||
/* Used in #postgres_select_deposits_missing_wire */
|
/* Used in #postgres_select_deposits_missing_wire */
|
||||||
GNUNET_PQ_make_prepare ("deposits_get_overdue",
|
GNUNET_PQ_make_prepare ("deposits_get_overdue",
|
||||||
"SELECT"
|
"SELECT"
|
||||||
@ -6515,6 +6524,31 @@ postgres_select_deposits_missing_wire (void *cls,
|
|||||||
return qs;
|
return qs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mark a merchant as KYC-checked.
|
||||||
|
*
|
||||||
|
* @param payto_url payto:// URL indentifying the merchant
|
||||||
|
* to check. Note, different banks may have different
|
||||||
|
* policies to check their customers.
|
||||||
|
* @return database transaction status.
|
||||||
|
*/
|
||||||
|
static enum GNUNET_DB_QueryStatus
|
||||||
|
postgres_mark_kyc_merchant (void *cls,
|
||||||
|
struct TALER_EXCHANGEDB_Session *session,
|
||||||
|
const char *payto_url)
|
||||||
|
{
|
||||||
|
|
||||||
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
|
GNUNET_PQ_query_param_string (payto_url),
|
||||||
|
GNUNET_PQ_query_param_end
|
||||||
|
};
|
||||||
|
|
||||||
|
return GNUNET_PQ_eval_prepared_non_select (session->conn,
|
||||||
|
"mark_kyc_merchant",
|
||||||
|
params);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert a merchant into the KYC monitor table.
|
* Insert a merchant into the KYC monitor table.
|
||||||
*
|
*
|
||||||
@ -6672,6 +6706,7 @@ libtaler_plugin_exchangedb_postgres_init (void *cls)
|
|||||||
= &postgres_select_deposits_missing_wire;
|
= &postgres_select_deposits_missing_wire;
|
||||||
|
|
||||||
plugin->insert_kyc_merchant = postgres_insert_kyc_merchant;
|
plugin->insert_kyc_merchant = postgres_insert_kyc_merchant;
|
||||||
|
plugin->mark_kyc_merchant = postgres_mark_kyc_merchant;
|
||||||
|
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
@ -2185,8 +2185,11 @@ run (void *cls)
|
|||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
plugin->insert_kyc_merchant (NULL,
|
plugin->insert_kyc_merchant (NULL,
|
||||||
session,
|
session,
|
||||||
"payto:///mock"));
|
"payto://mock"));
|
||||||
|
FAILIF (GNUNET_OK !=
|
||||||
|
plugin->mark_kyc_merchant (NULL,
|
||||||
|
session,
|
||||||
|
"payto://mock"));
|
||||||
plugin->preflight (plugin->cls,
|
plugin->preflight (plugin->cls,
|
||||||
session);
|
session);
|
||||||
|
|
||||||
|
@ -2235,6 +2235,18 @@ struct TALER_EXCHANGEDB_Plugin
|
|||||||
struct TALER_EXCHANGEDB_Session *session,
|
struct TALER_EXCHANGEDB_Session *session,
|
||||||
const char *payto_url);
|
const char *payto_url);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mark a merchant as KYC-checked.
|
||||||
|
*
|
||||||
|
* @param payto_url payto:// URL indentifying the merchant
|
||||||
|
* to check. Note, different banks may have different
|
||||||
|
* policies to check their customers.
|
||||||
|
* @return database transaction status.
|
||||||
|
*/
|
||||||
|
enum GNUNET_DB_QueryStatus
|
||||||
|
(*mark_kyc_merchant) (void *cls,
|
||||||
|
struct TALER_EXCHANGEDB_Session *session,
|
||||||
|
const char *payto_url);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user