sasori
sasori

Reputation: 5463

why am I getting payment_status as pending on paypal sandbox?

I am always getting a "Pending" [payment_status] response from paypal sandbox, that's why my code for inserting data to the db doesn't work at all. Whenever I do checkout and complete the payment, this is the response am getting from the returned data

Array
(
    [mc_gross] => 12.00
    [protection_eligibility] => Ineligible
    [address_status] => confirmed
    [item_number1] => 2
    [payer_id] => TRCLJTHLNCJ7Q
    [tax] => 0.00
    [address_street] => 1 Main St
    [payment_date] => 20:15:44 Jan 01, 2012 PST
    [payment_status] => Pending
    [charset] => windows-1252
    [address_zip] => 95131
    [mc_shipping] => 10.00
    [mc_handling] => 0.00
    [first_name] => Test

it's always pending, when everything with regards to payment was completed and the test account overview itself, is showing the payment was completed.

that's why this part of the code, doesn't work at all because of the "Pending" thing

if (!$fp) {
// HTTP ERROR
} else {
fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
if (strcmp ($res, "VERIFIED") == 0) {

    if ($_POST['payment_status'] == 'Completed'
          && no_paypal_trans_id($_POST['txn_id'])
            && $paypal_email == $_POST['receiver_email']
            && $paypal_currency == $_POST['mc_currency']
            && payment_amount_correct($shipping, $_POST)
            )
    {
     // process payment
         create_order($_POST);

    }

}
else if (strcmp ($res, "INVALID") == 0) {
// log for manual investigation
}
}
fclose ($fp);
}

any ideas how to fix this ? or why is this happening on the paypal's returned response ?

Upvotes: 3

Views: 16012

Answers (6)

user559533
user559533

Reputation:

If the Sandbox Account that is receiving the payment is of type "Personal", then IPN will send payment_status=Pending.

Upvotes: 1

Mr.TK
Mr.TK

Reputation: 1836

I was receiving this info while sending wrong business email address:

[pending_reason] => unilateral

If someone will have that too try changing your business (not your client / buyer but seller) email address.

Upvotes: 0

Jadeye
Jadeye

Reputation: 4329

After dealing with this problem a little & PayPal changing the UI,

Here are the exact instructions from PayPal Merchant Technical Support:

Thank you for contacting Merchant Technical Support.

Please try to follow the instructions below to turn off the Payment Review function for your Sandbox account:

  • Go to PayPal Developer Website
  • Log in to your developer account
  • Click Applications
  • Click Sandbox accounts
  • Click on to the email address that you would like to turn off the Payment Review option and click Profile after it expand
  • Click Settings
  • And select Off for the Payment review.
  • Click Close

!!! Make sure you are doing this on your PayPal SandBox Merchant Account!

& Thats what it looks like:

enter image description here

Upvotes: 3

VietBV
VietBV

Reputation: 1

Login to your Sandbox Developer Account. Click on the Test Accounts link. You should see your Test Accounts on the right side of the screen. Notice the Payment Review column. If you see Enabled for your Accounts, click on it, You should now see Disabled.

Regards,

Upvotes: 0

Mangirdas Skripka
Mangirdas Skripka

Reputation: 1647

If "Payment review" solution provided by Robert doesn't work, another reason why it might happen is that your seller account has option to accept or decline payment if it buyer has unconfirmed address or different currency. In this case you need to login as seller and accept payment and you will get another IPN with payment_status=Completed

Steps:

  1. open paypal sandbox
  2. press "test accounts" on the left
  3. select seller account and press "Enter sandbox test site" on the bottom
  4. You should see all the payment with option to accept or decline each of them

Upvotes: 0

Robert
Robert

Reputation: 19356

Turn off 'Payment review' for the account on https://developer.paypal.com/ > 'Test Accounts'.

Note: This info is also available in the 'pending_reason' response, which will give more descriptive information why it's pending (as you may see this occur in the live environment for payment reviews by PayPal or echeck transactions as well).

Upvotes: 14

Related Questions