ClientConfig.cs 645 B

12345678910111213141516171819
  1. using Web.Api.Common;
  2. using Application.Abstractions.Payment;
  3. namespace Web.Api.Endpoints.Payment;
  4. /// <summary>프론트엔드용 다날 클라이언트 설정</summary>
  5. internal sealed class ClientConfig : IEndpoint
  6. {
  7. public void MapEndpoint(IEndpointRouteBuilder app)
  8. {
  9. /// ClientKey, MerchantID 반환 (결제창 호출 시 필요)
  10. app.MapGet("api/payment/config", async (IDanalPayService danalPay, CancellationToken ct) => {
  11. var config = await danalPay.GetClientConfigAsync(ct);
  12. return ApiResponse.Ok(config);
  13. })
  14. .WithTags("Payment")
  15. .RequireAuthorization();
  16. }
  17. }