import json


def getResponseUrl(response):
    """
    Get the return url from a hosted payment API call
    :param response: Response object in JSON
    :return: Transaction ID
    """

    resp_dict = json.loads(response.text)

    try:
        url = resp_dict["url"]
    except KeyError:
        print('Retrieval unsuccessful.')
        return None

    return int(url)