#27 small changes for the userTransaction
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
using Stripe;
|
||||
using Stripe.Checkout;
|
||||
using Hutopy.Application.Common.Interfaces;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Hutopy.Infrastructure.Stripe;
|
||||
|
||||
public class StripeService : IStripeService
|
||||
{
|
||||
public StripeService(IConfiguration configuration)
|
||||
public StripeService()
|
||||
{
|
||||
StripeConfiguration.ApiKey = configuration["STRIPE_API_KEY"];
|
||||
StripeConfiguration.ApiKey = "";
|
||||
}
|
||||
|
||||
public async Task<string> CreateCheckoutSession(int price, string currency = "cad")
|
||||
public async Task<string> CreateCheckoutSession(int amount, string currency = "cad")
|
||||
{
|
||||
var options = new SessionCreateOptions
|
||||
{
|
||||
@@ -22,7 +21,7 @@ public class StripeService : IStripeService
|
||||
{
|
||||
PriceData = new SessionLineItemPriceDataOptions
|
||||
{
|
||||
UnitAmount = price,
|
||||
UnitAmount = amount,
|
||||
Currency = currency,
|
||||
ProductData = new SessionLineItemPriceDataProductDataOptions { Name = "Tip", },
|
||||
},
|
||||
@@ -32,7 +31,7 @@ public class StripeService : IStripeService
|
||||
],
|
||||
Mode = "payment",
|
||||
UiMode = "embedded",
|
||||
ReturnUrl = $"https://zealous-bay-08204590f.5.azurestaticapps.net/paymentcompleted",
|
||||
ReturnUrl = "https://zealous-bay-08204590f.5.azurestaticapps.net/paymentcompleted",
|
||||
};
|
||||
|
||||
var service = new SessionService();
|
||||
|
||||
Reference in New Issue
Block a user