我正在为 Nopcommerce 网站开发自定义支付方式插件。这是支付处理器类代码:
public class CODBookingPaymentProcessor : BasePlugin, IPaymentMethod
{
private IShoppingCartService _shoppingCartService;
private IOrderService _orderService;
private IHttpContextAccessor _httpContextAccessor;
#region Ctor
public CODBookingPaymentProcessor(IShoppingCartService shoppingCartService,
IOrderService orderService, IHttpContextAccessor httpContextAccessor)
{
this._shoppingCartService = shoppingCartService;
this._orderService = orderService;
this._httpContextAccessor = httpContextAccessor;
}
#endregion
~~~~~~~~~~~~~~~~ SOME CODE ~~~~~~~~~~~~~~~~~~~~~
public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{
// some code
string url = protocol + host + "/" + "PaymentCODBooking/ProcessInternetPayment";
_httpContextAccessor.HttpContext.Response.Redirect(url);
}
断点出现在最后一行并且url正确形成。但是页面没有重定向到url在CONFIRM结帐页面上单击按钮的时间。它只是停留在页面上或有时会清空购物车。这意味着正在创建订单而不去支付网关。
喵喔喔
撒科打诨
慕哥6287543
大话西游666
相关分类