StartKyc.cs 1.0 KB

1234567891011121314151617181920212223242526272829
  1. using MediatR;
  2. using Web.Api.Common;
  3. using Web.Api.Extensions;
  4. namespace Web.Api.Endpoints.Developers.Profile;
  5. internal sealed class StartKyc : IEndpoint
  6. {
  7. // 본인인증 시작 — Frontend 가 onboarding/kyc 페이지의 "시작" 버튼에서 호출.
  8. // 응답으로 받은 authUrl 을 popup 으로 띄움 → NICE 표준창 → return_url 콜백.
  9. public void MapEndpoint(IEndpointRouteBuilder app)
  10. {
  11. app.MapPost("api/developers/profile/kyc/start", async (
  12. HttpContext httpContext,
  13. ISender sender,
  14. CancellationToken ct
  15. ) => {
  16. var memberID = httpContext.User.GetRequiredMemberID();
  17. var command = new Application.Features.Api.Developers.Profile.StartKyc.Command(memberID);
  18. var result = await sender.Send(command, ct);
  19. return result.Match(
  20. data => ApiResponse.Ok(data),
  21. CustomResults.Problem
  22. );
  23. })
  24. .WithTags("Developers")
  25. .RequireAuthorization();
  26. }
  27. }