docs: def get_gateway_url(self, request):
          """
          Tricky process that requires to get auth key, send order via POST and
          then present final URL for redirection to finalize payment.
          """
  
          grant_type = self.get_backend_setting('grant_type', 'client_credentials')
          if grant_type == 'client_credentials':
              client_id = self.get_backend_setting('client_id')
              client_secret = self.get_backend_setting('client_secret')
              url = "{gateway_url}pl/standard/user/oauth/authorize?" \
                    "grant_type={grant_type}&" \
                    "client_id={client_id}&" \
                    "client_secret={client_secret}".format(gateway_url=self._GATEWAY_URL,
                                                           grant_type=grant_type, client_id=client_id,
                                                           client_secret=client_secret)
          elif grant_type == 'trusted_merchant':
              raise ImproperlyConfigured('grant_type not yet supported')
          else:
              raise ImproperlyConfigured('grant_type should be one of: "trusted_merchant", "client_credentials"')
  
          response = requests.get(url)
          assert response.status_code == 200
  
          response_data = response.json()
          access_token = response_data['access_token']
          token_type = response_data['token_type']
  
          headers = {"Authorization": "{token_type} {access_token}".format(
              token_type=token_type.title(), access_token=access_token)}
  
          pos_id = self.get_backend_setting('pos_id', None)
  
          user_data = {
              'email': None,
              'lang': None,
          }
  
          signals.user_data_query.send(
              sender=None, order=self.payment.order, user_data=user_data)
  
          if not user_data['email']:
              raise ImproperlyConfigured
  
          buyer_info = dict(  # dane kupującego
              email=user_data['email'],
          )
  
          if user_data['lang'] and user_data['lang'].lower() in self._ACCEPTED_LANGS:
              buyer_info['language'] = user_data['lang'].lower()
          elif self.get_backend_setting('lang', False
                                        ) and (self.get_backend_setting('lang').lower() in self._ACCEPTED_LANGS):
              buyer_info['language'] = six.text_type(self.get_backend_setting('lang').lower())
  
          customer_id = user_data.get('id', None)
          if customer_id:
              buyer_info['extCustomerId'] = customer_id
  
          customer_first_name = user_data.get('first_name', None)
          if customer_first_name:
              buyer_info['firstName'] = customer_first_name
  
          customer_last_name = user_data.get('last_name', None)
          if customer_last_name:
              buyer_info['last_Namme'] = customer_last_name
  
          customer_phone = user_data.get('phone', None)
          if customer_phone:
              buyer_info['phone'] = customer_phone
  
          current_site = getpaid_utils.get_domain(request)
          use_ssl = self.get_backend_setting('ssl_return', True)
  
          notify_url = "http{}://{}{}".format(
              's' if use_ssl else '',
              current_site,
              reverse('getpaid:payu_rest:confirm')
          )
  
          params = dict(
              customerIp=getpaid_utils.get_ip_address(request),
              merchantPosId=pos_id,
              description=self.get_order_description(self.payment, self.payment.order),
              currencyCode=self.payment.currency.upper(),
              totalAmount=str(int(self.payment.amount * 100)),
              buyer=buyer_info,
              products=[dict(
                  name='Payment #{} from {}'.format(self.payment.pk, current_site),
                  unitPrice=str(int(self.payment.amount * 100)),
                  quantity="1",
                  # ### optional:
                  # virtual=True,
                  # listingDate='',
              )],
  
              # ### optional:
              notifyUrl=notify_url,
              extOrderId=str(self.payment.pk),
              # validityTime='',
              # additionalDescription='',
              continueUrl='http://127.0.0.1:8000/',
              # payMethods=None,
          )
  
          order_url = "{gateway_url}api/v2_1/orders".format(gateway_url=self._GATEWAY_URL)
  
          order_register = requests.post(order_url, json=params, headers=headers, allow_redirects=False)
          order_register_data = order_register.json()
          status = order_register_data.get('status', {}).get('statusCode', '')
          if status != 'SUCCESS':
              logger.error('Houston, we have a problem with this payment trajectory: {}'.format(status))
              return reverse('getpaid:failure-fallback', kwargs=dict(pk=self.payment.pk)), 'GET', {}
          final_url = order_register_data.get('redirectUri')
  
          return final_url, 'GET', {}