Error when they make a paid order

27.06.2023 09:05
#1
cagibaja
Joomshopping forum user no avatar
Name: cagibaja
11.03.2022
Posts: 71
Quote
Error when they make a paid order

Hello, when I place an order and they pay by redsys pos, the payment arrives correctly to the account, the emails of the orders arrive, everything is fine, but on the other hand, on the web it stays with the basket full and it gives me that error but in reality Everything has arrived fine, how can I solve it so that the basket remains empty and does not cause that error? "Invalid firma. order ID 553"
ivalidfirma.png
Error when they make a paid order
ivalid1.jpg


Joomla: 4.3.2
JoomShopping: 5.1.2
PHP: 8.0
MySQL: 5.7.35-cll-lve - MySQL Community Server - (GPL)
Website Url: https://libreriaaranda.es/

Last change: 27.06.2023 09:06
 
27.06.2023 09:39
#2
cagibaja
Joomshopping forum user no avatar
Name: cagibaja
11.03.2022
Posts: 71
Quote
Aw: Error when they make a paid order

This is the plugin where it gives the "signature" error:


<?php
defined('_JEXEC') or die('Restricted access');
include_once 'redsysapi.php';

class pm_redsys extends PaymentRoot{

function showPaymentForm($params, $pmconfigs){
include(dirname(__FILE__)."/paymentform.php");
}

//function call in admin
function showAdminFormParams($params){
$array_params = array('testmode', 'transaction_end_status', 'transaction_pending_status', 'transaction_failed_status');
foreach ($array_params as $key){
if (!isset($params[$key])) $params[$key] = '';
}
$jv = new JVersion();
$orders = JModelLegacy::getInstance('orders', 'JshoppingModel'); //admin model
include(dirname(__FILE__)."/adminparamsform.php");
}

function checkTransaction($pmconfigs, $order, $act){
$miObj = new RedsysAPI;
$version = $_POST["Ds_SignatureVersion"];
$datos = $_POST["Ds_MerchantParameters"];
$signatureRecibida = $_POST["Ds_Signature"];
$decodec = $miObj->decodeMerchantParameters($datos);
//$key = 'sq7HjrUOBfKmC576ILgskD5srU870gJ7'; //test
$clave = $pmconfigs['clave'];
$key = $clave;
$firma = $miObj->createMerchantSignatureNotif($key, $datos);
\JSHelper::saveToLog("paymentdata.log", print_r($decodec, 1));

if ($firma === $signatureRecibida) {
$autorizada = false;
$Ds_Response = $miObj->getParameter("Ds_Response");
\JSHelper::saveToLog("paymentdata.log", 'ds_response='.$Ds_Response);
if ($Ds_Response >= '0000' && $Ds_Response <= '0099'){
$autorizada = true;
}
elseif($Ds_Response == '0900' || $Ds_Response == '0930') {
$autorizada = true;
}
$pedido = $miObj->getParameter("Ds_Order");//order_number;
if ($autorizada) {
return array(1, '');
} else {
return array(3, "autorizada false. Order ID " . $order->order_id);
}
} else {
\JSHelper::saveToLog("paymentdata.log", 'firma='.$firma);
return array(0, 'Invalid firma. Order ID ' . $order->order_id);
}
}

function showEndForm($pmconfigs, $order){
if ( $pmconfigs['testmode'] ) {
$url_tpvv='https://sis-t.redsys.es:25443/sis/realizarPago'; //test
} else {
$url_tpvv='https://sis.redsys.es/sis/realizarPago'; //real
}
// Valores constantes del comercio
$clave=$pmconfigs['clave'];
$name=$pmconfigs['fiscal'];
$code=$pmconfigs['codigo'];
$terminal=$pmconfigs['terminal'];
$currency=978; //euro

$transactionType='0';
$order = (array) $order;
$amount = $order['order_total'] * 100;
$ordernum = $order['order_number'];// . date('ymdHis');
$notify_url = JURI::root() . "index.php?option=com_jshopping&controller=checkout&task=step7&act=notify&js_paymentclass=pm_redsys&no_lang=1&oid=".$order['order_id'];
$return = JURI::root(). "index.php?option=com_jshopping&controller=checkout&task=step7&act=return&js_paymentclass=pm_redsys&oid=".$order['order_id'];
$cancel_return = JURI::root() . "index.php?option=com_jshopping&controller=checkout&task=step7&act=cancel&js_paymentclass=pm_redsys";

$urlMerchant=$notify_url;//callback
$urlMerchantOK=$return;
$urlMerchantKO=$cancel_return;

$miObj = new RedsysAPI;

// Valores de entrada
$merchantCode = $code;
$terminal = $terminal;
$amount = $amount;
$currency = "978";
$transactionType = "0";
$merchantURL = $notify_url;
$urlOK = $return;
$urlKO = $cancel_return;
$order = $ordernum;

// Se Rellenan los campos
$miObj->setParameter("DS_MERCHANT_AMOUNT",(string)$amount);
$miObj->setParameter("DS_MERCHANT_ORDER",strval($order));
$miObj->setParameter("DS_MERCHANT_MERCHANTCODE",$merchantCode);
$miObj->setParameter("DS_MERCHANT_CURRENCY",$currency);
$miObj->setParameter("DS_MERCHANT_TRANSACTIONTYPE",$transactionType);
$miObj->setParameter("DS_MERCHANT_TERMINAL",$terminal);
$miObj->setParameter("DS_MERCHANT_MERCHANTURL",$merchantURL);
$miObj->setParameter("DS_MERCHANT_URLOK",$urlOK);
$miObj->setParameter("DS_MERCHANT_URLKO",$urlKO);

//Datos de configuraci�n
$version="HMAC_SHA256_V1";
//$key = 'sq7HjrUOBfKmC576ILgskD5srU870gJ7';//Clave secreta del terminal modo test!
$key=$clave;
//$key = 'Hw0IRwc1VzvAIzKGfPejSSnn6Hhit8da';

// Se generan los par�metros de la petici�n
$request = "";
$params = $miObj->createMerchantParameters();
$signature = $miObj->createMerchantSignature($key);

$urlPago = $url_tpvv;
//print_r($miObj);exit;
?>
<html lang="es">
<head>
</head>
<body>

<form name="compra" action=" <?php echo $urlPago ?>" method="POST">
<input type="hidden" name="Ds_SignatureVersion" value="<?php echo $version; ?>"/></br>
<input type="hidden" name="Ds_MerchantParameters" value="<?php echo $params; ?>"/></br>
<input type="hidden" name="Ds_Signature" value="<?php echo $signature; ?>" /></br>
<script>document.compra.submit();</script>
<!-- <input type="submit" />-->
</form>

</body>
</html>
<?php
}

function getUrlParams($pmconfigs) {
$params = array();
$params['order_id'] = \JFactory::getApplication()->input->getInt("oid");
$params['hash'] = '';
$params['checkHash'] = 0;
$params['checkReturnParams'] = 1;
return $params;
}
}

 
27.06.2023 10:44
#3
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25942
Quote
Aw: Error when they make a paid order

