Jump to content

Postfinance Payment Module Error 500 after transaction done


WEMS

Recommended Posts

When I active debug mode I get error message by adding a product in the cart: 

 

Impossible to add the product to the cart.

textStatus: 'parsererror'
errorThrown: 'SyntaxError: Unexpected token < in JSON at position 0'
responseText:

Notice: Trying to get property of non-object in /home/swissp8/public_html/swissprimenails.ch/classes/Tools.php on line 1222
{"products":[{"id":1864,"link":"http:\/\/www.swissprimenails.ch\/index.php?id_product=1864&controller=product&id_lang=1","quantity":2,"image":"http:\/\/www.swissprimenails.ch\/img\/p\/en-default-thumb_default.jpg","image_wid

Link to comment
Share on other sites

ok, I don't know exact answer to issue.  It's all rather odd.  At this point I would consider posting in job offers.  There I think you will find someone that can debug/fix for very small charge.  The .js error is what makes all this so difficult as it's the least informative.

 

Find your php error log from hosting control panel,  I am not 100% sure the error you see from browser is the actual error...maybe we see some good info there.

Link to comment
Share on other sites

  • 5 months later...

Dear all,

 

exactly the same problem. In postfinance backend I see the transaction correct, but the prestashop show "hack attempt". The payment is not successful. Still waiting for an answer. 

 

@WEMS, do you resolve your problem?

 

Thanks and regards

 

Cheng

Link to comment
Share on other sites

The most expensive one from PrestaShop team. The name is "PostFinance Payment", but currently I can not find it on the prestashop market, therefore no link. I drop message to the support, but no answer. 

 

Do you get the same one?

Link to comment
Share on other sites

@WEMS: if you mean the 4 modules showed after you search for "PostFinance", then none of them. The module name is exactly "PostFinance Payment". 

 

@El Patron: thanks for your feedback. No, I don't get the php error (500), only "Hack attempt". The same as I go directly to: "http://www.mind-werk.ch/modules/postfinance/validation.php" without any parameters. What do you mean with "never progress"? 

 

The validation.php is as following:

<?php
/**
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author    PrestaShop SA <[email protected]>
* @copyright 2007-2015 PrestaShop SA
* @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/


include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/postfinance.php');


$post_finance = new PostFinance();
$values = $post_finance->getReturnValues();


$live_mode = (int)Configuration::get($post_finance->name.'_LIVE_MODE');
$response_code = $values['NCERROR'];


$order_msg = '';
/* Check 3D Secure */
if (isset($values['STATUS_3D']))
{
$status_3d = pSQL($values['STATUS_3D']);
if ($status_3d != 'Y')
$order_msg .= '3D Secure failure. Returned 3D Secure status :'.$status_3d;
}


if ($live_mode === 0) /* If module is in testing mode */
{
if (empty($order_msg) && $response_code == '0')
{
$order_msg = '***TEST*** : '.$post_finance->l('Validated Payment')."\n";
$statut = _PS_OS_PAYMENT_;
}
else
{
$order_msg = '***TEST*** : '.$post_finance->l('Invalid Payment')."\n".$response_code;
$statut = _PS_OS_ERROR_;
}
}
elseif ($live_mode === 1) /* If module is in production mode */
{
if ($response_code == '0' && empty($order_msg))
$statut = _PS_OS_PAYMENT_;
else
$statut = _PS_OS_ERROR_;
}


/* Create an order message for the order page */
$order_msg .= "\n".$post_finance->l('Total paid :').' '.(float)$values['AMOUNT']."\n";
$order_msg .= "\n".$post_finance->l('Credit/debit card brand :').' '.$values['BRAND']."\n";
$order_msg .= "\n".$post_finance->l('Order Status :').' '.$statut."\n";
$order_msg .= $post_finance->checkForError($response_code);
$order_msg .= "\n\n".$post_finance->l('Debug info:')."\n".' POST '.print_r($_POST, true)."\n".'GET '.print_r($_GET, true)."\n";


$id_cart = (int)Tools::substr($values['ORDERID'], 8, strpos($values['ORDERID'], '_('));


$post_finance->validate($id_cart, (float)$values['AMOUNT'], $values['PAYID'], $statut, $order_msg);


$urls = $post_finance->getUrls($id_cart);


Tools::redirectLink($urls['ok']);
Link to comment
Share on other sites

As Agency we always use this module for Postfiance Payment: http://www.webbax.ch/shop/modules-de-paiement/123-module-postfinance.html

Postfinance PSIP settings are a little complex and I still have to take extremely attention after a new installation. The error you get is for sure because PSIP of postfiance don't forward you back to the right domain or something like that.

Ask a refund when you do not get support from Developer and buy the one I send you. They are good and always ready to help.

 

Good luck !

Link to comment
Share on other sites

HI WEMS,

 

thanks. I had called Postfinance, they told me that he had tested in my account and ensured the feedback come to prestashop module.

 

I'll wait for two more days for support by prestashop. If nothing happen in 2 days, I have to send this module back and buy another one, that works. 

 

By the way, I can not speak French. Do you know whether there is support by the module you suggested?

 

Regards

 

Cheng

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...