Remove code duplicated and add payment_request_uid to possible add payment_request in the query