I am using nSoftware to interact with QuickBooks. My requirement is to update customer's credit card expiry month and year only. Code used for this is

nsoftware.InQB.Customer cust = new nsoftware.InQB.Customer();
cust.GetByName("test");
cust.CreditCard.ExpMonth = customer.CreditCardItem.CardExpMonth;
cust.CreditCard.ExpYear = customer.CreditCardItem.CardExpYear;
cust.Update();

Problem is GetByName method returns customer object which has credit card number like "xxxxxxxxxxxxxx1234". Updating customer object updates actual credit card number with xxx....1234. My requirement is to update only expiry month and year.

Dev Environment:- ASP.Net 4.0, C#

有帮助吗?

解决方案

Modifying the credit card fields and calling the Update method will cause all of the card fields to be sent to QuickBooks, including the "xxxxxxxxxxxx1234" card number. In this case, specifying a new QBCard object can be done to make sure that only the credit card fields that you explicitly intend to update are sent to QuickBooks.

So, something like this should do the trick:

nsoftware.InQB.Customer cust = new nsoftware.InQB.Customer();
cust.GetByName("test");

QBCard card = new QBCard();
card.ExpMonth = customer.CreditCardItem.CardExpMonth;
card.ExpYear = customer.CreditCardItem.CardExpYear;
cust.CreditCard = card;

cust.Update();

Please let me know if this works for you.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top