php boolean value as argument throws encoding error -
when try put boolean value parameter in functionc call, missing property
// try orders try { $order = new order($auth_login, $auth_password, $live_mode); $orders = $order->findordersbysubscriptionid($sessionid, $subscriptionid, (bool) false); } catch (exception $e) { var_dump($e); }
this gives error:
soapfault object ( [message:protected] => soap-error: encoding: object has no 'onlyongoing' property array ( [0] => array ( [session] => 12345 [subscriptionid] => 30520 [onlyongoing] => ) ) ) )
i have tried (instead of (bool) false
):
false
, false
, false
none work!
edit:
i looked through orders
, found part:
public function findordersbysubscriptionid($session, $subscriptionid, $onlyongoing) { try { $result = $this->client->findordersbysubscriptionid(array("session" => $session, "subscriptionid" => $subscriptionid, "onlyongoing" => $onlyongoing)); return $result; } catch (except $e) { return array("error" => $e->getmessage()); } }
where changed "onlyongoing" => $onlyongoing
"onlyongoing" => $onlyongoing
.
now error (i changed output print_r
var_dump
):
object(soapfault)#2668 (10) { ["message":protected]=> string(58) "soap-error: encoding: object has no 'onlyongoing' property" ["trace":"exception":private]=> array(6) { [0]=> array(6) { [0]=> string(26) "findordersbysubscriptionid" [1]=> array(1) { [0]=> array(3) { ["session"]=> string(36) "4d398084-9b08-38a3-362e-880111364dd8" ["subscriptionid"]=> int(30520) ["onlyongoing"]=> bool(false) } } } } }
Comments
Post a Comment