Contact to developer redsys

or

Buy
https://www.webdesigner-profi.de/joomla-webdesign/shop/license-key/joomshopping-licensekey.html
for more help

 
27.06.2023 10:59
#4
cagibaja
Joomshopping forum user no avatar
Name: cagibaja
11.03.2022
Posts: 71
Quote
Aw: Error when they make a paid order

We already bought that in its day for you to help us..

 
27.06.2023 11:01
#5
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25942
Quote
Aw: Error when they make a paid order

order number?

 
27.06.2023 11:05
#6
cagibaja
Joomshopping forum user no avatar
Name: cagibaja
11.03.2022
Posts: 71
Quote
Aw: Error when they make a paid order

Bestell-Nummer: 06-KH-116343

 
27.06.2023 11:15
#7
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25942
Quote
Aw: Error when they make a paid order

Order with
Multi shops
Domain: www.libreriaaranda.es

 
27.06.2023 11:20
#8
cagibaja
Joomshopping forum user no avatar
Name: cagibaja
11.03.2022
Posts: 71
Quote
Aw: Error when they make a paid order

We also buy you: 07-KH-116386

Can't you help me? It must be some nonsense, everything works perfectly, only that "invalid signature" message appears, but it works fine, I want at least that message not appear. Thank you

 
27.06.2023 16:24
#9
cagibaja
Joomshopping forum user no avatar
Name: cagibaja
11.03.2022
Posts: 71
Quote
Aw: Error when they make a paid order

help me when you can please, thanks

 
28.06.2023 08:41
#10
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25942
Quote
Aw: Error when they make a paid order

Sorry. It takes time to figure out someone else's code.

See
https://www.joomshopping.com/forum/posts/10/16055.html?lang=en#3

 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.