diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-10-10 15:37:05 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-10-10 15:37:05 +0200 |
commit | df681b0d9585cbd69f377304643a8877fd4fb00a (patch) | |
tree | 190e1342a8ec8616fe9f2ba3897cd56d2c9a88a1 /src/include | |
parent | c6d077403945da1741096b1ff51b101f529b9905 (diff) | |
download | exchange-df681b0d9585cbd69f377304643a8877fd4fb00a.tar.xz |
-draft API for new /kyc-check endpoint
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_exchange_service.h | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index f95577d0c..ed6f2eb1a 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -1899,6 +1899,110 @@ void TALER_EXCHANGE_recoup_cancel (struct TALER_EXCHANGE_RecoupHandle *ph); +/* ********************* /kyc* *********************** */ + +/** + * Handle for a ``/kyc-check`` operation. + */ +struct TALER_EXCHANGE_KycCheckHandle; + + +/** + * KYC status response details. + */ +struct TALER_EXCHANGE_KycStatus +{ + /** + * HTTP status code returned by the exchange. + */ + unsigned int http_status; + + /** + * Taler error code, if any. + */ + enum TALER_ErrorCode ec; + + union + { + + /** + * KYC is OK, affirmation returned by the exchange. + */ + struct + { + + /** + * Time of the affirmation. + */ + struct GNUNET_TIME_Absolute timestamp; + + /** + * The signing public key used for @e exchange_sig. + */ + struct TALER_ExchangePublicKeyP exchange_pub; + + /** + * Signature of purpose + * #TALER_SIGNATURE_ACCOUNT_SETUP_SUCCESS affirming + * the successful KYC process. + */ + struct TALER_ExchangeSignatureP exchange_sig; + + } kyc_ok; + + /** + * URL the user should open in a browser if + * the KYC process is to be run. Returned if + * @e http_status is #MHD_HTTP_ACCEPTED. + */ + const char *kyc_url; + + } details; + +}; + +/** + * Function called with the result of a KYC check. + * + * @param cls closure + * @param ks the account's KYC status details + */ +typedef void +(*TALER_EXCHANGE_KycStatusCallback)( + void *cls, + const struct TALER_EXCHANGE_KycStatus *ks); + + +/** + * Run interaction with exchange to check KYC status + * of a merchant. + * + * @param eh exchange handle to use + * @param payment_target number identifying the target + * @param h_payto hash of the payto:// URI at @a payment_target + * @param timeout how long to wait for a positive KYC status + * @param cb function to call with the result + * @param cb_cls closure for @a cb + * @return NULL on error + */ +struct TALER_EXCHANGE_KycCheckHandle * +TALER_EXCHANGE_kyc_check (struct TALER_EXCHANGE_Handle *eh, + uint64_t payment_target, + const struct GNUNET_HashCode *h_wire, + struct GNUNET_TIME_Relative timeout, + TALER_EXCHANGE_KycStatusCallback cb, + void *cb_cls); + + +/** + * Cancel KYC check operation. + * + * @param kyc handle for operation to cancel + */ +void +TALER_EXCHANGE_kyc_check_cancel (struct TALER_EXCHANGE_KycCheckHandle *kyc); + + /* ********************* /management *********************** */ |