简体   繁体   English

QBXML错误:信用卡到期年份上的StatusCode 3020“无效日期”

[英]QBXML Error: StatusCode 3020 “Invalid Date” on Credit Card Expiration Year

I am working with the QBFC .Net wrapper for QBXML. 我正在使用QBXML的QBFC .Net包装器。 I am trying to add a customer to Quickbooks from my .Net Winforms application, but I keep getting errors saying my "credit card expiration year" has an "invalid date". 我试图从我的.Net Winforms应用程序中将客户添加到Quickbooks中,但是我不断收到错误消息,说我的“信用卡到期年”具有“无效日期”。

I am using version 13 of the SDK: 我正在使用SDK的版本13:

SpecVersion Current version of qbXML in use: 13.0 SpecVersion当前使用的qbXML版本:13.0

Here's the error from the qbsdklog.txt 这是来自qbsdklog.txt的错误

CustomerStorage::DoAdd Failed to set customer credit card expiration year: 2015 >QuickBooks error message: Invalid date. CustomerStorage :: DoAdd无法设置客户信用卡的有效期:2015> QuickBooks错误消息:无效的日期。 HRESULT=0x80040506 HRESULT = 0x80040506

I've tried various integers (15, 2015, 2020, 2021, etc), but it simply won't accept anything, throws the same error every time. 我尝试了各种整数(15、2015、2020、2021等),但是它根本不接受任何东西,每次都会抛出相同的错误。

Here's the code that I am using in my CusotmerAdd: 这是我在CusotmerAdd中使用的代码:

//Set field value for ExpirationMonth CustomerAdd.CreditCardInfo.ExpirationMonth.SetValue(10); //设置ExpirationMonth的字段值CustomerAdd.CreditCardInfo.ExpirationMonth.SetValue(10); //Set field value for ExpirationYear CustomerAdd.CreditCardInfo.ExpirationYear.SetValue(2015); //设置ExpirationYear的字段值CustomerAdd.CreditCardInfo.ExpirationYear.SetValue(2015);

I've done basics like rebooting QB, my IDE, and my PC to no avail. 我已经完成了一些基本操作,例如重新启动QB,IDE和PC都无济于事。 Also note, the same issue occurs if I work with my company file, as well as with the provided sample files. 另请注意,如果我使用公司文件以及提供的示例文件,也会发生相同的问题。

If I remove the code that adds the credit card, the customer gets added properly. 如果我删除添加信用卡的代码,则会正确添加客户。 It seems specific to this credit card expiration year. 似乎特定于此信用卡有效期。

Has anyone else ever run into this? 有没有其他人遇到过这个? Seems so simple, I feel like I'm missing something basic, yet nothing I've tried is showing any results. 似乎很简单,我觉得我缺少一些基本的东西,但是我尝试过的任何东西都没有显示任何结果。

Thanks! 谢谢!

Ok, this was pretty basic issue, but not helped by the less than complete Quickbooks error messages. 好的,这是一个非常基本的问题,但由于Quickbooks错误消息不够完整而无法解决。 What led me to the solution was when I learned that I could reproduce the issue in the Desktop Client as well. 导致我找到该解决方案的原因是,我得知我也可以在Desktop Client中重现该问题。 To do so, simply provide a credit card expiration year that is less than the current year. 为此,只需提供一个比当前年份短的信用卡到期年份。 Quickbooks should then throw the following error: 然后,Quickbook应该会引发以下错误: 错误消息说您需要不迟于2037年,但是没有提到最小年份。 ** Note 1 the text says nothing about a minimum year value, only maximum of 2037, yet will still not allow a user to edit the year if the value is lowen than current year. ** 注意1 :文本没有说明最小年份值,最大最大值为2037,但是如果该值比当前年份低,则仍然不允许用户编辑年份。

Contacted Quickbooks support, and the rep confirmed that you cannot add a expiration year less than the current year. 联系了Quickbooks支持,并且销售代表确认您不能添加比当前年份短的到期年份。 Testing that logic in the Desktop Application seems to prove it to be the case. 在桌面应用程序中测试该逻辑似乎证明是事实。 I then applied the same logic to my application, and sure enough I could add customers with credit cards. 然后,我将相同的逻辑应用于我的应用程序,并且确信我可以用信用卡添加客户。

** Note 2 , I was still getting failures attempting to add expiry years greater than the current year in my tests (as referenced in my question). ** 注2 ,在我的测试中,尝试添加比当前年份更长的到期年仍然是失败的(如我的问题所引用)。 I believe those failures were due to caching on my end retaining the bad (2015) year value. 我认为这些失败是由于我保留了糟糕的(2015年)年价值而缓存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM