PayPal不给ids

时间:2017-03-18 15:07:56

标签: php paypal

我有以下问题。

我将Paypal集成到了我的网站。现在我想测试PayPal设置。我在沙箱环境中测试它。所以付款工作得很好,付款后网站重定向到我的success.php网站。 我有一个问题。 Normaly它应该显示mywebsite.de/success.php?tx=83437E384950D&st=Completed&amt=10.00&cc=USD&cm=&item_number=1

之类的东西

但它只显示

mywebsite.de/success.php

我的代码看起来像这样

paypalURL = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; //Test PayPal API URL
$paypalID = 'mywebsite@site.de'; //Business Email
                    <center><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="1 Monat Premium Mitgliedschaft">
    <input type="hidden" name="item_number" value="1">
    <input type="hidden" name="amount" value="49.99">
    <input type="hidden" name="currency_code" value="EUR">

      <!-- Specify URLs -->
    <input type='hidden' name='cancel_return' value='http://mywebsite.de/index.php'>
    <input type='hidden' name='return' id='return' value='http://mywebsite.de/success.php/'>

    <!-- Display the payment button. -->
    <input type="image" name="submit" border="0"
    src="https://www.paypalobjects.com/de_DE/DE/i/btn/btn_buynowCC_LG.gif" alt="PayPal - The safer, easier way to pay online">
    <img alt="" border="0" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
                    </form></center>

我错误的是如何获得我的成功页面的paypal信息?

1 个答案:

答案 0 :(得分:0)

Pass the rm variable with value as 2, refer the below:

<input type="hidden" name="rm" value="2">

Once you pass rm=2 then you will see the below variables after the buyer redirect to your website: http://mywebsite.de/success.php/?amt=10.84&cc=USD&item_name=XXXXX&st=Completed&tx=XXXXXXX