From 121bfe3659c988f0aab070b3ae291b7b6f13f8f7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 7 Nov 2021 13:05:33 +0100 Subject: implement /kyc-proof client API --- src/include/taler_exchange_service.h | 82 ++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) (limited to 'src/include') diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index 361956cbe..54fca65cb 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -2160,6 +2160,88 @@ void TALER_EXCHANGE_kyc_check_cancel (struct TALER_EXCHANGE_KycCheckHandle *kyc); +/** + * KYC proof response details. + */ +struct TALER_EXCHANGE_KycProofResponse +{ + /** + * 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 + { + + /** + * Where to redirect the client next. + */ + const char *redirect_url; + + } found; + + } 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_KycProofCallback)( + void *cls, + const struct TALER_EXCHANGE_KycProofResponse *kpr); + + +/** + * Handle for a /kyc-proof operation. + */ +struct TALER_EXCHANGE_KycProofHandle; + + +/** + * Run interaction with exchange to provide proof of KYC status. + * + * @param eh exchange handle to use + * @param payment_target number identifying the target + * @param code OAuth 2.0 code argument + * @param state OAuth 2.0 state argument + * @param cb function to call with the result + * @param cb_cls closure for @a cb + * @return NULL on error + */ +struct TALER_EXCHANGE_KycProofHandle * +TALER_EXCHANGE_kyc_proof (struct TALER_EXCHANGE_Handle *eh, + uint64_t payment_target, + const char *code, + const char *state, + TALER_EXCHANGE_KycProofCallback cb, + void *cb_cls); + + +/** + * Cancel KYC proof operation. + * + * @param kph handle for operation to cancel + */ +void +TALER_EXCHANGE_kyc_proof_cancel (struct TALER_EXCHANGE_KycProofHandle *kph); + + /** * Handle for a ``/kyc-wallet`` operation. */ -- cgit v1.2.3