code: def init(self, request, paypal_request, paypal_response):
          
          if request is not None:
              from paypal.pro.helpers import strip_ip_port
              self.ipaddress = strip_ip_port(request.META.get('REMOTE_ADDR', ''))
              if (hasattr(request, "user") and request.user.is_authenticated):
                  self.user = request.user
          else:
              self.ipaddress = ''
  
          # No storing credit card info.
          query_data = dict((k, v) for k, v in paypal_request.items() if k not in self.RESTRICTED_FIELDS)
          self.query = urlencode(query_data)
          self.response = urlencode(paypal_response)
  
          # Was there a flag on the play?
          ack = paypal_response.get('ack', False)
          if ack != "Success":
              if ack == "SuccessWithWarning":
                  warn_untested()
                  self.flag_info = paypal_response.get('l_longmessage0', '')
              else:
                  self.set_flag(paypal_response.get('l_longmessage0', ''), paypal_response.get('l_errorcode', ''))
docs: Initialize a PayPalNVP instance from a HttpRequest.