$userSessionID, 'Card-Id' => $cardId]); User::signout($userSessionID); if (Request::RESPONSE_STATUS_OK != $response['LOINCardSelect']['Status']) { throw new InnocadLoyaltyException($response['LOINCardSelect']['UserMessage'], $response['LOINCardSelect']['Status']); } if (!$response['LOINCardSelect']['RowCount']) { throw new InnocadLoyaltyException('Invalid Card ID'); } if (self::STATUS_ACTIVE != $response['LOINCardSelect']['Cards'][0]['Card']['CardStatus']) { switch ($response['LOINCardSelect']['Cards'][0]['Card']['CardStatus']) { case self::STATUS_INACTIVE: $message = 'Card is inactive'; break; case self::CARD_STATUS_BLOCKED: $message = 'Card is blocked'; break; default: $message = 'Card is inactive or blocked'; } throw new InnocadLoyaltyException($message, $cardId); } return $response['LOINCardSelect']['Cards'][0]['Card']; } }