我无法在供应商中添加primaryPhone,AlternativePhone,PrimaryEmailAddr,WebAddr和BillAddr。将值传递给供应商api有什么不对吗?请帮我告诉我如何传递这个值。
$dataService = QuickbookConnection::createQBConnection();
$serviceType = IntuitServicesType::QBO;
$vendObj = new IPPVendor();
$vendObj->SyncToken = $vendData['contactID'];
$vendObj->GivenName = $vendData['fName'];
$vendObj->FamilyName = $vendData['lName'];
$vendObj->DisplayName = $vendData['cName'];
$vendObj->CompanyName = $vendData['cName'];
$vendObj->PrimaryPhone = $vendData['phone'];
$vendObj->AlternatePhone = $vendData['altPhone'];
$vendObj->PrimaryEmailAddr = $vendData['email'];
$vendObj->WebAddr = $vendData['web'];
$vendObj->BillAddr = $vendData['address'] ." ". $vendData['citystate'];
$vendObj->Active = true;
$resultingObj = $dataService->Add($vendObj);
$QbVendorID = $resultingObj->Id;
答案 0 :(得分:0)
所有上述属性都是复杂类型。 见 - https://developer.intuit.com/docs/api/accounting/Vendor
PrimaryEmailAddr具有子属性'地址' 同样地,所有其他上述字段都具有需要设置的子属性,而不是顶级属性名称。