Using paypal buy now form in php gallery please help
Basically I just want to turn off the button after people purchase the art and send them a receipt. I would also like to have a copy of their information. This is what I am passing through my array:
<form method="post" action="https://www.paypal.com/cgi-bin/webscr">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="email@mydomain.com" />
<input type="hidden" name="item_name" value="<?php echo $title; ?> (ID:#<?php echo " {$p['id']}" ?>)" />
<input type="hidden" name="item_number" value="<?php echo "{$p['id']}" ?>" />
<input type="hidden" name="amount" value="<?php echo "{$p['price']}" ?>" />
<input type="hidden" name="shipping" value="39.99" />
<input type="hidden" name开发者_C百科="return" value="http://mydomain.com/thankyou.php" />
<input type="submit" value=" " class="button" />
</form>
How do I setup a sold field in my database and show/hide my button in php?
IPN, API which do I need to use to make it happen?
Cheers!
I would setup the IPN listener to mark the item's status as sold in it's database table (you are generating that form based on a database?) when the IPN comes back "VERFIFIED" and payment_status = 'Complete'. Then, only generate that form when the item is not sold.
If you don't know how to implement an IPN listener, here is a tutorial: PayPal IPN with PHP
精彩评论