Hi Guys,
I am trying to change Payment method in API.
Tried:
[Subscribe(Dynamicweb.Notifications.Standard.Page.Loaded)]
public class PageLoaded : NotificationSubscriber
{
public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
{
if (args == null)
return;
Dynamicweb.Notifications.Standard.Page.LoadedArgs loadedArgs = (Dynamicweb.Notifications.Standard.Page.LoadedArgs)args;
Dynamicweb.eCommerce.Common.Context.Cart.PaymentMethodID = "PAY3";
}
}
But getting null-pointer exception as soon as I request PaymentMethodID.
/Dmitrij