I ran into a strange Infusionsoft / Keap PHP SDK error while trying to run a chargeInvoice request.
The documentation made it look like one thing should work, but the SDK and API response clearly wanted something else.
The Problem
The request was failing with this error:
[critical] Uncaught PHP Exception Infusionsoft\Http\HttpException:
"No method matching arguments: java.lang.String, java.lang.Integer, java.lang.Boolean,
java.lang.String, java.lang.String, java.lang.Boolean"
at .../vendor/infusionsoft/php-sdk/src/Infusionsoft/Http/InfusionsoftSerializer.php ...
The Infusionsoft XML-RPC documentation said the notes parameter should be a string, but the method matching error showed that the API was expecting a boolean value in that position.
The Solution
Instead of sending a string for $notes, I changed it to a boolean value of true, as the error hinted.
I do not know exactly what that value indicates internally, or what would happen if it were set to false, but I do know the request worked when true was passed.
After that change, the request ran without an error.
It looks like something was mismatched between the documentation and what the API expected. To make it work, I left the notes value as true.
Final PHP Code
<?php
$notes = true;
$invoicePaid = $infusionsoft->invoices()->chargeInvoice(
$invoiceID,
$notes,
$creditCardID,
$merchantAccountID,
$bypassComissions
);
That solved the method matching error for this chargeInvoice request.