Beispiel #1
0
        public static RefundNotify CreateInstance(string name, NameValueCollection parameters)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(null);
            }
            object[] args = new object[1]
            {
                parameters
            };
            RefundPlugins refundPlugins = RefundPlugins.Instance();
            Type          plugin        = refundPlugins.GetPlugin("RefundRequest", name);

            if (plugin == null)
            {
                return(null);
            }
            Type pluginWithNamespace = refundPlugins.GetPluginWithNamespace("RefundNotify", plugin.Namespace);

            if (pluginWithNamespace == null)
            {
                return(null);
            }
            return(Activator.CreateInstance(pluginWithNamespace, args) as RefundNotify);
        }
Beispiel #2
0
        public static RefundRequest CreateInstance(string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(null);
            }
            Type plugin = RefundPlugins.Instance().GetPlugin("RefundRequest", name);

            if (plugin == null)
            {
                return(null);
            }
            return(Activator.CreateInstance(plugin) as RefundRequest);
        }
Beispiel #3
0
 public static RefundPlugins Instance()
 {
     if (instance == null)
     {
         lock (LockHelper)
         {
             if (instance == null)
             {
                 instance = new RefundPlugins();
             }
         }
     }
     instance.VerifyIndex();
     return(instance);
 }
Beispiel #4
0
        public static RefundRequest CreateInstance(string name, string configXml, string[] orderId, string refundOrderId, decimal[] amount, decimal[] refundaAmount, string[] body, string buyerEmail, DateTime date, string returnUrl, string notifyUrl, string attach)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(null);
            }
            object[] args   = new object[] { orderId, refundOrderId, amount, refundaAmount, body, buyerEmail, date, returnUrl, notifyUrl, attach };
            Type     plugin = RefundPlugins.Instance().GetPlugin("RefundRequest", name);

            if (plugin == null)
            {
                return(null);
            }
            RefundRequest request = Activator.CreateInstance(plugin, args) as RefundRequest;

            if (!((request == null) || string.IsNullOrEmpty(configXml)))
            {
                XmlDocument document = new XmlDocument();
                document.LoadXml(configXml);
                request.InitConfig(document.FirstChild);
            }
            return(request);
        }