protected function processResult($result) { $output = Helper::objectToArray($result); if (isset($output['status']) && $output['status'] == 'FALSE') { throw new Error\Api($output['error']); } return parent::processResult($result); }
protected function processResult($result) { $output = Helper::objectToArray($result); if (!is_array($output)) { throw new Error\Api($output); } return $output; }
protected function processResult($result) { $output = Helper::objectToArray($result); if ($output['request']['result'] != 1 && $output['request']['result'] != 'TRUE') { throw new Error\Api($output['request']['errorId'] . ' - ' . $output['request']['errorMessage']); } return $output; }
protected function processResult($result) { $output = Helper::objectToArray($result); // errors are returned different in this api if (isset($output['result']) && $output['result'] == 0) { throw new ApiError($output['errorId'] . ' - ' . $output['errorMessage']); } return $output; }
protected function processResult($result) { $output = Helper::objectToArray($result); if (!is_array($output)) { throw new ApiError($output); } if (isset($output['request']['result']) && $output['request']['result'] == 0) { throw new ApiError($output['request']['errorMessage']); } return $output; }
protected function processResult($result) { $output = Helper::objectToArray($result); if ($result == '') { throw new ApiError('Empty result'); } if (!is_array($output)) { throw new ApiError($output); } // errors are returned different in this api if ($output['success'] != 1) { throw new ApiError($output['error_field'] . ' - ' . $output['error_message']); } return $output; }
public function testObjectToArray() { $object = (object) array('a' => '1', 'b' => '2', 'c' => '3', 'd' => '4'); $array = \Paynl\Helper::objectToArray($object); $this->assertInternalType('array', $array); }