def METHOD_NAME(
    validation_url: str,
    merchant_identifier: str,
    domain: str,
    display_name: str,
    certificate: str,
) -> dict:
    request_data = {
        "merchantIdentifier": merchant_identifier,
        "displayName": display_name,
        "initiative": "web",
        "initiativeContext": domain,
    }
    try:
        response = make_request_to_initialize_apple_pay(
            validation_url, request_data, certificate
        )
    except requests.exceptions.RequestException:
        logger.warning("Failed to fetch the Apple Pay session", exc_info=True)
        raise PaymentError(
            "Unable to create Apple Pay payment session. Make sure that input data "
            " and certificate are correct."
        )
    if not response.ok:
        # FIXME: shouldn't we forward some details here?
        raise PaymentError(
            "Unable to create Apple Pay payment session. Make sure that input data "
            " and certificate are correct."
        )
    return response.json()