gpt4 book ai didi

php - PayPal - 使用 php 付款后

转载 作者:太空宇宙 更新时间:2023-11-03 16:08:45 24 4
gpt4 key购买 nike

我在我的网站上设置了一个付款按钮,用户可以选择他们想要的并进行付款。我正在努力解决的问题是如何为他们提供他们付出的代价。例如,他们为一本书支付了 10 美元,我希望在付款完成后将这本书奖励给他们的帐户。

我发现您需要使用 IPN,但为此您需要一个 API,无论它们是什么。这是在 php 中执行此操作的唯一方法吗?对于这样一个简单的任务来说看起来非常复杂,我宁愿让他们向我发送付款,我将手动添加他们支付的内容。

编辑

这是我关注的内容:https://developer.paypal.com/webapps/developer/docs/classic/products/instant-payment-notification/

最佳答案

这就是我在网站中设置 Paypal 结账的方式:

<form name="_xclick" action="https://www.sandbox.paypal.com/cgi-bin/webscr" 
method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="YOUR SANDBOX SELLER EMAIL">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="Digital Download">
<input type="hidden" name="amount" value="9.99">
<input type="hidden" name="return" value="THIS URL">
<input type="hidden" name="notify_url" value="THE URL TO YOUR ipn.php SCRIPT">
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif"
border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

在您的 ipn.php 中,您可以添加一条 sql 语句来更改用户对本书的访问权限。

我发现本教程在涉及 Paypal 表单时非常有用: http://www.micahcarrick.com/paypal-ipn-with-php.html

Paypal 表单 API: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/formbasics/

关于php - PayPal - 使用 php 付款后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28238556/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com