refactoring as_json
add invalidate, cancel, pay
add verify