Generate the URL with the signature required for signing up a recipient

def make_marketplace_registration_url(self, returnURL, pipelineName,
                                          maxFixedFee=0.0, maxVariableFee=0.0,
                                          recipientPaysFee=True, **params):  
        """
        Generate the URL with the signature required for signing up a recipient
        """
        # use the sandbox authorization endpoint if we're using the
        #  sandbox for API calls.
        endpoint_host = 'authorize.payments.amazon.com'
        if 'sandbox' in self.host:
            endpoint_host = 'authorize.payments-sandbox.amazon.com'
        base = "/cobranded-ui/actions/start"

        params['callerKey'] = str(self.aws_access_key_id)
        params['returnURL'] = str(returnURL)
        params['pipelineName'] = str(pipelineName)
        params['maxFixedFee'] = str(maxFixedFee)
        params['maxVariableFee'] = str(maxVariableFee)
        params['recipientPaysFee'] = str(recipientPaysFee)
        params["signatureMethod"] = 'HmacSHA256'
        params["signatureVersion"] = '2'

        if(not params.has_key('callerReference')):
            params['callerReference'] = str(uuid.uuid4())

        parts = ''
        for k in sorted(params.keys()):
            parts += "&%s=%s" % (k, urllib.quote(params[k], '~'))

        canonical = '\n'.join(['GET',
                               str(endpoint_host).lower(),
                               base,
                               parts[1:]])

        signature = self._auth_handler.sign_string(canonical)
        params["signature"] = signature

        urlsuffix = ''
        for k in sorted(params.keys()):
            urlsuffix += "&%s=%s" % (k, urllib.quote(params[k], '~'))
        urlsuffix = urlsuffix[1:] # strip the first &
        
        fmt = "https://%(endpoint_host)s%(base)s?%(urlsuffix)s"
        final = fmt % vars()
        return final