| 1234567891011121314151617181920212223242526272829 |
- using MediatR;
- using Web.Api.Common;
- using Web.Api.Extensions;
- namespace Web.Api.Endpoints.Developers.Profile;
- internal sealed class StartKyc : IEndpoint
- {
- // 본인인증 시작 — Frontend 가 onboarding/kyc 페이지의 "시작" 버튼에서 호출.
- // 응답으로 받은 authUrl 을 popup 으로 띄움 → NICE 표준창 → return_url 콜백.
- public void MapEndpoint(IEndpointRouteBuilder app)
- {
- app.MapPost("api/developers/profile/kyc/start", async (
- HttpContext httpContext,
- ISender sender,
- CancellationToken ct
- ) => {
- var memberID = httpContext.User.GetRequiredMemberID();
- var command = new Application.Features.Api.Developers.Profile.StartKyc.Command(memberID);
- var result = await sender.Send(command, ct);
- return result.Match(
- data => ApiResponse.Ok(data),
- CustomResults.Problem
- );
- })
- .WithTags("Developers")
- .RequireAuthorization();
- }
- }
|