This may be the wrong place to ask. sorry if thats the case.

I need to understand how the main ipn handler knows what order to apply info to.

I am working on a layaway mod upgrade that will post an ipn to the order when a layaway payment is paid.

Right now I just get the order number from the confirmation email and use that to update the order in admin - orders

But I am tryibg to have the payment show up in the order the same way a refund does. can anyone point me at something that would help me understand. I program basic php but I am not at a level to get very far into zen files.

Thanks in advance for any help with this.