Ok, I've semi solved it. My line numbers may be off a bit because I've been adding and removing temp code that would send variables to files so I could find out what was going on.
But on line 359 or thereabouts (in virtualmerchant.php) is this line:
$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&virtualmerchant_cc_owner=' . urlencode($_POST['virtualmerchant_cc_owner']) . '&virtualmerchant_cc_expires_month=' . $_POST['virtualmerchant_cc_expires_month'] . '&virtualmerchant_cc_expires_year=' . $_POST['virtualmerchant_cc_expires_year'] . '&virtualmerchant_cvv_number=' . $_POST['virtualmerchant_cvv_number']. '&virtualmerchant_cvv_indicator=' . $_POST['virtualmerchant_cvv_indicator'];
I finally isolated that one variable in there is causing the problem and it is this:
'&error=' . urlencode($error)
So, I removed that bit from the code. Now the code is able to call the checkout_payment page, and the checkout_payment page displays that an unknown error occurred.
I've been able to establish that that the problem bit is resolving to this:
&error=The+credit+card+number+starting+with+5665+was+not+entered+correctly%2C+or+we+do+not+accept+that+kind+of+card.+Please+try+again+or+use+another+credit+card.
I tried hard coding the value of the error with portions of that string, and it will return correctly with:
&error=The+credit+card+number+starting+with+5665
When it returns, checkout_payment correctly reports that the error was "The credit card number starting with 5656", as it should. If I try to add any more of the string to my hard code, I get the error again.
By making a different type of error I was able to get the urlencode($error) to return this:
The+expiration+date+entered+for+the+credit+card+is+invalid.+Please+check+the+date+and+try+again.
That looks pretty benign to me, but it also caused the same error condition.
So I've had to conclude, at this point, that the problem is above my pay grade. For some reason, trying to return to the checkout_payment page with the &error= set to the actual error text causes the page to barf.
I've removed the "&error=..." part out of my code, and my checkout_payment page now just displays that an unknown error occurred. Not the best, but not the end of the world either.
I'll stay tuned if something else comes up on this, and of course will be happy to test any fixes.
You might be able to reproduce the problem on your own server by just typing in a garbage credit card number. I've been typing in a visa number of 4545454545454545 with cvv code of 455. That always causes it on my server.
I'm off to bed. Thanks for listening.
:sleep1: