Forums / PayPal Website Payments Pro support / Paypal Refund Callback Problem after server move

Paypal Refund Callback Problem after server move

Views: 5,368

Results 1 to 16 of 16
13 Feb 2017, 5:39 PM
#1
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Paypal Refund Callback Problem after server move

Just moved a Zencart install to a new server.

Paypal is communicating back all the info and appending comments when a sale is made.

However on refunds, It is not appending the refund comments and changing the orders status as before.

Refunds are completing on the paypal side.

Most likely a server mis-configuration or permissions error.

Any ideas?

13 Feb 2017, 6:29 PM
#2
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Paypal Refund Callback Problem after server move

To Clarify:

Paypal is writing the refund info into -> paypal_payment_status_history

It is not writing to here -> orders_status_history

Or updating the order status as it used to.

13 Feb 2017, 7:37 PM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Paypal Refund Callback Problem after server move

So that's the only change that was made? Movement of the store to a different server? Same uri? All file and cache locations updated to reflect the new server settings? Verified that all files made it to the new server?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Feb 2017, 7:57 PM
#4
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Paypal Refund Callback Problem after server move

The move was done using cpmove. So the entire account came over at once.

Same URL

All the permissions and settings should have been preserved.

Everything else is functioning correctly and as expected.

I think since the order status is not changing, this is what is causing the data not to be written here -> orders_status_history

IPN check is coming back -> RESPONSE RECEIVED - Communications OKAY

CurlTest -> Data validation - Good

  • I saw that curlwrappers is not checked in apache but not sure if it need to be.

I've checked ports 80 and 443 inbound outbound are open.

Check endpoint IPs for blocks in the firewall.

SSL installed correctly. Checked with sslshopper

Don't see any thing that would indicate ipn_main_handler.php access issues.

13 Feb 2017, 8:14 PM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Paypal Refund Callback Problem after server move

