简体   繁体   English

更新信用卡到期月份和年份n软件快速手册

[英]Update credit card expiry month and year nsoftware quickbooks

I am using nSoftware to interact with QuickBooks. 我正在使用nSoftware与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". 问题是GetByName方法返回的客户对象的信用卡号如“ xxxxxxxxxxxxxx1234”。 Updating customer object updates actual credit card number with xxx....1234. 更新客户对象将使用xxx .... 1234更新实际的信用卡号。 My requirement is to update only expiry month and year. 我的要求是仅更新到期的月份和年份。

Dev Environment:- ASP.Net 4.0, C# 开发环境:-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. 修改信用卡字段并调用Update方法将导致所有卡字段都发送到QuickBooks,包括“ xxxxxxxxxxxx1234”卡号。 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. 在这种情况下,可以指定一个新的QBCard对象以确保仅将您明确打算更新的信用卡字段发送到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 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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