简体   繁体   English

从QuickBooks Online获取付款方式名称

[英]Get the Payment method name from QuickBooks Online

The Payment information from QuickBooks online will only returns the PaymentMethodRef reference property with ID. 来自QuickBooks在线的“付款”信息将仅返回带有ID的PaymentMethodRef参考属性。

How can i get the payment method name, when requesting for the payment information from QBOE ? 向QBOE请求付款信息时,如何获得付款方式名称?

For reference, added the code below. 作为参考,添加了以下代码。

Here the _paymentList[i].PaymentMethodRef.name is always empty and only it will have the _paymentList[i].PaymentMethodRef.id . 此处_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);
 }

Query the PaymentMethod list to get the full details: 查询PaymentMethod列表以获取完整的详细信息:

Example from the docs: 来自文档的示例:

SAMPLE QUERY
select * from PaymentMethod

You'll get something like this back: 您将获得类似以下的内容:

{
  "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"
}

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

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