从 QuickBooks Online 获取付款方式名称
Get the Payment method name from QuickBooks Online
来自 QuickBooks 在线的付款信息只会 returns PaymentMethodRef 引用 属性 ID。
在向 QBOE 请求支付信息时,如何获取支付方式名称?
为了参考,添加了下面的代码。
这里的 _paymentList[i].PaymentMethodRef.name 总是空的,只有 _paymentList[i].PaymentMethodRef.id.
ServiceContext serviceContext = getServiceContext(companyID, operatorID);
QueryService<Item> itemQueryService = new QueryService<Item>(serviceContext);
DataService service = new DataService(serviceContext);
Batch batch = service.CreateNewBatch();
ServiceQBOnline_Payment Payment_info;
batch.Add("select * from Payment where Id In " + TxnIds + " ORDERBY id startPosition " + BatchStartIdx + " MaxResults 100", "bID1");
batch.Execute();
intuitBatchResponse queryCustomerResponse = batch["bID1"];
if (queryCustomerResponse.ResponseType == ResponseType.Query)
{
List<Payment> _paymentList = queryCustomerResponse.Entities.ToList().ConvertAll(item => item as Payment);
Response.PaymentExportSuccessList = new List<ServiceQBOnline_Payment>();
for (int i = 0; i < _paymentList.Count; i++)
{
Payment_info.PaymentMethod = _paymentList[i].PaymentMethodRef == null ? "" : _paymentList[i].PaymentMethodRef.name;
Response.PaymentExportSuccessList.Add(Payment_info);
}
查询 PaymentMethod
列表以获得完整的详细信息:
来自文档的示例:
SAMPLE QUERY
select * from PaymentMethod
你会得到这样的回报:
{
"PaymentMethod": {
"Name": "Diners Club",
"Active": true,
"Type": "CREDIT_CARD",
"domain": "QBO",
"sparse": false,
"Id": "7",
"SyncToken": "0",
"MetaData": {
"CreateTime": "2014-09-11T14:42:05-07:00",
"LastUpdatedTime": "2014-09-11T14:42:05-07:00"
}
},
"time": "2015-07-24T15:29:33.401-07:00"
}
来自 QuickBooks 在线的付款信息只会 returns PaymentMethodRef 引用 属性 ID。
在向 QBOE 请求支付信息时,如何获取支付方式名称?
为了参考,添加了下面的代码。
这里的 _paymentList[i].PaymentMethodRef.name 总是空的,只有 _paymentList[i].PaymentMethodRef.id.
ServiceContext serviceContext = getServiceContext(companyID, operatorID);
QueryService<Item> itemQueryService = new QueryService<Item>(serviceContext);
DataService service = new DataService(serviceContext);
Batch batch = service.CreateNewBatch();
ServiceQBOnline_Payment Payment_info;
batch.Add("select * from Payment where Id In " + TxnIds + " ORDERBY id startPosition " + BatchStartIdx + " MaxResults 100", "bID1");
batch.Execute();
intuitBatchResponse queryCustomerResponse = batch["bID1"];
if (queryCustomerResponse.ResponseType == ResponseType.Query)
{
List<Payment> _paymentList = queryCustomerResponse.Entities.ToList().ConvertAll(item => item as Payment);
Response.PaymentExportSuccessList = new List<ServiceQBOnline_Payment>();
for (int i = 0; i < _paymentList.Count; i++)
{
Payment_info.PaymentMethod = _paymentList[i].PaymentMethodRef == null ? "" : _paymentList[i].PaymentMethodRef.name;
Response.PaymentExportSuccessList.Add(Payment_info);
}
查询 PaymentMethod
列表以获得完整的详细信息:
来自文档的示例:
SAMPLE QUERY
select * from PaymentMethod
你会得到这样的回报:
{
"PaymentMethod": {
"Name": "Diners Club",
"Active": true,
"Type": "CREDIT_CARD",
"domain": "QBO",
"sparse": false,
"Id": "7",
"SyncToken": "0",
"MetaData": {
"CreateTime": "2014-09-11T14:42:05-07:00",
"LastUpdatedTime": "2014-09-11T14:42:05-07:00"
}
},
"time": "2015-07-24T15:29:33.401-07:00"
}