def get_notification(self, notification_id): response = requests.get( self.notification_url + '/{}'.format(notification_id), params={ 'email': self.base_params['email'], 'token': self.base_params['token'] } ) if response.status_code == 200: root = xmltodict.parse(response.text) transaction = root['transaction'] notificacao_recebida.send( sender=self, transaction=transaction ) status = transaction['status'] if status in NOTIFICATION_STATUS: signal = NOTIFICATION_STATUS[status] signal.send( sender=self, transaction=transaction ) logger.debug( 'operation=api_get_notification, ' 'notification_id={}, ' 'response_body={}, ' 'response_status={}'.format( notification_id, response.text, response.status_code ) ) return response
def get_notification(self, notification_id): response = requests.get( self.notification_url + "/{}".format(notification_id), params={ "email": self.base_params["email"], "token": self.base_params["token"] }, ) if response.status_code == 200: root = xmltodict.parse(response.text) transaction = root["transaction"] notificacao_recebida.send(sender=self, transaction=transaction) status = transaction["status"] if status in NOTIFICATION_STATUS: signal = NOTIFICATION_STATUS[status] signal.send(sender=self, transaction=transaction) logger.debug("operation=api_get_notification, " "notification_id={}, " "response_body={}, " "response_status={}".format(notification_id, response.text, response.status_code)) return response
def get_notification(self, notification_id): response = requests.get( self.notification_url + '/{0}'.format(notification_id), params={ 'email': self.base_params['email'], 'token': self.base_params['token'] } ) if response.status_code == 200: root = xmltodict.parse(response.text) transaction = root['transaction'] notificacao_recebida.send( sender=self, transaction=transaction ) status = transaction['status'] if status in NOTIFICATION_STATUS: signal = NOTIFICATION_STATUS[status] signal.send( sender=self, transaction=transaction ) return response