Useing xmpp complete the process a payment?

Edit

by using xmpp i want to complete the process a payment A user send bill to B user, B after confirm the payment, reply message to A, tigase extension server need to record A bill sent and set the timeout for bill B reply modify the bill state to pay the complete ,How to customize messages and intercept processing ?