Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 protected function processResult($result)
 {
     $output = Helper::objectToArray($result);
     if (!is_array($output)) {
         throw new Error\Api($output);
     }
     return $output;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
 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;
 }
Esempio n. 6
0
 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;
 }
Esempio n. 7
0
 public function testObjectToArray()
 {
     $object = (object) array('a' => '1', 'b' => '2', 'c' => '3', 'd' => '4');
     $array = \Paynl\Helper::objectToArray($object);
     $this->assertInternalType('array', $array);
 }