Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Changes in structure IPaymentProvider plugins, move away from viewcomponent, now use Controllers

support6f2cd05cebde
diff --git a/src/Business/Grand.Business.Core/Interfaces/Checkout/Payments/IPaymentProvider.cs b/src/Business/Grand.Business.Core/Interfaces/Checkout/Payments/IPaymentProvider.cs
index 0562d628e..9edfe511a 100644
--- a/src/Business/Grand.Business.Core/Interfaces/Checkout/Payments/IPaymentProvider.cs
+++ b/src/Business/Grand.Business.Core/Interfaces/Checkout/Payments/IPaymentProvider.cs
@@ -102,10 +102,9 @@ namespace Grand.Business.Core.Interfaces.Checkout.Payments
Task<PaymentTransaction> SavePaymentInfo(IFormCollection form);
/// <summary>
- /// Gets a view component for displaying plugin in public store ("payment info" checkout step)
+ /// Gets a route url for displaying plugin in public store ("payment info" checkout step)
/// </summary>
- /// <param name="viewComponentName">View component name</param>
- void GetPublicViewComponent(out string viewComponentName);
+ Task<string> GetControllerRouteName();
#endregion
diff --git a/src/Plugins/Payments.BrainTree/Areas/Admin/Controllers/PaymentBrainTreeController.cs b/src/Plugins/Payments.BrainTree/Areas/Admin/Controllers/PaymentBrainTreeController.cs
index be6e8aaed..65d440e88 100644
--- a/src/Plugins/Payments.BrainTree/Areas/Admin/Controllers/PaymentBrainTreeController.cs
+++ b/src/Plugins/Payments.BrainTree/Areas/Admin/Controllers/PaymentBrainTreeController.cs
@@ -7,7 +7,7 @@ using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
using Payments.BrainTree.Models;
-namespace Payments.BrainTree.Controllers
+namespace Payments.BrainTree.Areas.Admin.Controllers
{
[AuthorizeAdmin]
[Area("Admin")]
diff --git a/src/Plugins/Payments.BrainTree/BrainTreePaymentProvider.cs b/src/Plugins/Payments.BrainTree/BrainTreePaymentProvider.cs
index 97d02df3d..89201cc21 100644
--- a/src/Plugins/Payments.BrainTree/BrainTreePaymentProvider.cs
+++ b/src/Plugins/Payments.BrainTree/BrainTreePaymentProvider.cs
@@ -39,10 +39,11 @@ namespace Payments.BrainTree
_brainTreePaymentSettings = brainTreePaymentSettings;
}
- public void GetPublicViewComponent(out string viewComponentName)
+ public Task<string> GetControllerRouteName()
{
- viewComponentName = "PaymentBrainTree";
+ return Task.FromResult("Plugin.PaymentBrainTree");
}
+
/// <summary>
/// Init a process a payment transaction
/// </summary>
diff --git a/src/Plugins/Payments.BrainTree/Components/PaymentBrainTreeViewComponent.cs b/src/Plugins/Payments.BrainTree/Controllers/PaymentBrainTreeController.cs
similarity index 82%
rename from src/Plugins/Payments.BrainTree/Components/PaymentBrainTreeViewComponent.cs
rename to src/Plugins/Payments.BrainTree/Controllers/PaymentBrainTreeController.cs
index d9fb66123..3f7c5ab9e 100644
--- a/src/Plugins/Payments.BrainTree/Components/PaymentBrainTreeViewComponent.cs
+++ b/src/Plugins/Payments.BrainTree/Controllers/PaymentBrainTreeController.cs
@@ -1,19 +1,18 @@
using Braintree;
using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Web.Common.Components;
using Grand.Domain.Orders;
using Grand.Infrastructure;
+using Grand.Web.Common.Controllers;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Payments.BrainTree.Models;
using Payments.BrainTree.Validators;
using System.Net;
-namespace Payments.BrainTree.Components
+namespace Payments.BrainTree.Controllers
{
- [ViewComponent(Name = "PaymentBrainTree")]
- public class PaymentBrainTreeViewComponent : BaseViewComponent
+ public class PaymentBrainTreeController : BasePaymentController
{
private readonly BrainTreePaymentSettings _brainTreePaymentSettings;
private readonly IOrderCalculationService _orderTotalCalculationService;
@@ -21,7 +20,7 @@ namespace Payments.BrainTree.Components
private readonly IWorkContext _workContext;
private readonly ITranslationService _translationService;
- public PaymentBrainTreeViewComponent(BrainTreePaymentSettings brainTreePaymentSettings,
+ public PaymentBrainTreeController(BrainTreePaymentSettings brainTreePaymentSettings,
IOrderCalculationService orderTotalCalculationService,
IShoppingCartService shoppingCartService,
IWorkContext workContext,
@@ -34,7 +33,7 @@ namespace Payments.BrainTree.Components
_translationService = translationService;
}
- public async Task<IViewComponentResult> InvokeAsync()
+ public async Task<IActionResult> PaymentInfo()
{
var model = new PaymentInfoModel();
@@ -51,8 +50,7 @@ namespace Payments.BrainTree.Components
var publicKey = _brainTreePaymentSettings.PublicKey;
var privateKey = _brainTreePaymentSettings.PrivateKey;
- var gateway = new BraintreeGateway
- {
+ var gateway = new BraintreeGateway {
Environment = useSandBox ? Braintree.Environment.SANDBOX : Braintree.Environment.PRODUCTION,
MerchantId = merchantId,
PublicKey = publicKey,
@@ -62,15 +60,14 @@ namespace Payments.BrainTree.Components
ViewBag.ClientToken = gateway.ClientToken.Generate();
ViewBag.OrderTotal = (await _orderTotalCalculationService.GetShoppingCartTotal(cart)).shoppingCartTotal;
- return View(this.GetViewPath("PaymentInfo_3DS"), model);
+ return View("PaymentInfo_3DS", model);
}
//years
for (var i = 0; i < 15; i++)
{
var year = Convert.ToString(DateTime.Now.Year + i);
- model.ExpireYears.Add(new SelectListItem
- {
+ model.ExpireYears.Add(new SelectListItem {
Text = year,
Value = year,
});
@@ -79,9 +76,8 @@ namespace Payments.BrainTree.Components
//months
for (var i = 1; i <= 12; i++)
{
- var text = (i < 10) ? "0" + i : i.ToString();
- model.ExpireMonths.Add(new SelectListItem
- {
+ var text = i < 10 ? "0" + i : i.ToString();
+ model.ExpireMonths.Add(new SelectListItem {
Text = text,
Value = i.ToString(),
});
@@ -89,7 +85,7 @@ namespace Payments.BrainTree.Components
//set postback values (we cannot access "Form" with "GET" requests)
if (Request.Method == WebRequestMethods.Http.Get)
- return View(this.GetViewPath("PaymentInfo"), model);
+ return View("PaymentInfo", model);
var form = await HttpContext.Request.ReadFormAsync();
@@ -114,7 +110,7 @@ namespace Payments.BrainTree.Components
select error.ErrorMessage;
model.Errors = string.Join(", ", query);
}
- return View(this.GetViewPath("PaymentInfo"), model);
+ return View("PaymentInfo", model);
}
}
}
\ No newline at end of file
diff --git a/src/Plugins/Payments.BrainTree/EndpointProvider.cs b/src/Plugins/Payments.BrainTree/EndpointProvider.cs
new file mode 100644
index 000000000..9da4d3db7
--- /dev/null
+++ b/src/Plugins/Payments.BrainTree/EndpointProvider.cs
@@ -0,0 +1,19 @@
+using Grand.Infrastructure.Endpoints;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Routing;
+
+namespace Payments.BrainTree
+{
+ public partial class EndpointProvider : IEndpointProvider
+ {
+ public void RegisterEndpoint(IEndpointRouteBuilder endpointRouteBuilder)
+ {
+ endpointRouteBuilder.MapControllerRoute("Plugin.PaymentBrainTree",
+ "Plugins/PaymentBrainTree/PaymentInfo",
+ new { controller = "PaymentBrainTree", action = "PaymentInfo", area = "" }
+ );
+ }
+ public int Priority => 0;
+
+ }
+}
diff --git a/src/Plugins/Payments.BrainTree/Manifest.cs b/src/Plugins/Payments.BrainTree/Manifest.cs
index b12c86001..80dd923b2 100644
--- a/src/Plugins/Payments.BrainTree/Manifest.cs
+++ b/src/Plugins/Payments.BrainTree/Manifest.cs
@@ -8,5 +8,5 @@ using Payments.BrainTree;
SystemName = BrainTreeDefaults.ProviderSystemName,
SupportedVersion = GrandVersion.SupportedPluginVersion,
Author = "grandnode team",
- Version = "1.00"
+ Version = "1.01"
)]
\ No newline at end of file
diff --git a/src/Plugins/Payments.BrainTree/Views/Shared/Components/PaymentBrainTree/PaymentInfo.cshtml b/src/Plugins/Payments.BrainTree/Views/PaymentBrainTree/PaymentInfo.cshtml
similarity index 100%
rename from src/Plugins/Payments.BrainTree/Views/Shared/Components/PaymentBrainTree/PaymentInfo.cshtml
rename to src/Plugins/Payments.BrainTree/Views/PaymentBrainTree/PaymentInfo.cshtml
diff --git a/src/Plugins/Payments.BrainTree/Views/Shared/Components/PaymentBrainTree/PaymentInfo_3DS.cshtml b/src/Plugins/Payments.BrainTree/Views/PaymentBrainTree/PaymentInfo_3DS.cshtml
similarity index 100%
rename from src/Plugins/Payments.BrainTree/Views/Shared/Components/PaymentBrainTree/PaymentInfo_3DS.cshtml
rename to src/Plugins/Payments.BrainTree/Views/PaymentBrainTree/PaymentInfo_3DS.cshtml
diff --git a/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Controllers/PaymentCashOnDeliveryController.cs b/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Controllers/PaymentCashOnDeliveryController.cs
index 56f639617..9d9b7aac3 100644
--- a/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Controllers/PaymentCashOnDeliveryController.cs
+++ b/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Controllers/PaymentCashOnDeliveryController.cs
@@ -11,7 +11,7 @@ using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
using Payments.CashOnDelivery.Models;
-namespace Payments.CashOnDelivery.Controllers
+namespace Payments.CashOnDelivery.Areas.Admin.Controllers
{
[AuthorizeAdmin]
[Area("Admin")]
diff --git a/src/Plugins/Payments.CashOnDelivery/CashOnDeliveryPaymentProvider.cs b/src/Plugins/Payments.CashOnDelivery/CashOnDeliveryPaymentProvider.cs
index ea8afaa78..c0fdbe1cc 100644
--- a/src/Plugins/Payments.CashOnDelivery/CashOnDeliveryPaymentProvider.cs
+++ b/src/Plugins/Payments.CashOnDelivery/CashOnDeliveryPaymentProvider.cs
@@ -121,9 +121,9 @@ namespace Payments.CashOnDelivery
return await Task.FromResult<PaymentTransaction>(null);
}
- public void GetPublicViewComponent(out string viewComponentName)
+ public Task<string> GetControllerRouteName()
{
- viewComponentName = "PaymentCashOnDelivery";
+ return Task.FromResult("Plugin.PaymentCashOnDelivery");
}
public async Task<CapturePaymentResult> Capture(PaymentTransaction paymentTransaction)
diff --git a/src/Plugins/Payments.CashOnDelivery/Components/PaymentCashOnDeliveryViewComponent.cs b/src/Plugins/Payments.CashOnDelivery/Controllers/PaymentCashOnDeliveryController.cs
similarity index 72%
rename from src/Plugins/Payments.CashOnDelivery/Components/PaymentCashOnDeliveryViewComponent.cs
rename to src/Plugins/Payments.CashOnDelivery/Controllers/PaymentCashOnDeliveryController.cs
index d5a6aafc9..2a7d1993a 100644
--- a/src/Plugins/Payments.CashOnDelivery/Components/PaymentCashOnDeliveryViewComponent.cs
+++ b/src/Plugins/Payments.CashOnDelivery/Controllers/PaymentCashOnDeliveryController.cs
@@ -1,17 +1,17 @@
using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Infrastructure;
-using Grand.Web.Common.Components;
+using Grand.Web.Common.Controllers;
using Microsoft.AspNetCore.Mvc;
using Payments.CashOnDelivery.Models;
-namespace Payments.CashOnDelivery.Components
+namespace Payments.CashOnDelivery.Controllers
{
- public class PaymentCashOnDeliveryViewComponent : BaseViewComponent
+ public class PaymentCashOnDeliveryController : BasePaymentController
{
private readonly IWorkContext _workContext;
private readonly ISettingService _settingService;
- public PaymentCashOnDeliveryViewComponent(
+ public PaymentCashOnDeliveryController(
IWorkContext workContext,
ISettingService settingService)
{
@@ -19,14 +19,15 @@ namespace Payments.CashOnDelivery.Components
_settingService = settingService;
}
- public IViewComponentResult Invoke()
+ public IActionResult PaymentInfo()
{
var cashOnDeliveryPaymentSettings = _settingService.LoadSetting<CashOnDeliveryPaymentSettings>(_workContext.CurrentStore.Id);
var model = new PaymentInfoModel {
DescriptionText = cashOnDeliveryPaymentSettings.DescriptionText
};
- return View(this.GetViewPath(), model);
+
+ return View(model);
}
}
}
\ No newline at end of file
diff --git a/src/Plugins/Payments.CashOnDelivery/EndpointProvider.cs b/src/Plugins/Payments.CashOnDelivery/EndpointProvider.cs
new file mode 100644
index 000000000..e7968d4e1
--- /dev/null
+++ b/src/Plugins/Payments.CashOnDelivery/EndpointProvider.cs
@@ -0,0 +1,19 @@
+using Grand.Infrastructure.Endpoints;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Routing;
+
+namespace Payments.CashOnDelivery
+{
+ public partial class EndpointProvider : IEndpointProvider
+ {
+ public void RegisterEndpoint(IEndpointRouteBuilder endpointRouteBuilder)
+ {
+ endpointRouteBuilder.MapControllerRoute("Plugin.PaymentCashOnDelivery",
+ "Plugins/PaymentCashOnDelivery/PaymentInfo",
+ new { controller = "PaymentCashOnDelivery", action = "PaymentInfo", area = "" }
+ );
+ }
+ public int Priority => 0;
+
+ }
+}
diff --git a/src/Plugins/Payments.CashOnDelivery/Manifest.cs b/src/Plugins/Payments.CashOnDelivery/Manifest.cs
index 0e8fbc9c9..ae4cdc3ec 100644
--- a/src/Plugins/Payments.CashOnDelivery/Manifest.cs
+++ b/src/Plugins/Payments.CashOnDelivery/Manifest.cs
@@ -8,5 +8,5 @@ using Payments.CashOnDelivery;
SystemName = CashOnDeliveryPaymentDefaults.ProviderSystemName,
SupportedVersion = GrandVersion.SupportedPluginVersion,
Author = "grandnode team",
- Version = "1.01"
+ Version = "1.02"
)]
\ No newline at end of file
diff --git a/src/Plugins/Payments.CashOnDelivery/Views/Shared/Components/PaymentCashOnDelivery/Default.cshtml b/src/Plugins/Payments.CashOnDelivery/Views/PaymentCashOnDelivery/PaymentInfo.cshtml
similarity index 100%
rename from src/Plugins/Payments.CashOnDelivery/Views/Shared/Components/PaymentCashOnDelivery/Default.cshtml
rename to src/Plugins/Payments.CashOnDelivery/Views/PaymentCashOnDelivery/PaymentInfo.cshtml
diff --git a/src/Plugins/Payments.PayPalStandard/Areas/Admin/Controllers/PayPalStandardController.cs b/src/Plugins/Payments.PayPalStandard/Areas/Admin/Controllers/PayPalStandardController.cs
index e165738e0..e881331eb 100644
--- a/src/Plugins/Payments.PayPalStandard/Areas/Admin/Controllers/PayPalStandardController.cs
+++ b/src/Plugins/Payments.PayPalStandard/Areas/Admin/Controllers/PayPalStandardController.cs
@@ -12,7 +12,7 @@ using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
using Payments.PayPalStandard.Models;
-namespace Payments.PayPalStandard.Controllers
+namespace Payments.PayPalStandard.Areas.Admin.Controllers
{
[AuthorizeAdmin]
[Area("Admin")]
diff --git a/src/Plugins/Payments.PayPalStandard/Components/PaymentPayPalStandardViewComponent.cs b/src/Plugins/Payments.PayPalStandard/Components/PaymentPayPalStandardViewComponent.cs
deleted file mode 100644
index 4e9150536..000000000
--- a/src/Plugins/Payments.PayPalStandard/Components/PaymentPayPalStandardViewComponent.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using Grand.Web.Common.Components;
-using Microsoft.AspNetCore.Mvc;
-
-namespace Payments.PayPalStandard.Controllers
-{
- [ViewComponent(Name = "PaymentPayPalStandard")]
- public class PaymentPayPalStandardViewComponent : BaseViewComponent
- {
- public IViewComponentResult Invoke()
- {
- return View(this.GetViewPath());
- }
- }
-}
\ No newline at end of file
diff --git a/src/Plugins/Payments.PayPalStandard/Controllers/PaymentPayPalStandardController.cs b/src/Plugins/Payments.PayPalStandard/Controllers/PaymentPayPalStandardController.cs
index 0762b221c..5287d3ae1 100644
--- a/src/Plugins/Payments.PayPalStandard/Controllers/PaymentPayPalStandardController.cs
+++ b/src/Plugins/Payments.PayPalStandard/Controllers/PaymentPayPalStandardController.cs
@@ -392,5 +392,10 @@ namespace Payments.PayPalStandard.Controllers
return RedirectToRoute("HomePage");
}
+
+ public IActionResult PaymentInfo()
+ {
+ return View();
+ }
}
}
\ No newline at end of file
diff --git a/src/Plugins/Payments.PayPalStandard/EndpointProvider.cs b/src/Plugins/Payments.PayPalStandard/EndpointProvider.cs
index 74b4de95a..bbc0cb5a8 100644
--- a/src/Plugins/Payments.PayPalStandard/EndpointProvider.cs
+++ b/src/Plugins/Payments.PayPalStandard/EndpointProvider.cs
@@ -8,6 +8,12 @@ namespace Payments.PayPalStandard
{
public void RegisterEndpoint(IEndpointRouteBuilder endpointRouteBuilder)
{
+ //PaymentInfo
+ endpointRouteBuilder.MapControllerRoute("Plugin.PayPalStandard",
+ "Plugins/PaymentPayPalStandard/PaymentInfo",
+ new { controller = "PaymentPayPalStandard", action = "PaymentInfo", area = "" }
+ );
+
//PDT
endpointRouteBuilder.MapControllerRoute("Plugin.Payments.PayPalStandard.PDTHandler",
"Plugins/PaymentPayPalStandard/PDTHandler",
diff --git a/src/Plugins/Payments.PayPalStandard/PayPalStandardPaymentProvider.cs b/src/Plugins/Payments.PayPalStandard/PayPalStandardPaymentProvider.cs
index cce9eacca..0e56a7931 100644
--- a/src/Plugins/Payments.PayPalStandard/PayPalStandardPaymentProvider.cs
+++ b/src/Plugins/Payments.PayPalStandard/PayPalStandardPaymentProvider.cs
@@ -533,9 +533,9 @@ namespace Payments.PayPalStandard
return await Task.FromResult(_translationService.GetResource("Plugins.Payments.PayPalStandard.PaymentMethodDescription"));
}
- public void GetPublicViewComponent(out string viewComponentName)
+ public Task<string> GetControllerRouteName()
{
- viewComponentName = "PaymentPayPalStandard";
+ return Task.FromResult("Plugin.PayPalStandard");
}
public string LogoURL => "/Plugins/Payments.PayPalStandard/logo.jpg";
diff --git a/src/Plugins/Payments.PayPalStandard/Views/Shared/Components/PaymentPayPalStandard/Default.cshtml b/src/Plugins/Payments.PayPalStandard/Views/PaymentPayPalStandard/PaymentInfo.cshtml
similarity index 100%
rename from src/Plugins/Payments.PayPalStandard/Views/Shared/Components/PaymentPayPalStandard/Default.cshtml
rename to src/Plugins/Payments.PayPalStandard/Views/PaymentPayPalStandard/PaymentInfo.cshtml
diff --git a/src/Web/Grand.Web/Features/Handlers/Checkout/GetPaymentInfoHandler.cs b/src/Web/Grand.Web/Features/Handlers/Checkout/GetPaymentInfoHandler.cs
index c7d6686ae..d9b94c59f 100644
--- a/src/Web/Grand.Web/Features/Handlers/Checkout/GetPaymentInfoHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Checkout/GetPaymentInfoHandler.cs
@@ -1,19 +1,27 @@
using Grand.Web.Features.Models.Checkout;
using Grand.Web.Models.Checkout;
using MediatR;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Routing;
namespace Grand.Web.Features.Handlers.Checkout
{
public class GetPaymentInfoHandler : IRequestHandler<GetPaymentInfo, CheckoutPaymentInfoModel>
{
+ private readonly LinkGenerator _linkGenerator;
+ private readonly IHttpContextAccessor _httpContextAccessor;
- public async Task<CheckoutPaymentInfoModel> Handle(GetPaymentInfo request, CancellationToken cancellationToken)
+ public GetPaymentInfoHandler(LinkGenerator linkGenerator, IHttpContextAccessor httpContextAccessor)
{
- request.PaymentMethod.GetPublicViewComponent(out string viewComponentName);
+ _linkGenerator = linkGenerator;
+ _httpContextAccessor = httpContextAccessor;
+ }
- var model = new CheckoutPaymentInfoModel
- {
- PaymentViewComponentName = viewComponentName,
+ public async Task<CheckoutPaymentInfoModel> Handle(GetPaymentInfo request, CancellationToken cancellationToken)
+ {
+ var url = _linkGenerator.GetUriByRouteValues(_httpContextAccessor.HttpContext, routeName: await request.PaymentMethod.GetControllerRouteName(), values: null);
+ var model = new CheckoutPaymentInfoModel {
+ PaymentUrl = url,
};
return await Task.FromResult(model);
}
diff --git a/src/Web/Grand.Web/Models/Checkout/CheckoutPaymentInfoModel.cs b/src/Web/Grand.Web/Models/Checkout/CheckoutPaymentInfoModel.cs
index a3aefe2e3..b775057b3 100644
--- a/src/Web/Grand.Web/Models/Checkout/CheckoutPaymentInfoModel.cs
+++ b/src/Web/Grand.Web/Models/Checkout/CheckoutPaymentInfoModel.cs
@@ -4,6 +4,6 @@ namespace Grand.Web.Models.Checkout
{
public partial class CheckoutPaymentInfoModel : BaseModel
{
- public string PaymentViewComponentName { get; set; }
+ public string PaymentUrl { get; set; }
}
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/wwwroot/theme/script/public.checkout.js b/src/Web/Grand.Web/wwwroot/theme/script/public.checkout.js
index b70654459..c4bb1d600 100644
--- a/src/Web/Grand.Web/wwwroot/theme/script/public.checkout.js
+++ b/src/Web/Grand.Web/wwwroot/theme/script/public.checkout.js
@@ -35,7 +35,7 @@ var vmorder = new Vue({
LoyaltyPointsEnoughToPayForOrder: null,
UseLoyaltyPoints: null,
// payment info
- PaymentViewComponentName: null,
+ PaymentUrl: null,
// confirm order
OrderReviewData: null,
MinOrderTotalWarning: null,
@@ -239,13 +239,13 @@ var vmorder = new Vue({
}
if (response.data.goto_section == "payment_info") {
var model = response.data.update_section.model;
- vmorder.PaymentViewComponentName = model.PaymentViewComponentName;
+ vmorder.PaymentUrl = model.PaymentUrl;
vmorder.PaymentInfo = true;
vmorder.paymentBusy = true;
vmorder.validPayment = true;
document.querySelector(".payment-info-next-step-button").classList.add("disabled");
axios({
- baseURL: '/Component/Index?Name=' + model.PaymentViewComponentName,
+ baseURL: model.PaymentUrl,
method: 'get',
data: null,
headers: {
@@ -658,11 +658,11 @@ var vmorder = new Vue({
}
if (response.data.update_section !== undefined && response.data.update_section.name == 'payment-info') {
var model = response.data.update_section.model;
- vm.PaymentViewComponentName = model.PaymentViewComponentName,
+ vm.PaymentUrl = model.PaymentUrl,
vm.PaymentInfo = true;
axios({
- baseURL: '/Component/Form?Name=' + model.PaymentViewComponentName,
+ baseURL: model.PaymentUrl,
method: 'post',
data: data,
showLoader: false