weird insert payment error

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
RickSilver
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Mon Jun 22, 2009 5:49 pm

weird insert payment error

Post by RickSilver » Mon Sep 25, 2017 1:22 pm

Exception: could not insert: [CommerceBuilder.Payments.Payment][SQL: INSERT INTO ac_Payments (OrderId, SubscriptionId, PaymentMethodId, PaymentMethodName, ReferenceNumber, Amount, CurrencyCode, PaymentDate, PaymentStatusId, PaymentStatusReason, CompletedDate, EncryptedAccountData, ReCrypt, IsSubscriptionFollowup, GatewayPaymentProfileId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); select SCOPE_IDENTITY()]

This error just started occurring on a new store I'm working on. I can't find any custom code that's involved. Wondering if anyone else has gotten this. We have one payment method for Purchase orders. I was able to place test orders last night and now I get this error.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: weird insert payment error

Post by AbleMods » Mon Sep 25, 2017 10:54 pm

Could be several possibilities. What payment gateway are you using?

Should be more to that error than just the Exception: could not insert. It should identify what the specific error was. Maybe check the /app_data/logs/app.log file for more detail. Would help a lot with narrowing down the cause.

I have seen some unusual payment record or transaction record errors when certain details of the entry are too large. For instance, if the ReferenceNumber value returned by the gateway is longer than 50 chars, the value doesn't get truncated before it's stored to the table. So SQL will fail to write the record and throw an exception. Happens more with ac_Transactions than it does with payments, but I've seen it in both.

Finally, could be a permissions error in SQL. Have you ever been able to save a payment? What happens if you record a payment manually via the admin?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

RickSilver
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Mon Jun 22, 2009 5:49 pm

Re: weird insert payment error

Post by RickSilver » Tue Sep 26, 2017 2:18 pm

Thanks! It was the 50 character limit of the Reference number.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: weird insert payment error

Post by AbleMods » Tue Sep 26, 2017 10:51 pm

Glad you got it figured out. Not always easy determining which field is the problem.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Post Reply