Merge branch 'ticket-13550-FixPayboxDirect' into develop

This commit is contained in:
Marion Muszynski 2017-06-23 10:11:24 +02:00
commit fe9de26a25
5 changed files with 125 additions and 58 deletions

View File

@ -11,6 +11,22 @@ $controller->preProcess();
if (!$cookie->isLogged())
Tools::redirect('authentication.php');
// verif if there's one order already then redirect to the order detail
if ($id_order = (int)Order::getOrderByCartId($cart->id))
{
// log
$content = '';
if (file_exists('logs.txt')) {
$content = file_get_contents('logs.txt');
}
$line = 'SECONDE TENTATIVE ['.(int)$cart->id.'] '.date('Y-m-d H:i:s').': Redirect id_order='.$id_order."\n";
$content .= $line;
file_put_contents('logs.txt', $content);
// end log
Tools::redirect('order-detail.php?id_order='.$id_order);
}
// verif if there's at least one order with this delivery address
$orders_with_delivery_address = Db::getInstance()->getValue('
SELECT COUNT(`id_order`)
@ -161,11 +177,6 @@ foreach ($data as $d) {
$pays = $d[1];
}
}
// $num_trans = explode('NUMTRANS=', $data[0]);
// $num_appel = explode('NUMAPPEL=', $data[1]);
// $autorisation = explode('AUTORISATION=', $data[5]);
// $code_reponse = explode('CODEREPONSE=', $data[6]);
// $commentaire = explode('COMMENTAIRE=', $data[7]);
$data[7] = utf8_encode($data[7]);
@ -208,7 +219,15 @@ if ($autorisation == 'XXXXXX' && $test_mode === 1) {
if ($id_order = (int)Order::getOrderByCartId($cart->id))
{
$paybox->saveInformationPaiement($values);
// log
$content = '';
if (file_exists('logs.txt')) {
$content = file_get_contents('logs.txt');
}
$line = 'SECONDE RESPONSE ['.(int)$cart->id.']['.$num_question.'] '.date('Y-m-d H:i:s').': '.$response."\n";
$content .= $line;
file_put_contents('logs.txt', $content);
// end log
if (empty($error))
{

View File

@ -143,7 +143,7 @@
<a href="{$link->getCMSLink(14)}#ancre_10">{l s='How make a return ?'}</a>
</div>
</div>
<div class="clear"></div>
<div class="clearfix"></div>
<div class="detail_info_footer">
<p>{l s='Une question ? Retrouvez notre aide en ligne'} <a href="{$base_dir_ssl}modules/ant_support/help.php">{l s='ici'}</a></p>

View File

@ -33,14 +33,34 @@
var currencyBlank = '{$currencyBlank|intval}';
var txtProduct = "{l s='product'}";
var txtProducts = "{l s='products'}";
var payment_click = 0;
// ]]>
{literal}
// Function to submit payment and send the information to GA
function submitPayment(){
function submitPayment(payment_click){
$input = $('input[name="paiement-method"]:checked');
if(!$input.length) {
alert(paiementErrorMessage);
}
$('.overlay_bbb').click(function(e){
if(payment_click != 0) {
// prevent multi click
$('.overlay_bbb').fadeIn();
if ($input.val()) {
if ($input.attr('data-module-name') == "paybox-direct"){
$('.box_paybox').fadeIn();
}
if ($input.attr('data-module-name') == "paypal") {
$('.box_paypal').fadeIn();
}
}
return false;
}
});
if(payment_click == 0) {
payment_click = payment_click+1;
if ($input.val()) {
// LOADER POUR PAYBOX
if ($input.attr('data-module-name') == "paybox-direct"){
@ -69,6 +89,10 @@
$form.submit();
}
}
} else {
$('.overlay_bbb').fadeIn();
return false;
}
}
{/literal}
</script>
@ -109,7 +133,7 @@
{/if}
<p class="cart_navigation">
<a href="{$link->getPageLink('order.php', true)}?step=2" title="{l s='Previous'}" class="button">{l s='Previous'}</a>
<a class="exclusive submitPayment" title="{l s='Valider ma commande'}" class="button" onclick="submitPayment(); return ((window.ga && ga.create)? !ga.loaded : true);">{l s='Valider ma commande'}</a>
<a class="exclusive submitPayment" title="{l s='Valider ma commande'}" class="button" onclick="submitPayment(payment_click); return ((window.ga && ga.create)? !ga.loaded : true);">{l s='Valider ma commande'}</a>
</p>
{else}
</div>
@ -152,6 +176,7 @@
$(this).children('.input_radio').children('input[name="paiement-method"]').attr('checked', true);
});
// $('.submitPayment').live('click', function(e) {
// e.preventDefault();
// // check if selected

View File

@ -43,7 +43,7 @@
<p>{l s='You can download your invoice in your account, on'} <a href="{$link->getPageLink('history.php', true)}">"{l s='Order History'}"</a></p>
</div>
<div class="clear"></div>
<div class="clearfix"></div>
<h3>{l s='Details of your order'}</h3>
<div id="order-detail-content" class="table_block">

View File

@ -33,14 +33,33 @@
var currencyBlank = '{$currencyBlank|intval}';
var txtProduct = "{l s='product'}";
var txtProducts = "{l s='products'}";
var payment_click = 0;
// ]]>
{literal}
// Function to submit payment and send the information to GA
function submitPayment(){
function submitPayment(payment_click){
$input = $('input[name="paiement-method"]:checked');
if(!$input.length) {
alert(paiementErrorMessage);
}
$('.overlay_bbb').click(function(e){
if(payment_click != 0) {
// prevent multi click
$('.overlay_bbb').fadeIn();
if ($input.val()) {
if ($input.attr('data-module-name') == "paybox-direct"){
$('.box_paybox').fadeIn();
}
if ($input.attr('data-module-name') == "paypal") {
$('.box_paypal').fadeIn();
}
}
return false;
}
});
if(payment_click == 0) {
payment_click = payment_click+1;
if ($input.val()) {
// LOADER POUR PAYBOX
if ($input.attr('data-module-name') == "paybox-direct"){
@ -69,6 +88,10 @@
$form.submit();
}
}
} else {
$('.overlay_bbb').fadeIn();
return false;
}
}
{/literal}
</script>
@ -103,7 +126,7 @@
{if !$opc}
<p class="cart_navigation">
<a href="{$link->getPageLink('order.php', true)}?step=2" title="{l s='Previous'}" class="button">{l s='Previous'}</a>
<a class="exclusive submitPayment" title="{l s='Valider ma commande'}" class="button" onclick="submitPayment(); return ((window.ga && ga.create)? !ga.loaded : true);">{l s='Valider ma commande'}</a>
<a class="exclusive submitPayment" title="{l s='Valider ma commande'}" class="button" onclick="submitPayment(payment_click); return ((window.ga && ga.create)? !ga.loaded : true);">{l s='Valider ma commande'}</a>
</p>
{else}
</div>