pay query