Skip to content

Commit

Permalink
Merge pull request #1 from GerardGargan/dev
Browse files Browse the repository at this point in the history
Merge dev into master
  • Loading branch information
GerardGargan authored Aug 17, 2024
2 parents 587142f + dc53a5a commit 2c41fac
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Bookstore.Web/Areas/Admin/Controllers/OrderController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public IActionResult Details_PAY_NOW()
OrderVM.OrderHeader = _unitOfWork.OrderHeader.Get(x => x.Id == OrderVM.OrderHeader.Id, includeProperties: "ApplicationUser");
OrderVM.OrderDetail = _unitOfWork.OrderDetail.GetAll(x => x.OrderHeaderId == OrderVM.OrderHeader.Id, includeProperties: "Product");

var domain = "https://localhost:44361/";
var domain = Request.Scheme+Request+"://"+ Request.Host.Value +"/";
var options = new Stripe.Checkout.SessionCreateOptions
{
SuccessUrl = domain + $"admin/order/PaymentConfirmation?orderHeaderId={OrderVM.OrderHeader.Id}",
Expand Down
2 changes: 1 addition & 1 deletion Bookstore.Web/Areas/Customer/Controllers/CartController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public IActionResult SummaryPOST()
if (applicationUser.CompanyId.GetValueOrDefault() == 0)
{
// regular customer, process stripe payment
var domain = "https://localhost:44361/";
var domain = Request.Scheme + Request + "://" + Request.Host.Value + "/";
var options = new Stripe.Checkout.SessionCreateOptions
{
SuccessUrl = domain + $"customer/cart/OrderConfirmation?id={ShoppingCartVM.OrderHeader.Id}",
Expand Down
4 changes: 2 additions & 2 deletions Bookstore.Web/Areas/Customer/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
@foreach(var product in Model)
{
<div class="col-lg-3 col-sm-6">
<div class="row p-2">
<div class="row p-2 h-100">
<div class="col-12 p-1">
<div class="card border-0 p-3 shadow border-top border-5 rounded">
<div class="card h-100 border-0 p-3 shadow border-top border-5 rounded">
@if(string.IsNullOrEmpty(product.ImageUrl))
{
<div style="width: 221px; height: 265px; display: flex; align-items: center; justify-content: center;" class="card-img-top rounded border bg-body-secondary">
Expand Down
2 changes: 2 additions & 0 deletions Bookstore.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

// Add services to the container.
builder.Services.AddControllersWithViews();
builder.Services.AddLocalization();
builder.Services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));
builder.Services.Configure<StripeSettings>(options => builder.Configuration.GetSection("Stripe"));

Expand Down Expand Up @@ -59,6 +60,7 @@

StripeConfiguration.ApiKey = builder.Configuration.GetSection("Stripe:SecretKey").Get<string>();

app.UseRequestLocalization("en-GB");
app.UseAuthentication();
app.UseAuthorization();
app.MapRazorPages();
Expand Down

0 comments on commit 2c41fac

Please sign in to comment.