问题描述
基本上,我只是想在人们购买艺术品并将其发送给他们后关闭按钮.我还希望获得他们的信息的副本.这是我通过数组传递的内容:
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 protected]" />
<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="return" value="http://mydomain.com/thankyou.php" />
<input type="submit" value=" " class="button" />
</form>
如何在数据库中设置一个卖出字段并在php中显示/隐藏我的按钮?
How do I setup a sold field in my database and show/hide my button in php?
我需要使用IPN,API来实现它吗?
IPN, API which do I need to use to make it happen?
干杯!
推荐答案
当IPN出现时,我将设置IPN侦听器以将商品的状态标记为在其数据库表中出售(您是根据数据库生成该表格的?).返回已验证",并且payment_status =已完成".然后,仅在商品未售出时生成该表格.
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.
如果您不知道如何实现IPN侦听器,请参阅以下教程:使用PHP的PayPal IPN
If you don't know how to implement an IPN listener, here is a tutorial: PayPal IPN with PHP
这篇关于在PHP画廊中使用Paypal立即购买表格,请帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!