Difference between revisions of "X-Cart:Payment methods not working in X-Cart 4.1.x"
(Created page with "After upgrading to PHP 5.4 or later, users of X-Cart 4.1.x may experience a problem with their payment methods: after a buyer goes to complete their payment on the payment pro...") |
m (# If register_long_arrays = off (php5) is added) |
||
Line 3: | Line 3: | ||
To fix the problem, you will need to add the following code snippet: | To fix the problem, you will need to add the following code snippet: | ||
<pre> | <pre> | ||
+ | # If register_long_arrays = off (php5) | ||
if (empty($HTTP_SERVER_VARS)) { | if (empty($HTTP_SERVER_VARS)) { | ||
$HTTP_SERVER_VARS = (array)$_SERVER; | $HTTP_SERVER_VARS = (array)$_SERVER; |
Latest revision as of 14:18, 27 May 2016
After upgrading to PHP 5.4 or later, users of X-Cart 4.1.x may experience a problem with their payment methods: after a buyer goes to complete their payment on the payment processor end, they are either not returned to the X-Cart store, or the order status in X-Cart remains "Not Finished" (not updated to "Processed") due to payment callback failure. (Note that X-Cart 4.2.x and later versions are not affected by this problem).
To fix the problem, you will need to add the following code snippet:
# If register_long_arrays = off (php5) if (empty($HTTP_SERVER_VARS)) { $HTTP_SERVER_VARS = (array)$_SERVER; $HTTP_GET_VARS = (array)$_GET; $HTTP_POST_VARS = (array)$_POST; $HTTP_COOKIE_VARS = (array)$_COOKIE; $HTTP_POST_FILES = (array)$_FILES; $HTTP_ENV_VARS = (array)$_ENV; }
to the beginning of payment method file for every payment method you will be using. For instance, for "PayPal Standard" you will need to add the above code snippet to payment/ps_paypal.php, for "AuthorizeNet - SIM" - to payment/cc_authorizenet_sim.php.