QuickBooks-V3-PHP-SDK icon indicating copy to clipboard operation
QuickBooks-V3-PHP-SDK copied to clipboard

DataService Void method is not working Sales Receipt

Open denza opened this issue 3 years ago • 2 comments

I found a bug in php SDK.

https://github.com/intuit/QuickBooks-V3-PHP-SDK/blob/master/src/DataService/DataService.php#L861

The class name is QuickBooksOnline\API\Data\IPPSalesReceipt and CoreConstants::VOID_QUERYPARAMETER_GENERAL is assigned instead of CoreConstants::VOID_QUERYPARAMETER_PAYMENT, that causes error below.

If you inspect $uri variable it will output

company/{{CompanyId}}/salesreceipt?operation=void

API Documentation said differently and I update the code to see if I can fix the error and correct uri should be

company/{{CompanyId}}/salesreceipt?operation=update&include=void

Link to documentation https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/salesreceipt#void-a-salesreceipt.

To reproduce

$item = $dataService->FindById("SalesReceipt", $id); $dataService->Void($item);

denza avatar Sep 16 '20 06:09 denza

Thanks @denza for reporting. Also, opening up our SDK for hacktoberfest contributions.

What is it? Hacktoberfest is underway right now and we would love for you to contribute 🚀 . More information on #hacktoberfest is here

Develop-with-Intuit for Hacktoberfest

abisalehalliprasan avatar Sep 22 '20 00:09 abisalehalliprasan

@abisalehalliprasan I wanted to pick this one up for Hacktoberfest so had reached out to V3. Didn't get to it due to the late turn around. But here are my findings: Void operations in V3 have 2 different endpoints, SalesReceipt void endpoint is: /salesreceipt?operation=update&include=void as in the docs. This operation will be similar to the Payments void operation.

bsivalingam avatar Nov 02 '20 21:11 bsivalingam