locked
System.Exception: Live Transaction count or weekly limit exceeded for: bd4978ff-4b53-463f-8e3f-0e52d0b891cf RRS feed

  • Question

  • Hi. If any of you have seen this error before, please let me know if you found a solution. We're stress testing an app and trying to update a number of rows and we get this error. Thanks, Paul

    2020-05-07 22:21:27,493 || ERROR || FTCXCDataService.Controllers.PaymentController || Live Transaction count or weekly limit exceeded for: bd4978ff-4b53-463f-8e3f-0e52d0b891cf

    System.Exception: Live Transaction count or weekly limit exceeded for: bd4978ff-4b53-463f-8e3f-0e52d0b891cf

       at FTCXCDataService.Controllers.PaymentController.PostPayment(PaymentDTO paymentDTO) in C:\TeamCity\buildAgent\work\d90360fe30b8ad92\FTCXCDataService\Controllers\PaymentController.cs:line 396

    Monday, May 11, 2020 8:45 PM

All replies

  • Hi piancu,
    Based on your description, could you provide the relevant code to reproduce the situation?
    And does your app related to paymentDTO?
    Best Regards,
    Daniel Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, May 12, 2020 2:17 AM
  •         [Route("Insert")]
            [ResponseType(typeof(PaymentDTO))]
            [HttpPost]
            public IHttpActionResult PostPayment(PaymentDTO paymentDTO)
            {
                Helper.LogBody(paymentDTO);
                if (!ModelState.IsValid)
                {
                    Log.Error(ModelState);
                    return BadRequest(ModelState);
                }

                if (string.IsNullOrEmpty(paymentDTO.RecipientPaymentProfileId) && string.IsNullOrEmpty(paymentDTO.RecipientToken))
                {
                    return BadRequest("Please provide PaymentprofileId (or) Recipient Token");
                }

                if (paymentDTO.InitiationTime == DateTime.MinValue)
                {
                    return BadRequest("Please provide InitiationTime.");
                }

                try
                {
                    var result = InsertPayment(paymentDTO);
                    return Ok(result);
                }
                catch (Exception ex)
                {
                    Log.Error(ex.Message, ex);
                    return BadRequest("Unable to insert Payment");
                }
            }

            [NonAction]
            public PaymentDTO InsertPayment(PaymentDTO p)
            {
                int? CustomerId = null;
                Customer existingCustomer = null;
                string senderId = null;
                OONPaymentProfile oonPaymentProfile = null;
                OONPaymentDetail oonPaymentDetail = null;
                string recipientToken = null;
                try
                {

                    if (p.TransactionType.ToUpper() == "DEBIT")
                    {
                        var customer = db.Customers.Where(x => x.ALKMemberId == p.ALKMemberId).SingleOrDefault();
                        if (customer == null)
                        {
                            throw new Exception("Unable to get Customer");
                        }
                        CustomerId = customer.Id;
                        senderId = customer.CXCCustomerID.ToString();
                        recipientToken = p.RecipientToken;
                        if (p.OONPaymentProfile != null)
                        {
                            oonPaymentProfile = new OONPaymentProfile
                            {
                                AccountNo = p.OONPaymentProfile.AccountNo,
                                AccountRegistrationDate = p.OONPaymentProfile.AccountRegistrationDate,
                                AmountOfPaymentsReceived = p.OONPaymentProfile.AmountOfPaymentsReceived,
                                BrowserUserAgentHeader = p.OONPaymentProfile.BrowserUserAgentHeader,
                                FirstTransferInitiationDate = p.OONPaymentProfile.FirstTransferInitiationDate,
                                IpAddress = p.OONPaymentProfile.IpAddress,
                                LastNotificationChangeDate = p.OONPaymentProfile.LastNotificationChangeDate,
                                LastPasswordChangeDate = p.OONPaymentProfile.LastPasswordChangeDate,
                                NumberOfPaymentsReceived = p.OONPaymentProfile.NumberOfPaymentsReceived,
                                OwnershipType = p.OONPaymentProfile.OwnershipType,
                                PaymentProfileCreationDate = p.OONPaymentProfile.PaymentProfileCreationDate,
                                RegistrationDate = p.OONPaymentProfile.RegistrationDate,
                                ResidenceState = p.OONPaymentProfile.ResidenceState,
                                RoutingNo = p.OONPaymentProfile.RoutingNo,
                                Type = p.OONPaymentProfile.Type,
                                CreatedBy = userId,
                                CreatedDate = DateTime.Now
                            };
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(p.RecipientPaymentProfileId))
                        {
                            existingCustomer = (from pp in db.PaymentProfiles
                                                join t in db.Tokens
                                                on pp.Id equals t.PaymentProfileId
                                                join c in db.Customers
                                                on t.CustomerId equals c.Id
                                                where pp.CXCPaymentProfile.ToString().ToUpper() == p.RecipientPaymentProfileId.ToUpper()
                                                select c).SingleOrDefault();
                            recipientToken = (from pp in db.PaymentProfiles
                                              join t in db.Tokens
                                              on pp.Id equals t.PaymentProfileId
                                              where pp.CXCPaymentProfile.ToString().ToUpper() == p.RecipientPaymentProfileId.ToUpper()
                                              select t.MemberToken).SingleOrDefault();

                        }
                        else
                        {
                            existingCustomer = (from t in db.Tokens
                                                join c in db.Customers
                                                on t.CustomerId equals c.Id
                                                join pp in db.PaymentProfiles
                                                on t.PaymentProfileId equals pp.Id
                                                where t.MemberToken.ToUpper() == p.RecipientToken.ToUpper()
                                                select c).SingleOrDefault();



                        }
                        CustomerId = existingCustomer.Id;
                        senderId = p.SenderId;
                        if (p.OONPaymentDetail != null)
                        {
                            oonPaymentDetail = new OONPaymentDetail
                            {

                                RegistrationDate = p.OONPaymentDetail.RegistrationDate,
                                BrowserUserAgentHeader = p.OONPaymentDetail.BrowserUserAgentHeader,
                                IpAddress = p.OONPaymentDetail.IpAddress,
                                StartTime = p.OONPaymentDetail.StartTime,
                                FirstName = p.OONPaymentDetail.FirstName,
                                LastName = p.OONPaymentDetail.LastName,
                                DateOfBirth = p.OONPaymentDetail.DateOfBirth,
                                Phone = p.OONPaymentDetail.Phone,
                                FirstTransferInitiationDate = p.OONPaymentDetail.FirstTransferInitiationDate,
                                PaymentsSentTotal = p.OONPaymentDetail.PaymentsSentTotal,
                                PaymentsSentToday = p.OONPaymentDetail.PaymentsSentToday,
                                PaymentsSentLast7 = p.OONPaymentDetail.PaymentsSentLast7,
                                PaymentsSentLast30 = p.OONPaymentDetail.PaymentsSentLast30,
                                PaymentsReceivedTotal = p.OONPaymentDetail.PaymentsReceivedTotal,
                                PaymentsReceivedToday = p.OONPaymentDetail.PaymentsReceivedToday,
                                PaymentsReceivedLast7 = p.OONPaymentDetail.PaymentsReceivedLast7,
                                PaymentsReceivedLast30 = p.OONPaymentDetail.PaymentsReceivedLast30,
                                AddressLine1 = p.OONPaymentDetail.AddressLine1,
                                AddressLine2 = p.OONPaymentDetail.AddressLine2,
                                City = p.OONPaymentDetail.City,
                                State = p.OONPaymentDetail.State,
                                Zip = p.OONPaymentDetail.Zip,
                                NotificationEmail = p.OONPaymentDetail.NotificationEmail,
                                LastNotificationUpdateDate = p.OONPaymentDetail.LastNotificationUpdateDate,
                                LastInfoUpdateDate = p.OONPaymentDetail.LastInfoUpdateDate,
                                LastLoginUpdateDate = p.OONPaymentDetail.LastLoginUpdateDate,
                                LastPasswordUpdateDate = p.OONPaymentDetail.LastPasswordUpdateDate,
                                RoutingNumber = p.OONPaymentDetail.RoutingNumber,
                                AccountNumber = p.OONPaymentDetail.AccountNumber,
                                Type = p.OONPaymentDetail.Type,
                                OwnershipType = p.OONPaymentDetail.OwnershipType,
                                AccountRegistrationDate = p.OONPaymentDetail.AccountRegistrationDate,
                                AccessVerificationDate = p.OONPaymentDetail.AccessVerificationDate,
                                AccessVerificationMethod = p.OONPaymentDetail.AccessVerificationMethod,
                                EWSscore = p.OONPaymentDetail.EWSscore,
                                PaymentTransactionFee = p.OONPaymentDetail.PaymentTransactionFee,
                                PaymentTrasnactionAmount = p.OONPaymentDetail.PaymentTrasnactionAmount,
                                PaymentAuthorizationDate = p.OONPaymentDetail.PaymentAuthorizationDate,
                                RecipientFirstName = p.OONPaymentDetail.RecipientFirstName,
                                RecipientLastName = p.OONPaymentDetail.RecipientLastName,
                                Expedited = p.OONPaymentDetail.Expedited,
                                CreatedDate = DateTime.Now,
                                CreatedBy = userId
                            };
                        }
                    }

                    RandomStringHelper randomStringHelper = new RandomStringHelper();
                    var OrgIdHelper = ConfigurationManager.AppSettings["OrgId"];
                    if (String.IsNullOrEmpty(OrgIdHelper))
                        throw new ArgumentException("OrgId is not in AppSettings of machine.config");
                    string pid = String.Format("{0}{1}", OrgIdHelper, randomStringHelper.GetRandomString(9));

                    var payment = new Payment
            {
                Amount = p.Amount,
                CXCPaymentID = pid,
                //InitiationTime = p.InitiationTime,
                ProductType = p.ProductType,
                Memo = p.Memo,
                Status = p.Status,
                ExpirationTime = p.ExpirationTime,
                FailureReasonCode = p.FailureReasonCode,
                ACHReturnCode = p.ACHReturnCode,
                FailureReasonDescription = p.FailureReasonDescription,
                DeclineMemo = p.DeclineMemo,
                RecipientToken = recipientToken,
                RecipientFirstName = p.RecipientFirstName,
                RecipientLastName = p.RecipientLastName,
                RecipientPaymentProfileId = p.RecipientPaymentProfileId,
                RecipientOrgId = p.RecipientOrganizationId,
                PaymentRequestId = p.PaymentRequestId,
                Expedited = p.Expedited,
                DeliveryTime = p.DeliveryTime,
                CreatedBy = userId,
                CreatedDate = DateTime.Now,
                SenderAccountNo = p.SenderAccountNo,
                SenderId = senderId,
                SenderOrgId = p.SenderOrgId,
                SenderName = p.SenderName,
                SenderAddress1 = p.SenderAddress1,
                SenderAddress2 = p.SenderAddress2,
                SenderCity = p.SenderCity,
                SenderState = p.SenderState,
                SenderZip = p.SenderZip,
                SenderCountry = p.SenderCountry,
                TransactionType = p.TransactionType,
                CustomerId = CustomerId,
                EffectiveDate = DateTime.Now.Date,
                OONPaymentProfile = oonPaymentProfile,
                OONPaymentDetail = oonPaymentDetail

            };

                    if (p.TransactionType.ToUpper() == "CREDIT")
                    {
                        if (string.IsNullOrEmpty(p.CXCPaymentID))
                        {
                            throw new Exception("PaymentID cannot be NULL/empty for a Credit Transaction");
                        }
                        payment.CXCPaymentID = p.CXCPaymentID;

                        payment.InitiationTime = p.InitiationTime;
                    }
                    else
                    {
                        payment.InitiationTime = p.InitiationTime;
                    }

                    db.Payments.Add(payment);
                    db.SaveChanges();
                    p.SenderId = payment.SenderId;
                    p.Id = payment.Id;

                    if (p.TransactionType.ToUpper() == "DEBIT")
                    {
                        RandomStringHelper randomString = new RandomStringHelper();
                        var OrgId = ConfigurationManager.AppSettings["OrgId"];
                        if (String.IsNullOrEmpty(OrgId))
                            throw new ArgumentException("P2PFTOrgId is not in AppSettings of machine.config");
                        p.CXCPaymentID = String.Format("{0}{1}", OrgId, randomString.GetRandomString(9));
                        //p.CXCPaymentID = "ABC" + p.Id.ToString().PadLeft(9, '0');
                        payment.CXCPaymentID = p.CXCPaymentID;
                        db.Entry(payment).State = EntityState.Modified;
                        db.SaveChanges();
                    }

                    return p;
                }
                catch (DbEntityValidationException ex)
                {
                    StringBuilder sb = new StringBuilder();
                    foreach (DbEntityValidationResult validationResult in ex.EntityValidationErrors)
                    {
                        string entityName = validationResult.Entry.Entity.GetType().Name;
                        foreach (DbValidationError error in validationResult.ValidationErrors)
                        {
                            sb.AppendLine("->" + entityName + "." + error.PropertyName + ": " + error.ErrorMessage);
                        }
                    }
                    Log.Error(sb.ToString());
                    throw new Exception("Database Entity Validation Exception Occured");
                }
                catch (Exception ex)
                {
                    Log.Error(ex.Message, ex);
                    if (ex.GetType().Name == "DbUpdateException")
                    {
                        Log.Error(ex.InnerException.InnerException.Message);
                        if (ex.InnerException.InnerException.InnerException != null)
                        {
                            Log.Error(ex.InnerException.InnerException.InnerException.Message);
                        }
                    }
                    throw ex;
                }
            }

    Tuesday, May 12, 2020 3:58 PM
  • Hi piancu,
    Based on your code, I viewed that it is related to paymentDTO. And we don't support it.
    Thank you for your understanding.
    Best Regards,
    Daniel Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 13, 2020 7:31 AM