simplify deposit, do not return kyc status, not needed

This commit is contained in:
Christian Grothoff 2021-10-20 18:56:59 +02:00
parent c353cabe07
commit 9adb9cfe61
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
5 changed files with 4 additions and 76 deletions

View File

@ -45,7 +45,6 @@
* operation with the given wiring details. * operation with the given wiring details.
* *
* @param connection connection to the client * @param connection connection to the client
* @param kyc KYC status for the credited account
* @param coin_pub public key of the coin * @param coin_pub public key of the coin
* @param h_wire hash of wire details * @param h_wire hash of wire details
* @param h_contract_terms hash of contract details * @param h_contract_terms hash of contract details
@ -57,7 +56,6 @@
*/ */
static MHD_RESULT static MHD_RESULT
reply_deposit_success (struct MHD_Connection *connection, reply_deposit_success (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_KycStatus *kyc,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct GNUNET_HashCode *h_wire, const struct GNUNET_HashCode *h_wire,
const struct GNUNET_HashCode *h_contract_terms, const struct GNUNET_HashCode *h_contract_terms,
@ -94,10 +92,6 @@ reply_deposit_success (struct MHD_Connection *connection,
return TALER_MHD_REPLY_JSON_PACK ( return TALER_MHD_REPLY_JSON_PACK (
connection, connection,
MHD_HTTP_OK, MHD_HTTP_OK,
GNUNET_JSON_pack_uint64 ("payment_target_uuid",
kyc->payment_target_uuid),
GNUNET_JSON_pack_bool ("kyc_ok",
kyc->ok),
GNUNET_JSON_pack_time_abs ("exchange_timestamp", GNUNET_JSON_pack_time_abs ("exchange_timestamp",
exchange_timestamp), exchange_timestamp),
GNUNET_JSON_pack_data_auto ("exchange_sig", GNUNET_JSON_pack_data_auto ("exchange_sig",
@ -127,11 +121,6 @@ struct DepositContext
*/ */
struct TALER_Amount value; struct TALER_Amount value;
/**
* KYC status for the receiving account.
*/
struct TALER_EXCHANGEDB_KycStatus kyc;
/** /**
* payto:// URI of the credited account. * payto:// URI of the credited account.
*/ */
@ -161,21 +150,6 @@ deposit_precheck (void *cls,
struct TALER_Amount deposit_fee; struct TALER_Amount deposit_fee;
enum GNUNET_DB_QueryStatus qs; enum GNUNET_DB_QueryStatus qs;
qs = TEH_plugin->get_kyc_status (TEH_plugin->cls,
dc->payto_uri,
&dc->kyc);
if (qs < 0)
{
if (GNUNET_DB_STATUS_HARD_ERROR == qs)
{
*mhd_ret = TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_GENERIC_DB_FETCH_FAILED,
"get_kyc_status");
return GNUNET_DB_STATUS_HARD_ERROR;
}
return qs;
}
qs = TEH_plugin->have_deposit (TEH_plugin->cls, qs = TEH_plugin->have_deposit (TEH_plugin->cls,
deposit, deposit,
GNUNET_YES /* check refund deadline */, GNUNET_YES /* check refund deadline */,
@ -204,7 +178,6 @@ deposit_precheck (void *cls,
&deposit->amount_with_fee, &deposit->amount_with_fee,
&deposit_fee)); &deposit_fee));
*mhd_ret = reply_deposit_success (connection, *mhd_ret = reply_deposit_success (connection,
&dc->kyc,
&deposit->coin.coin_pub, &deposit->coin.coin_pub,
&deposit->h_wire, &deposit->h_wire,
&deposit->h_contract_terms, &deposit->h_contract_terms,
@ -637,7 +610,6 @@ TEH_handler_deposit (struct MHD_Connection *connection,
&deposit.amount_with_fee, &deposit.amount_with_fee,
&deposit.deposit_fee)); &deposit.deposit_fee));
res = reply_deposit_success (connection, res = reply_deposit_success (connection,
&dc.kyc,
&deposit.coin.coin_pub, &deposit.coin.coin_pub,
&deposit.h_wire, &deposit.h_wire,
&deposit.h_contract_terms, &deposit.h_contract_terms,

View File

@ -840,11 +840,6 @@ struct TALER_EXCHANGE_DepositResult
*/ */
const char *transaction_base_url; const char *transaction_base_url;
/**
* Payment target that the merchant should use
* to check for its KYC status.
*/
uint64_t payment_target_uuid;
} success; } success;
/** /**

View File

@ -503,7 +503,7 @@ TALER_JSON_get_error_code2 (const void *data,
* @param[out] hc set to the hash * @param[out] hc set to the hash
* @return #GNUNET_OK on success, #GNUNET_SYSERR if @a wire_s is malformed * @return #GNUNET_OK on success, #GNUNET_SYSERR if @a wire_s is malformed
*/ */
int enum GNUNET_GenericReturnValue
TALER_JSON_merchant_wire_signature_hash (const json_t *wire_s, TALER_JSON_merchant_wire_signature_hash (const json_t *wire_s,
struct GNUNET_HashCode *hc); struct GNUNET_HashCode *hc);
@ -516,7 +516,7 @@ TALER_JSON_merchant_wire_signature_hash (const json_t *wire_s,
* @param master_pub master public key of the exchange * @param master_pub master public key of the exchange
* @return #GNUNET_OK if signature is valid * @return #GNUNET_OK if signature is valid
*/ */
int enum GNUNET_GenericReturnValue
TALER_JSON_exchange_wire_signature_check ( TALER_JSON_exchange_wire_signature_check (
const json_t *wire_s, const json_t *wire_s,
const struct TALER_MasterPublicKeyP *master_pub); const struct TALER_MasterPublicKeyP *master_pub);

View File

@ -24,15 +24,7 @@
#include "taler_json_lib.h" #include "taler_json_lib.h"
/** enum GNUNET_GenericReturnValue
* Compute the hash of the given wire details. The resulting
* hash is what is put into the contract.
*
* @param wire_s wire details to hash
* @param[out] hc set to the hash
* @return #GNUNET_OK on success, #GNUNET_SYSERR if @a wire_s is malformed
*/
int
TALER_JSON_merchant_wire_signature_hash (const json_t *wire_s, TALER_JSON_merchant_wire_signature_hash (const json_t *wire_s,
struct GNUNET_HashCode *hc) struct GNUNET_HashCode *hc)
{ {
@ -78,15 +70,7 @@ TALER_JSON_merchant_wire_signature_hash (const json_t *wire_s,
} }
/** enum GNUNET_GenericReturnValue
* Check the signature in @a wire_s. Also performs rudimentary
* checks on the account data *if* supported.
*
* @param wire_s signed wire information of an exchange
* @param master_pub master public key of the exchange
* @return #GNUNET_OK if signature is valid
*/
int
TALER_JSON_exchange_wire_signature_check ( TALER_JSON_exchange_wire_signature_check (
const json_t *wire_s, const json_t *wire_s,
const struct TALER_MasterPublicKeyP *master_pub) const struct TALER_MasterPublicKeyP *master_pub)
@ -131,13 +115,6 @@ TALER_JSON_exchange_wire_signature_check (
} }
/**
* Create a signed wire statement for the given account.
*
* @param payto_uri account specification
* @param master_priv private key to sign with
* @return NULL if @a payto_uri is malformed
*/
json_t * json_t *
TALER_JSON_exchange_wire_signature_make ( TALER_JSON_exchange_wire_signature_make (
const char *payto_uri, const char *payto_uri,
@ -167,13 +144,6 @@ TALER_JSON_exchange_wire_signature_make (
} }
/**
* Obtain the wire method associated with the given
* wire account details. @a wire_s must contain a payto://-URL
* under 'payto_uri'.
*
* @return NULL on error
*/
char * char *
TALER_JSON_wire_to_payto (const json_t *wire_s) TALER_JSON_wire_to_payto (const json_t *wire_s)
{ {
@ -204,13 +174,6 @@ TALER_JSON_wire_to_payto (const json_t *wire_s)
} }
/**
* Obtain the wire method associated with the given
* wire account details. @a wire_s must contain a payto://-URL
* under 'url'.
*
* @return NULL on error
*/
char * char *
TALER_JSON_wire_to_method (const json_t *wire_s) TALER_JSON_wire_to_method (const json_t *wire_s)
{ {

View File

@ -283,8 +283,6 @@ handle_deposit_finished (void *cls,
&dh->exchange_sig), &dh->exchange_sig),
GNUNET_JSON_spec_fixed_auto ("exchange_pub", GNUNET_JSON_spec_fixed_auto ("exchange_pub",
&dh->exchange_pub), &dh->exchange_pub),
GNUNET_JSON_spec_uint64 ("payment_target_uuid",
&dr.details.success.payment_target_uuid),
GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("transaction_base_url", GNUNET_JSON_spec_string ("transaction_base_url",
&dr.details.success.transaction_base_url)), &dr.details.success.transaction_base_url)),