Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4 from heidelpay/develop
Browse files Browse the repository at this point in the history
17.6.23
  • Loading branch information
bnoobbnoob authored Jun 23, 2017
2 parents e69a5fe + d46c85e commit 51b1f75
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 64 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Tested on modified eCommerce version 2.0.
* direct debit secured
* invoice secured


### SYSTEM REQUIREMENTS

The extension requires PHP 5.6 or 7.0;
Expand Down
27 changes: 3 additions & 24 deletions heidelpay_3dsecure.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
<?php
require('includes/application_top.php');
// create smarty elements
$smarty = new Smarty;
// include boxes
require(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/source/boxes.php');
require ('includes/application_top.php');

$breadcrumb->add(NAVBAR_TITLE_1_CHECKOUT_SUCCESS);
$breadcrumb->add(NAVBAR_TITLE_2_CHECKOUT_SUCCESS);

require(DIR_WS_INCLUDES.'header.php');

if (empty($_SESSION['language'])) {
$_SESSION['language'] = 'german';
}
$smarty->caching = 0;
$main_content = $smarty->fetch(CURRENT_TEMPLATE.'/module/checkout_success.html');

$smarty->assign('language', $_SESSION['language']);
$smarty->assign('main_content', '<center>'.$_SESSION['HEIDELPAY_IFRAME'].'</center>');
$smarty->caching = 0;
if (!defined(RM)) {
$smarty->load_filter('output', 'note');
}
$smarty->display(CURRENT_TEMPLATE.'/index.html');
include('includes/application_bottom.php');
echo $_SESSION['HEIDELPAY_IFRAME'];
?>
48 changes: 8 additions & 40 deletions includes/classes/class.heidelpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class heidelpay
public $actualPaymethod = 'CC';
public $url;
/** @var string plugin version aka release date */
public $version = '17.4.7';
public $version = '17.6.23';
public $importantPPFields = array(
'PRESENTATION_AMOUNT',
'PRESENTATION_CURRENCY',
Expand Down Expand Up @@ -222,6 +222,7 @@ public function handleDebit($order, $payCode, $insertId = false)
if (empty($payMethod)) {
$payMethod = 'DB';
}
//fix for ot.pa over hpc
if ($payCode == 'OT' && $payMethod == 'DB') {
$payMethod = 'PA';
}
Expand Down Expand Up @@ -304,22 +305,23 @@ public function handleDebit($order, $payCode, $insertId = false)
}

// 3D Secure
//sgw status 80 should be 3d
if ($res['all']['PROCESSING.STATUS.CODE'] == '80' &&
$res['all']['PROCESSING.RETURN.CODE'] == '000.200.000' &&
$res['all']['PROCESSING.REASON.CODE'] == '00'
) {
$src = $res['all']['PROCESSING.REDIRECT.URL'];
//capture billsafe case
if ($this->actualPaymethod == 'BS') {
$hpIframe = '<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;'
. 'background: rgba(0,0,0,.5); z-index: 9998"></div>' . '<div style="position: absolute;'
. 'top: 0; left: 0; z-index: 9999"><iframe src="' . $src . '" allowtransparency="true"' .
' frameborder="0" width="925" height="800" name="heidelpay_frame"></iframe></div>';
header('Location: ' . $src);
//exit
exit();
}
$hpIframe = '<iframe src="about:blank" frameborder="0" width="400" height="600" name="heidelpay_frame">'
. '</iframe>';
$hpIframe .= '<form method="post" action="' . $src . '" target="heidelpay_frame" id="heidelpay_form">';
$hpIframe .= '<form method="post" action="' . $src . '" id="heidelpay_form">';
$hpIframe .= '<input type="hidden" name="TermUrl" value="'
. $res['all']['PROCESSING.REDIRECT.PARAMETER.TermUrl'] . '">';
$hpIframe .= '<input type="hidden" name="PaReq" value="'
Expand All @@ -328,41 +330,7 @@ public function handleDebit($order, $payCode, $insertId = false)
. $res['all']['PROCESSING.REDIRECT.PARAMETER.MD'] . '">';
$hpIframe .= '</form>';
$hpIframe .= '<script>document.getElementById("heidelpay_form").submit();</script>';
if (@constant('MODULE_PAYMENT_HP' . strtoupper($this->actualPaymethod) . '_DIRECT_MODE')
== 'GAMBIOLIGHTBOX'
) {
global $smarty;
$smarty->assign('LIGHTBOX', gm_get_conf('GM_LIGHTBOX_CHECKOUT'));
if ($_SESSION['style_edit_mode'] == 'edit') {
$smarty->assign('STYLE_EDIT', 1);
} else {
$smarty->assign('STYLE_EDIT', 0);
}
$smarty->assign('language', $_SESSION['language']);
$smarty->assign('content', '<center>' . $hpIframe . '</center>');
$content = $smarty->fetch(CURRENT_TEMPLATE . '/module/checkout_payment_hp.html');
$_SESSION['HEIDELPAY_IFRAME'] = $content;
if (!$debug) {
header('Location: ' . $loc . 'heidelpay_checkout_iframe.php?'
. session_name() . '=' . session_id());
}
exit();
} elseif (@constant('MODULE_PAYMENT_HP' . strtoupper($this->actualPaymethod)
. '_DIRECT_MODE') == 'LIGHTBOX'
) {
$hpIframeCode = '<center><div id="hpBox"><div style="background-color: #666; position:fixed;'
. ' display:block; margin:0; padding:0; top:0; left:0; opacity: 0.9; -moz-opacity: 0.9;'
. ' -khtml-opacity: 0.9; filter:alpha(opacity=90); z-index: 1000; width: 100%;'
. ' height: 100%;"></div>';
$hpIframeCode .= '<div style="z-index: 1001; position: absolute; width: 800px; top: 50%;'
. ' left: 50%; margin-top: -325px; margin-left: -400px;">';
$hpIframeCode .= $hpIframe;
$hpIframeCode .= '<br><a href="" onClick="document.getElementById(\'hpBox\').style.display=\'none\';'
. ' return false;">close</a></div></div></center>';
$_SESSION['HEIDELPAY_IFRAME'] = $hpIframeCode;
} else {
$_SESSION['HEIDELPAY_IFRAME'] = $hpIframe;
}
$_SESSION['HEIDELPAY_IFRAME'] = $hpIframe;
$_SESSION['hpLastPost'] = $_POST;
if (empty($_SESSION['hpLastPost'])) {
$_SESSION['hpLastPost']['hp'] = 1;
Expand Down Expand Up @@ -1568,4 +1536,4 @@ public function deleteCoupon($order_id)
return xtc_db_query("DELETE FROM `" . TABLE_COUPON_REDEEM_TRACK . "` WHERE `order_id` = '"
. addslashes($order_id) . "'");
}
}
}

0 comments on commit 51b1f75

Please sign in to comment.