Beispiel #1
0
    def test_connection(self):
        """
        Tests the connection to the AltaPay service. This operation does
        not require valid API credentials, and as such can only be used to
        assert if AltaPay is responding.

        :rtype: :samp:`True` if a valid response is returned, otherwise
            :samp:`False`.
        """
        return Resource.create_from_response(self.get('API/testConnection'))
Beispiel #2
0
    def test_connection(self):
        """
        Tests the connection to the AltaPay service. This operation does
        not require valid API credentials, and as such can only be used to
        assert if AltaPay is responding.

        :rtype: :samp:`True` if a valid response is returned, otherwise
            :samp:`False`.
        """
        return Resource.create_from_response(self.post('API/testConnection'))
Beispiel #3
0
    def login(self):
        """
        Validates the account name and password against the AltaPay service.
        This method should always be called before attempting any other calls,
        and is automatically called once the :py:class:`altapay.api.API`
        object is instantiated, unless explictly disabled.

        Raises:
            UnauthorizedAccessError: if the supplied credentials are not valid.
        """
        if self._is_authenticated:
            return

        if Resource.create_from_response(self.get('API/login')).success:
            self._is_authenticated = True
            return
Beispiel #4
0
    def login(self):
        """
        Validates the account name and password against the AltaPay service.
        This method should always be called before attempting any other calls,
        and is automatically called once the :py:class:`altapay.api.API`
        object is instantiated, unless explictly disabled.

        Raises:
            UnauthorizedAccessError: if the supplied credentials are not valid.
        """
        if self._is_authenticated:
            return

        if Resource.create_from_response(self.post('API/login')).success:
            self._is_authenticated = True
            return