Bappa
Bappa

Reputation: 799

Paypal is showing status 'Pending' after payment

I am trying to integrate the payment gateway in my PHP based application. For that I am using sandbox. But after the payment the status is showing pending, though amount has been deducted from the account.

My code is like:

<form name="frm" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick" />
     <input type="hidden" name="business" value="[email protected]" />
     <input type="hidden" name="amount" value="<?php echo get_plan_value($plan_id); ?>" />
     <input type="hidden" name="no_shipping" value="1" />
     <input type="hidden" name="no_note" value="1" />
     <input type="hidden" name="currency_code" value="USD" />
     <input type="hidden" name="lc" value="US" />
     <input type="hidden" name="item_name" value="<?php echo get_plan_name_by_value($_REQUEST['bus_plan']) ?> Registration" />
     <input type="hidden" name="bn" value="PP-BuyNowBF" />
     <input type="hidden" name="return" value="http://localhost/uploaded_server_alert/backup/alertR/business/payments-over.php?last_id=<?php echo $lastId; ?>&agent_email=<?php echo $agent_email; ?>&username=<?php echo ($uname); ?>&contact_email=<?php echo $contact_email; ?>" />
     <input type="hidden" name="rm" value="2" />

     <input type="submit"  border="0" name="submit" value="Order Now" alt="Make payments with PayPal - it's fast, free and secure!" class="additional_height" title="Make payments with PayPal - it's fast, free and secure!" />
     <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" /> 
  </form>

How shall I fix the problem?

Upvotes: 1

Views: 1043

Answers (3)

Atul Rai
Atul Rai

Reputation: 350

Problem is that you have not mentioned the notify_url. notify_url is the url where paypal send IPN for authentication of item price, reciever_email, currency etc and notify_url should not be the url of localhost because when you have been redirected to paypal now you are on paypal's domain and after completion of transaction when paypal try to send IPN hit it will get the` ulr of localhost and there is nothing like localhost on paypal.

Write following input tag: 

<input type="hidden" id="notify_url" name="notify_url" value="url of ipn listener"/> 

in above tag replace value by your ipn listener url.

Upvotes: 0

Philip F
Philip F

Reputation: 86

Double check your IPN Listener and IPN Handler.

See some sample codes:

http://www.micahcarrick.com/paypal-ipn-with-php.html http://www.evoluted.net/thinktank/web-development/paypal-php-integration

Upvotes: 0

Mihai Iorga
Mihai Iorga

Reputation: 39724

That's because Payment Review is enabled.

Change it to Disabled in Developer Central -> Test Accounts

Upvotes: 2

Related Questions