コード例 #1
0
 /// <summary>
 /// Create a new IPN object.
 /// </summary>
 /// <param name="iPNID">Initial value of the IPNID property.</param>
 /// <param name="createDate">Initial value of the CreateDate property.</param>
 /// <param name="environment">Initial value of the Environment property.</param>
 /// <param name="responseIN">Initial value of the ResponseIN property.</param>
 public static IPN CreateIPN(global::System.Int32 iPNID, global::System.DateTime createDate, global::System.String environment, global::System.String responseIN)
 {
     IPN iPN = new IPN();
     iPN.IPNID = iPNID;
     iPN.CreateDate = createDate;
     iPN.Environment = environment;
     iPN.ResponseIN = responseIN;
     return iPN;
 }
コード例 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the IPNs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToIPNs(IPN iPN)
 {
     base.AddObject("IPNs", iPN);
 }
コード例 #3
0
ファイル: IPN.cs プロジェクト: zgying/CRMWeiXin
        public static void InsertResponse(string ResponseIN)
        {
            if (ConfigurationManager.AppSettings.Get("PayPalSubmitUrl") != null)
            {

                try
                {
                    string Environment = null;

                    if (ConfigurationManager.AppSettings.Get("PayPalSubmitUrl") == "https://www.sandbox.paypal.com/cgi-bin/webscr")
                    {
                        Environment = "PayPalSandBox";
                    }

                    if (ConfigurationManager.AppSettings.Get("PayPalSubmitUrl") == "https://www.paypal.com/cgi-bin/webscr")
                    {
                        Environment = "PayPalProduction";
                    }

                    using (EntitiesContext context = new EntitiesContext())
                    {
                        DAL.IPN I = new DAL.IPN
                        {
                            CreateDate = DateTime.Now,
                            Environment = Environment,
                            ResponseIN = ResponseIN
                        };
                        context.IPNs.AddObject(I);
                        context.SaveChanges();
                        ParseResponse(ResponseIN, I.IPNID);
                    }
                }
                catch (Exception ex)
                {
                    ElmahExtension.LogToElmah(ex);
                }
            }
            else
            {
                ElmahExtension.LogToElmah(new ApplicationException("Unable to read the value PayPalSubmitUrl in web.config file"));
            }
        }