def METHOD_NAME(encoded_payment: Union[bytes, str]) -> Payment:
    "Does not decode for explanationData"
    if type(encoded_payment) == str:
        encoded_payment = bytes.fromhex(encoded_payment)
    (
        rewardProgramID,
        paymentCycle,
        validFrom,
        validTo,
        tokenType,
        payee,
        transferData,
    ) = decode_abi(
        ["address", "uint256", "uint256", "uint256", "uint256", "address", "bytes"],
        encoded_payment,
    )
    (token, amount) = decode_abi(["address", "uint256"], transferData)
    return Payment(
        {
            "rewardProgramID": rewardProgramID,
            "paymentCycle": paymentCycle,
            "validFrom": validFrom,
            "validTo": validTo,
            "tokenType": tokenType,
            "payee": payee,
            "token": token,
            "amount": amount,
        }
    )