How do I post a node to PayPal after node insert/update? I have an option in my node to "upgrade".

If the user selects this option either when creating a new node or updating an existing node, I would like to post the node data (which includes some Paypal html elements) to Paypal so that it can process a payment.

The node should be inserted/saved regardless of the payment result. I need to specify via Paypal what the return URL is and with inserting node's I wont know that until after the node is inserted.

Is there a way to post to 2 places? I know that doesnt really make sense but im just looking for a solution.
If you want to send this information and get and nid, the best place to do this is in:


hook_node_insert() to execute this action just after inserting the node and to have a nid.
hook_node_update() to execute this action just after updating the node.