Fix undefined index in payments query when specifying download