Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in call21UpdateMethod #19

Open
rappasoft opened this issue Dec 18, 2014 · 0 comments
Open

Bug in call21UpdateMethod #19

rappasoft opened this issue Dec 18, 2014 · 0 comments

Comments

@rappasoft
Copy link

I was attempting to update a customer and I realized that the PHP wrapper's call21UpdateMethod does not let you specify a key, but only a value. So it would pass:

<update_customer customerid="Mercury">

as

<update_customer key="Mercury">

So I modified the call from:

public static function call21UpdateMethod($function, $key, $phpObj, api_session $session)
{
$xml = api_util::phpToXml($function, array($phpObj));
$xml = str_replace("<$function", "<$function key="$key"", $xml);
return api_post::post($xml, $session, "2.1");
}

to:

public static function call21UpdateMethod($function, $key, $value, $phpObj, api_session $session)
{
$xml = api_util::phpToXml($function, array($phpObj));
$xml = str_replace("<$function", "<$function $key="$value"", $xml);
return api_post::post($xml, $session, "2.1");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant