public void Update(PAYPAL_PAYMENT PP, bool Attach = true)
 {
     if (Attach)
     {
         Context.PAYPAL_PAYMENT.Attach(PP);
     }
     var entry = Context.ObjectStateManager.GetObjectStateEntry(PP);
     entry.SetModifiedProperty("TransactionStatus");
     entry.SetModifiedProperty("Response");
 }
예제 #2
0
        private void FixupPAYPAL_PAYMENT(PAYPAL_PAYMENT previousValue)
        {
            if (previousValue != null && ReferenceEquals(previousValue.PAYMENT, this))
            {
                previousValue.PAYMENT = null;
            }

            if (PAYPAL_PAYMENT != null)
            {
                PAYPAL_PAYMENT.PAYMENT = this;
            }
        }
 public void DeleteById(int Id)
 {
     PAYPAL_PAYMENT pPayment = new PAYPAL_PAYMENT() { ID = Id };
     Delete(pPayment);
 }
 public void Delete(PAYPAL_PAYMENT Entity)
 {
     Context.PAYPAL_PAYMENT.Attach(Entity);
     Context.DeleteObject(Entity);
 }
 public void Update(PAYPAL_PAYMENT Entity)
 {
     Update(Entity, true);
 }
 public void Insert(PAYPAL_PAYMENT Entity)
 {
     Context.PAYPAL_PAYMENT.AddObject(Entity);
 }
 public List<PAYPAL_PAYMENT> Search(PAYPAL_PAYMENT Entity, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection)
 {
     throw new NotImplementedException();
 }
예제 #8
0
        protected void updatePayPalData(PDTData data, PAYPAL_PAYMENT pp, string originalResponse)
        {
            pp.TransactionStatus = data.PaymentStatus;
            pp.Response = originalResponse;
            ApplicationContext.Current.Payments.UpdatePayPalPayment(pp, false);

            if (data.PaymentStatus.ToUpper() == "COMPLETED")
            {
                ORDERS order = ApplicationContext.Current.Orders.GetById(pp.ID);
                order.Completed = true;
                ApplicationContext.Current.Orders.Update(order, false);
            }
            else if (data.PaymentStatus.ToUpper() == "REFUNDED" || data.PaymentStatus.ToUpper() == "REVERSED")
            {
                ORDERS order = ApplicationContext.Current.Orders.GetById(pp.ID);
                order.Completed = false;
                order.Canceled = true;
                // I anulluar / canceled
                order.Status = 6;
                order.Comments = order.Comments + "Order was canceled because: " + data.PaymentStatus;
                ApplicationContext.Current.Orders.Update(order, false);
                BasePage.Log(null, "PayPal Reversal/Refund: " + data.PaymentStatus + " TxnId: " + pp.TransactionKey + "\n Response: " + originalResponse, "", "IPN Handler");
                Thread thread = new Thread(() => BasePage.sendMailToAdmins("PayPal payment " + data.PaymentStatus + " for Order: " + pp.ID, "A " + data.PaymentStatus + " IPN was notified for order " + pp.ID +
                    " from " + data.PayerEmail + " for the amount " + data.GrossTotal + " " + data.Currency));
                thread.Start();
            }
            else
            {
                BasePage.Log(null, "Payment status from PayPal not handled: " + data.PaymentStatus + "\n Response: " + originalResponse, "", "IPN Handler");
            }
        }
예제 #9
0
 public void UpdatePayPalPayment(PAYPAL_PAYMENT PP, bool Attach = true)
 {
     _paypalPaymentDAO.Update(PP, Attach);
     Context.SaveChanges();
 }
예제 #10
0
 public void UpdatePayPalPayment(PAYPAL_PAYMENT PPayment)
 {
     _paypalPaymentDAO.Update(PPayment, true);
     Context.SaveChanges();
 }
예제 #11
0
     private void FixupPAYPAL_PAYMENT(PAYPAL_PAYMENT previousValue)
     {
         if (previousValue != null && ReferenceEquals(previousValue.PAYMENT, this))
         {
             previousValue.PAYMENT = null;
         }
 
         if (PAYPAL_PAYMENT != null)
         {
             PAYPAL_PAYMENT.PAYMENT = this;
         }
     }