Getting zero(0) in paypal response?

205 views Asked by At

I have just tried to integrate paypal payment gateway in my site. for that I have followed all the steps which are showed in guideline, I could payment and it shows me successful payment message, I went my account and there also I could see the payment transaction info.but in paypal response (post array) I got zero(0) instead of data.

for that first of all I have made a developer account in paypal, then through I have created one business and one buyer account.

here is my code

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" accept-charset="utf-8">

        <input type="hidden" name="amount" value="21" readonly="" id="qty-1-amt">
        <input type="hidden" name="price" value="21">
        <input type="hidden" name="business" value="[email protected]">
        <input type="hidden" name="cmd" value="_xclick">
        <input type="hidden" name="item_name" value="Test Mobile">
        <input type="hidden" name="item_number" value="Test Item Number">

        <input type="hidden" name="currency_code" value="USD">

        <!-- Specify URLs -->
        <input type="hidden" name="cancel_return" value="http://paymentgateway.alphansotech.com/buyproducts">
        <input type="hidden" name="return" value="http://alphansotech.com/response.php">
        <ul>
            <li>Quantity: <input type="text" name="quantity" value="1" id="qty-1"> </li>
            <li><strong>Total: </strong>$ <span id="qty-1-span">21</span></li>
            <!--<li><input type="submit" name="submit" value="Buy"/></li>-->
            <li> <input type="image" name="submit" border="0" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_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"></li>
        </ul>
        </form>
1

There are 1 answers

2
geewiz On

Per the comments above, you are looking for the data in the wrong place. You are looking in $_POST, whereas by default PayPal puts the return values in $_GET. You need to do one of two things. Either:

1) Change your code from using $_POST to $_GET, or

2) send PayPal the value rm=2 (") to request that PayPal move these return variables from GET parameters to POST parameters. This is documented here:

https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/