Question

I'm trying to check the payment Status over IPN of PayPal and there is a problem. I'm using this

and I have some checks for Fraud one on which is:

if ( $_POST['payment_status'] != 'Completed' ) {
        // simply ignore any IPN that is not completed
        $errmsg .= "Payment not completed! But ".$_POST['payment_status']."\n";
}

The problem is that payment_status isn't sent and the Payment is not processed in my code. Also I found the same issue with mc_amount3 and mc_gross. One time PayPal send mc_amount3 and one time mc_gross. I couldn't find information in the web or on the Search or in the PayPal.

I'm really confused.

Was it helpful?

Solution

From the IPN Variables reference:

mc_amount3: Amount of payment for regular subscription period, regardless of currency. mc_gross: Full amount of the customer's payment, before transaction fee is subtracted. Equivalent to payment_gross for USD payments. If this amount is negative, it signifies a refund or reversal, and either of those payment statuses can be for the full or partial amount of the original transaction.

As far as the payment_status not being included, that is a variable that should be passed. It is possible that the payment_status is coming back as 'Pending' or 'Processed' instead, causing the script to fail. Try writing out to an error log what the payment_status is.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top