Infusionsoft / Keap getting Method Matching error for chargeInvoice request (Solved!)

infusionsoft-chargeInvoice

The Problem

Receiving 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-RCP documentation says the notes parameter should be a string (https://developer.infusionsoft.com/docs/xml-rpc/#invoice-pay-an-invoice) but in fact it is expecting a boolean value.

infusionsoft-chargeInvoice

infusionsoft-chargeInvoice

The Solution

Instead of sending a string, I changed it to a boolean value of ‘true’, as the error hints that i should. I don’t know yet what that indicates and what it would do if I set it to false, but I know that it works with true in it.

infusionsoft-chargeInvoice

This ran without an error. And look what it shows in the order page in Infusionsoft.

infusionsoft-chargeInvoice

They messed up somewhere. But to make it work, I just left it with a TRUE in the notes value.

Final PHP Code

$notes = true;
$invoicePaid = $infusionsoft->invoices()->chargeInvoice($invoiceID, $notes, $creditCardID, $merchantAccountID, $bypassComissions);

No Comments »

No comments yet.

Leave a comment