Hello,
I'm trying to create a new GatewayProvider but I get an error when saving a configuration for it on the order payments eCommerce settings. I even removed all the parameters but it stays the same.
[AddInName("Gateway PagSeguro v2.1")]
[AddInDescription("Gateway PagSeguro")]
[AddInActive(true)]
public class PagSeguroGateway : GatewayProvider, IDropDownOptions
{
[AddInParameter("Script Url"), AddInParameterEditor(typeof(Dynamicweb.Extensibility.Editors.TextParameterEditor), "")]
public string ScriptUrlParameter { get; set; }
[AddInParameter("Credential Email"), AddInParameterEditor(typeof(Dynamicweb.Extensibility.Editors.TextParameterEditor), "")]
public string CredentialEmailParameter { get; set; }
[AddInParameter("Credential Token"), AddInParameterEditor(typeof(Dynamicweb.Extensibility.Editors.TextParameterEditor), "")]
public string CredentialTokenParameter { get; set; }
[AddInParameter("Shipping Type"), AddInParameterEditor(typeof(Dynamicweb.Extensibility.Editors.DropDownParameterEditor), "")]
public string ShippingTypeParameter { get; set; }
[AddInParameter("Payed Status Id"), AddInParameterEditor(typeof(Dynamicweb.Extensibility.Editors.DropDownParameterEditor), "")]
public string PayedStatusIdParameter { get; set; }
[AddInParameter("Send Redir Request"), AddInParameterEditor(typeof(Dynamicweb.Extensibility.Editors.YesNoParameterEditor), "")]
public bool SendRedirRequestParameter { get; set; }
public Hashtable GetOptions(string optionName)
{
Hashtable htOptions = new Hashtable();
switch (optionName)
{
case "Shipping Type":
htOptions.Add("1", "Encomenda normal (PAC)");
htOptions.Add("2", "SEDEX");
htOptions.Add("3", "Tipo de frete não especificado");
break;
case "Payed Status Id":
foreach (OrderState orderState in OrderState.getAllOrderstates(1, true))
{
htOptions.Add(orderState.ID, orderState.Name);
}
break;
}
return htOptions;
}
}
You can see a screen print of the error that happens when saving in the backend.
Thanks,
Diogo