I'm using the "PayPal Website Payments Standard " payment method. I received a payment and needed to process a PayPal refund. I processed the refund in PayPal. I then saw this notice in my watchdog log:

Notice: Undefined index: txn_type in uc_paypal_ipn() (line 51 of /public_html/sites/all/modules/ubercart/payment/uc_paypal/uc_paypal.pages.inc).

This is the line of code:

$txn_type = check_plain($_POST['txn_type']);

The notice was sandwiched in between a "Receiving IPN at URL for order . " log message and a "IPN transaction verified." log message. It should be possible to reproduce the error by submitting a refund request in PayPal for a payment made using the PayPal Website Payments Standard payment method.

I could submit a patch to get rid of the error by checking if $_POST['txn_type'] is set before attemping to assign the value to $txn_type, but I'm not sure if that's the right thing to do here. What is the right thing to do?

Comments

longwave’s picture

Status: Active » Closed (duplicate)

The watchdog notice is harmless and can be safely ignored. Support for PayPal refunds is already an open issue at #849350: paypal refund status / transition