如何将贝宝集成到我的PHP项目中?

时间:2018-08-26 12:58:12

标签: php paypal

我正在开发一个电子商务网站(作为一个项目),并且我希望在该网站中集成支付网关。在该项目中,当用户单击索引页面上的产品时,他被重定向到product_detail.php,其中有一个立即购买按钮,该按钮会将他引导到付款网关,但我总是收到错误消息 “ BAD_INPUT_ERROR:此刻似乎无法正常工作。请稍后再试。”
  这是我的代码的一部分

<form action="<?php echo $paypalURL; ?>" method="post">
    <!-- Identify your business so that you can collect the payments. -->
    <input type="hidden" name="business" value="<?php echo $paypalID; ?>">

    <!-- Specify a Buy Now button. -->
    <input type="hidden" name="cmd" value="_xclick">

    <!-- Specify details about the item that buyers will purchase. -->
    <input type="hidden" name="item_name" value="<?php echo $row['name']; ?>">
    <input type="hidden" name="item_number" value="<?php echo $row['id']; ?>">
    <input type="hidden" name="amount" value="<?php echo $row['price']; ?>">
    <input type="hidden" name="currency_code" value="INR">
    <INPUT TYPE="hidden" name="charset" value="utf-8">

    <!-- Specify URLs -->
    <input type='hidden' name='cancel_return' value='http://localhost/search/cancel.php'>
    <input type='hidden' name='return' value='http://localhost/search/success.php'>

    <!-- Display the payment button. -->
    <input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online">

</form>

我想念什么吗? (我是php的初学者,我是从网站上学到的),而且我无法在我的Paypal沙箱帐户中启用“自动返回”功能,因为他们无法验证我的返回URL。我需要先托管我的项目,以便它接受我的返回URL吗?

0 个答案:

没有答案
相关问题