示例#1
0
    def pyafipws_authenticate(self, service='wsfe', force=False):
        'Authenticate against AFIP, returns token, sign, err_msg (dict)'
        auth_data = {}
        # get the authentication credentials:
        certificate = str(self.pyafipws_certificate)
        private_key = str(self.pyafipws_private_key)
        if self.pyafipws_mode_cert == 'homologacion':
            WSAA_URL = 'https://wsaahomo.afip.gov.ar/ws/services/LoginCms?wsdl'
        elif self.pyafipws_mode_cert == 'produccion':
            WSAA_URL = 'https://wsaa.afip.gov.ar/ws/services/LoginCms?wsdl'
        else:
            self.raise_user_error(
                'wrong_pyafipws_mode', {
                    'message':
                    u'El modo de certificación no es ni producción, ni '
                    u'homologación. Configure su Empresa',
                })

        # call the helper function to obtain the access ticket:
        auth = afip_auth.authenticate(service,
                                      certificate,
                                      private_key,
                                      wsdl=WSAA_URL,
                                      force=force,
                                      cache=self.get_cache_dir())
        auth_data.update(auth)
        return auth_data
示例#2
0
 def pyafipws_authenticate(self, service="wsfe"):
     "Authenticate against AFIP, returns token, sign, err_msg (dict)"
     import afip_auth
     auth_data = {}
     # get the authentication credentials:
     certificate = str(self.pyafipws_certificate)
     private_key = str(self.pyafipws_private_key)
     # call the helper function to obtain the access ticket:
     auth = afip_auth.authenticate(service, certificate, private_key)
     auth_data.update(auth)
     return auth_data
示例#3
0
    def pyafipws_authenticate(self, service="wsfe", force=False):
        "Authenticate against AFIP, returns token, sign, err_msg (dict)"
        import afip_auth
        auth_data = {}
        # get the authentication credentials:
        certificate = str(self.pyafipws_certificate)
        private_key = str(self.pyafipws_private_key)
        if self.pyafipws_mode_cert == 'homologacion':
            WSAA_URL = "https://wsaahomo.afip.gov.ar/ws/services/LoginCms?wsdl"
        elif self.pyafipws_mode_cert == 'produccion':
            WSAA_URL = "https://wsaa.afip.gov.ar/ws/services/LoginCms?wsdl"

        # call the helper function to obtain the access ticket:
        auth = afip_auth.authenticate(service, certificate, private_key, wsdl=WSAA_URL, force=force)
        auth_data.update(auth)
        return auth_data
 def pyafipws_authenticate(self, cr, uid, ids, context=None, service="wsfe"):
     "Authenticate against AFIP, returns token, sign, err_msg (dict)"
     import afip_auth
     auth_data = {}
     for company in self.browse(cr, uid, ids):
         # get the authentication credentials:
         certificate = str(company.pyafipws_certificate)
         private_key = str(company.pyafipws_private_key)
         # create the proxy and get the configuration system parameters:
         cfg = self.pool.get('ir.config_parameter')
         cache = cfg.get_param(cr, uid, 'pyafipws.cache', context=context)
         proxy = cfg.get_param(cr, uid, 'pyafipws.proxy', context=context)
         wsdl = cfg.get_param(cr, uid, 'pyafipws.wsaa.url', context=context)
         # call the helper function to obtain the access ticket:
         auth = afip_auth.authenticate(service, certificate, private_key,
                                       cache=cache or "", wsdl=wsdl or "", 
                                       proxy=proxy or "")
         auth_data.update(auth)
     return auth_data
    def pyafipws_authenticate(self, service="wsfe", force=False):
        "Authenticate against AFIP, returns token, sign, err_msg (dict)"
        import afip_auth
        auth_data = {}
        # get the authentication credentials:
        certificate = str(self.pyafipws_certificate)
        private_key = str(self.pyafipws_private_key)
        if self.pyafipws_mode_cert == 'homologacion':
            WSAA_URL = "https://wsaahomo.afip.gov.ar/ws/services/LoginCms?wsdl"
        elif self.pyafipws_mode_cert == 'produccion':
            WSAA_URL = "https://wsaa.afip.gov.ar/ws/services/LoginCms?wsdl"

        # call the helper function to obtain the access ticket:
        auth = afip_auth.authenticate(service,
                                      certificate,
                                      private_key,
                                      wsdl=WSAA_URL,
                                      force=force)
        auth_data.update(auth)
        return auth_data
    def pyafipws_authenticate(self, service="wsfe", force=False):
        "Authenticate against AFIP, returns token, sign, err_msg (dict)"
        import afip_auth

        auth_data = {}
        # get the authentication credentials:
        certificate = str(self.pyafipws_certificate)
        private_key = str(self.pyafipws_private_key)
        if self.pyafipws_mode_cert == "homologacion":
            WSAA_URL = "https://wsaahomo.afip.gov.ar/ws/services/LoginCms?wsdl"
        elif self.pyafipws_mode_cert == "produccion":
            WSAA_URL = "https://wsaa.afip.gov.ar/ws/services/LoginCms?wsdl"
        else:
            self.raise_user_error(
                "wrong_pyafipws_mode",
                {"message": u"El modo de certificación no es ni producción, ni homologación. Configure su Empresa"},
            )

        # call the helper function to obtain the access ticket:
        auth = afip_auth.authenticate(service, certificate, private_key, wsdl=WSAA_URL, force=force)
        auth_data.update(auth)
        return auth_data