#27 get last receipt, get minimalUser, get my user

This commit is contained in:
Dominic Villemure
2024-05-12 16:40:24 -04:00
parent 3f20563850
commit 5161e3a91a
17 changed files with 216 additions and 24 deletions

View File

@@ -9,7 +9,6 @@ namespace Hutopy.Infrastructure.Stripe;
public class StripeService : IStripeService
{
const string EndpointSecret = "";
private readonly IHttpContextAccessor _httpContextAccessor;
public StripeService(IHttpContextAccessor httpContextAccessor)
@@ -18,7 +17,7 @@ public class StripeService : IStripeService
StripeConfiguration.ApiKey = "";
}
public async Task<string> CreateCheckoutSession(int amount, string currency = "cad")
public async Task<string> CreateCheckoutSession(int amount, string creatorId, string currency = "cad")
{
var options = new SessionCreateOptions
{
@@ -38,7 +37,9 @@ public class StripeService : IStripeService
],
Mode = "payment",
UiMode = "embedded",
ReturnUrl = "https://hutopy.ca/paymentcompleted",
ReturnUrl = $"https://hutopy.ca/paymentcompleted?creatorId={creatorId}",
InvoiceCreation = new SessionInvoiceCreationOptions(){ Enabled = true},
ClientReferenceId = creatorId
};
var service = new SessionService();
@@ -57,7 +58,6 @@ public class StripeService : IStripeService
}
return new Result(false, new List<string>());
}
catch (StripeException e)
{