Merged PR 79: config for stripe api key
config for stripe api key
This commit is contained in:
@@ -4,6 +4,7 @@ using Hutopy.Application.Common.Interfaces;
|
|||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Hutopy.Application.Common.Models;
|
using Hutopy.Application.Common.Models;
|
||||||
using Hutopy.Application.Stripe.Commands;
|
using Hutopy.Application.Stripe.Commands;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
|
||||||
namespace Hutopy.Infrastructure.Stripe;
|
namespace Hutopy.Infrastructure.Stripe;
|
||||||
|
|
||||||
@@ -11,10 +12,11 @@ public class StripeService : IStripeService
|
|||||||
{
|
{
|
||||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
|
||||||
public StripeService(IHttpContextAccessor httpContextAccessor)
|
public StripeService(IHttpContextAccessor httpContextAccessor, IConfiguration configuration)
|
||||||
{
|
{
|
||||||
_httpContextAccessor = httpContextAccessor;
|
_httpContextAccessor = httpContextAccessor;
|
||||||
StripeConfiguration.ApiKey = "";
|
var stripeKey = configuration["STRIPE-API-KEY"] ?? "";
|
||||||
|
StripeConfiguration.ApiKey = stripeKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<string> CreateCheckoutSession(int amount, string creatorId, string currency = "cad")
|
public async Task<string> CreateCheckoutSession(int amount, string creatorId, string currency = "cad")
|
||||||
|
|||||||
Reference in New Issue
Block a user