繁体   English   中英

PayPal-使用PHP付款后

[英]PayPal - after payment with php

我在我的网站上设置了一个付款按钮,用户可以选择他们想要的东西并进行罚款。 我正在努力解决的问题是如何给他们所支付的钱。 因此,例如,他们花了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语句以更改用户对该书的访问权限。

我发现本教程在涉及贝宝形式时非常有用: http : //www.micahcarrick.com/paypal-ipn-with-php.html

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM