consolibyte / quickbooks-php

QuickBooks Integration for PHP
Eclipse Public License 1.0
458 stars 338 forks source link

How to set requestID in QBXML? #149

Closed mstenta closed 7 years ago

mstenta commented 7 years ago

I'm using the QBXML portion of this library to generate requests that are sent to Web Connector.

What is the recommended way to add the requestID attribute to the requests I'm creating? For example, if I create QBXML for an Invoice object using $qbxml = $Invoice->asQBXML(QUICKBOOKS_ADD_INVOICE); how do I set requestID?

Thanks for the great library!

consolibyte commented 7 years ago

You should not manually add the requestID yourself. The library will do it for you when it sends the data to the Web Connector.

mstenta commented 7 years ago

Thanks for the quick reply! What if I'm not using the Web Connector portion of the library? I'm developing a Drupal integration and started with the QBWC module (https://www.drupal.org/project/qbwc) before I discovered this library. The QBWC module handles connecting to Web Connector, but it leaves the QBXML generation to the developer. This library has been a godsend for the QBXML generation!

Can I add a requestID without using the QBWC parts of this library?

consolibyte commented 7 years ago

I don't think there's a built-in method to do that unfortunately. :-(

uikolas commented 6 years ago

I faced the same problem. Then just created a simple wrapper function, where i pass QBXML and request id. And use this function: https://github.com/consolibyte/quickbooks-php/blob/master/QuickBooks/WebConnector/Handlers.php#L821 to add request id to my QBXML