IPN will not be happening within a browser at all. PayPal’s server sends the data to a listener script on your server (our plugin), which then triggers the hooks you might have setup.
There won’t be any CSS or anything like that involved. You’ll just be building PHP code to process the PayPal transaction data passed by IPN however you need to.
Thanks for the reply 🙂 So here is what I want to do. Is it possible?
-I have two divs on every post. Div A, id=”sold”, contains the word “sold” and has inline CSS style display: none;
-Div B, id=”buy_now”, contains the PayPal buy now button and the price “$45.00” as text. It has inline CSS style display: initial;
-The WordPress post_id is sent to PayPal in the button parameters as item_number.
When the IPN is returned with status complete, I want to find post_id (which is PayPal item_number) and change the display of Div A and Div B in that post.
Div A will become display: none;.
Div B will become display: block;
Make sense? After the sale is complete, the PayPal button disappears and the word “sold” becomes visible.
(I sell my paintings one at a time at auction on my site. I still want the painting displayed after it is sold. It just needs to say “sold”.)
Is this possible? If so, can you tell me how to do it? I’m not asking for code. I Just don’t understand programmatically what needs to happen 🙂 I can figure out the code once I know what the code needs to do.
Thanks!
James
You should add a meta data field to the product data called something like “status” and it could default to something like “available”.
Build your post styles based on this meta data value, so if the product is available it would display your divs that way, and if the status is sold it would display that way.
Within the IPN function you build you can update the meta data from available to sold.