When I try to put a boolean value as a parameter in a functionc call, I get that I am missing a property
// try to get 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 this error:
SoapFault Object
(
[message:protected] => SOAP-ERROR: Encoding: object has no 'onlyOnGoing' property
Array
(
[0] => Array
(
[Session] => 12345
[SubscriptionId] => 30520
[OnlyOnGoing] =>
)
)
)
)
I have also tried (instead of (bool) false
):
FALSE
, False
, false
None work!
EDIT:
I looked through Orders
and found this 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 I changed "onlyOnGoing" => $onlyOnGoing
to "OnlyOnGoing" => $onlyOnGoing
.
Now I get this error (I also changed output from print_r
to 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)
}
}
}
}
}