gpt4 book ai didi

asp.net - hotcake commerce 自定义付款方式不起作用

转载 作者:行者123 更新时间:2023-12-02 16:11:12 34 4
gpt4 key购买 nike

我已经实现了客户付款方式的所有方法,将 dll 文件上传到 bin 文件夹并在管理面板中检查付款方式。 paymet 方法出现在 chekcout 页面中,但我的自定义付款没有一个不运行。 hotcakecommerce 中有完整的自定义付款方式来源吗?工作流程:

public class StartMyPaymentMethodCheckout : ThirdPartyCheckoutOrderTask
{
public override string PaymentMethodId
{
get { return MyPaymentMethod.Id(); }
}

public override bool ProcessCheckout(OrderTaskContext context)
{

if (context.HccApp.CurrentRequestContext.RoutingContext.HttpContext != null)
{
try
{
MyPaymentMethodSettings settings = new MyPaymentMethodSettings();
var methodSettings = context.HccApp.CurrentStore.Settings.MethodSettingsGet(PaymentMethodId);
settings.Merge(methodSettings);

// Here you can do custom processing of your payment.

// It can be direct post to payment service or redirection to hosted payment page
// In either case you have to end up on HccUrlBuilder.RouteHccUrl(HccRoute.ThirdPartyPayment) page
// So either you have to do such redirect here on your own
// or make sure that third party hosted pay page will make it in case of successfull or failed payment

HttpContextBase httpContext = new HccHttpContextWrapper(HttpContext.Current);
httpContext.Response.Redirect("http://www.google.com");
}
catch (Exception ex)
{
EventLog.LogEvent("My Custom Checkout", "Exception occurred during call to Moneris: " + ex.ToString(), EventLogSeverity.Error);
context.Errors.Add(new WorkflowMessage("My Custom Checkout Error", GlobalLocalization.GetString("MonerisCheckoutError"), true));
return false;
}
}

return false;
}

public override bool Rollback(OrderTaskContext context)
{
return true;
}

public override Task Clone()
{
return new StartMyPaymentMethodCheckout();
}

public override string TaskId()
{
return "E9B1A204-7C61-4664-A043-81BF43E24251";
}

public override string TaskName()
{
return "Start My ckout";
}
}

不重定向到 google.com

--添加新内容为什么这段代码没有被覆盖:

namespace MyCompany.MyPaymentMethod
{
public class MyCustomWorkflowFactory : WorkflowFactory
{
protected override Task[] LoadThirdPartyCheckoutSelectedTasks()
{
return new Task[]
{
new StartMyPaymentMethodCheckout()
};
}
}
}

我已经检查了继承public class MyCustomWorkflowFactory:WorkflowFactorypublic class MyCustomWorkflowFactory:dnnWorkflowFactory,但它们都没有覆盖protected virtual Task[] LoadThirdPartyCheckoutSelectedTasks() ,我认为问题就在那里!

最佳答案

好问题...一般来说,如果您的断点没有被命中,那是因为您尚未在“管理”>“扩展性”区域中选择它,您的代码尚未部署到您正在测试的位置,或者您的代码不遵循规定的模式 ( all noted in the documentation )。

enter image description here

哦,请务必确保您的 web.config 文件设置为允许这样的调试。

<compilation debug="true" strict="false" targetFramework="4.0">

关于asp.net - hotcake commerce 自定义付款方式不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35813852/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com