A refund generally should initiate at least an inspection of the current status and if the transaction is supposed to be a full refund (not sure why wouldn't use a cancel there, then the status should be dropped back to a lower level. If just a partial then, would expect that the refund action would still get logged regardless of the overall status level.

But one thing in the above discussion is that operation now is different than before yet there is question about the type of signals that are being sent from PayPal such as a status change. Have refunds always been performed from the PayPal site instead of within ZC? When was the last refund performed that was recorded as expected.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Feb 2017, 8:28 PM
#6
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Paypal Refund Callback Problem after server move

They typically perform refunds from the ZC admin.

The refunds right before the server move were working accurately.

So when Paypal would respond that the refund was processed, it would change the status and append the paypal info to -> orders_status_history

The refunds right after the server move didn't do this anymore.

Paypal was still populating here -> paypal_payment_status_history .. so they can reach the db to write.

I think that the process in which the order changes status is the process that will write to -> orders_status_history.

Just like it does when a comment is added to an order.

But for some reason; now, the order status change submission is not taking place.

13 Feb 2017, 8:48 PM
#7
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Paypal Refund Callback Problem after server move

You said that cpmove was used to transfer to the new server, are you saying that the software modifies the includes/configure.php files as well as updates the folder name associated with session path info in configuration->sessions and further that the store wasn't moved in accordance with the following instruction?

https://www.zen-cart.com/content.php?141-is-it-possible-to-create-build-a-complete-zen-cart-setup-on-a-test-server-and-then-install-on-a-live-server

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Feb 2017, 9:13 PM
#8
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Paypal Refund Callback Problem after server move

Site was not moved that way. It was done at the account level.

CPmove is a WHM/CPanel Server Level move tool that moves the entire account.

I am the ISP and administrator for both servers.

None of the locations change.

The session directory setting is accurate and populates as such with new orders.

Everything else is functioning correctly.

13 Feb 2017, 9:19 PM
#9
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Paypal Refund Callback Problem after server move

Thought I had asked this question, but it's not in the timeline so guess I didn't. What version of ZC?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Feb 2017, 9:52 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Paypal Refund Callback Problem after server move

djdavedawson:

Most likely a server mis-configuration or permissions error.
Not likely. If other IPN actions are completing properly, then refunds should too.

Next steps:
Enable IPN debug logging.
Do a refund.
Post the IPN logs showing exactly what it's doing. ... you can decipher this data for troubleshooting purposes too.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Feb 2017, 1:59 AM
#11
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Paypal Refund Callback Problem after server move

So the debug logs aren't where i'd thought they'd be.

I thought they would be at includes/modules/payment/paypal/logs but the folder was empty.

I set it for email too and here are a few things I found:

IPN FATAL ERROR :: Could not find stored session in DB, cannot re-create
session as PayPal IPN transaction.

IPN FATAL ERROR :: No saved IPN session data available. Must be an Express
Checkout or Direct Pay transaction.

Interesting though I saw where it asks for the status update but no other message after.

IPN NOTICE :: Updating order #49459 to status: 1 (txn_type: parent)

14 Feb 2017, 2:27 AM
#12
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Paypal Refund Callback Problem after server move

OK Getting Closer :

PHP Fatal error: 1366:Incorrect integer value: '' for column 'customer_notified' at row 1 :: INSERT INTO zen_orders_status_history (orders_id, orders_status_id, date_added, comments, customer_notified) VALUES ('49459', '1', now(), 'PayPal status: Refunded @ 17:08:29 Feb 13, 2017 PST\n Parent Trans ID:7W349436LG777561N\n Trans ID:2A3958908J8132115\n Amount: -11.55 USD', '') in /home/account/public_html/includes/classes/db/mysql/query_factory.php on line 98

Line 98

function show_error() {
    if ($this->error_number == 0 && $this->error_text == DB_ERROR_NOT_CONNECTED && !headers_sent() && file_exists('nddbc.html') ) include('nddbc.html');
    echo '<div class="systemError">';
    if (defined('STRICT_ERROR_REPORTING') && STRICT_ERROR_REPORTING == true) 
    {
      echo $this->error_number . ' ' . $this->error_text;
      echo '<br />in:<br />[' . (strstr($this->zf_sql, 'db_cache') ? 'db_cache table' : $this->zf_sql) . ']<br />';
    } else {
      echo 'WARNING: An Error occurred, please refresh the page and try again.';	
    }
    trigger_error($this->error_number . ':' . $this->error_text . ' :: ' . $this->zf_sql, E_USER_ERROR);
    if (defined('IS_ADMIN_FLAG') && IS_ADMIN_FLAG==true) echo 'If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.<br />';
    echo '</div>';
  }
14 Feb 2017, 3:08 AM
#13
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Paypal Refund Callback Problem after server move

Something on the new server is not treating false as 0.

 'customer_notified' => false

The sql input statement is created here in paypal_functions.php:

$sql_data_array = array('orders_id' => (int)$ordersID,
                            'orders_status_id' => (int)$new_status,
                            'date_added' => 'now()',
                            'comments' => 'PayPal status: ' . $_POST['payment_status'] . ' ' . ' @ ' . $_POST['payment_date'] . (($_POST['parent_txn_id'] !='') ? "\n" . ' Parent Trans ID:' . $_POST['parent_txn_id'] : '') . "\n" . ' Trans ID:' . $_POST['txn_id'] . "\n" . ' Amount: ' . $_POST['mc_gross'] . ' ' . $_POST['mc_currency'],
                            'customer_notified' => false
14 Feb 2017, 3:23 AM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Paypal Refund Callback Problem after server move

You're probably using a version of MySQL newer than what your version of Zen Cart was originally designed for.
I imagine you need the following change to deal with that last error message: https://github.com/zencart/zencart/pull/1320/files

... and will probably benefit from other upgrades to support the stricter implementation of newer versions of MySQL.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Feb 2017, 4:04 AM
#15
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Paypal Refund Callback Problem after server move

Looks like the mysql version on the new server is 5.6 vs 5.5 and the sql mode of the new server is

-> STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION

I will implement the fix and post if any other issues occur.

Thanks Dr B and MC

25 Jan 2018, 9:03 PM
#16
sdelaney avatar

sdelaney

New Zenner

Join Date:
Feb 2010
Posts:
45
Plugin Contributions:
0

Re: Paypal Refund Callback Problem after server move

I have this exact same issue after upgrading my site to 1.5.5f ... partial refund initiated in ZC is processed by PayPal, but the refund is not showing up in ZC as it used to do before the upgrade. We are on the same server, etc ... the "only" change is the upgrade.

Please advise, did this fix discussed above work?

Just checked my code for the php file, and the recommended change is already in place. So there must be some other issue.