php: add check function for payment