i have implement all method for custome payment method , upload dll file to bin folder and check payment method in admin panel . paymet method appear in chekcout page but no one of my custom payment doesnt run . is there any full source of custom payment method in hotcakecommerce? workfolw :
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";
}
}
doesnt redirect to google.com
--Add New why this code has not been overriden:
namespace MyCompany.MyPaymentMethod
{
public class MyCustomWorkflowFactory : WorkflowFactory
{
protected override Task[] LoadThirdPartyCheckoutSelectedTasks()
{
return new Task[]
{
new StartMyPaymentMethodCheckout()
};
}
}
}
i have checked both inheritance public class MyCustomWorkflowFactory : WorkflowFactory
and public class MyCustomWorkflowFactory : dnnWorkflowFactory
but none of them overiden on protected virtual Task[] LoadThirdPartyCheckoutSelectedTasks()
, problem is there , I think !