Skip to content

Commit

Permalink
Merge pull request #16 from wirecard/TPWDCEE-773
Browse files Browse the repository at this point in the history
Tpwdcee 773
  • Loading branch information
jpy authored Feb 12, 2018
2 parents c134176 + 72b677d commit ed86745
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 14 deletions.
15 changes: 15 additions & 0 deletions update/plg_vmpayment_wirecardceecheckout_update.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,19 @@
<maintainerurl>https://www.wirecard.at/</maintainerurl>
<targetplatform name="joomla" version="3.6"/>
</update>
<update>
<name>Wirecard Checkout Page</name>
<description>Wirecard - Your Full Service Payment Provider</description>
<type>plugin</type>
<folder>vmpayment</folder>
<element>wirecardceecheckout</element>
<version>1.7.5</version>
<client>site</client>
<downloads>
<downloadurl type="full" format="zip">https://github.com/wirecard/virtuemart3-wcp/archive/1.7.5.zip</downloadurl>
</downloads>
<maintainer>Wirecard</maintainer>
<maintainerurl>https://www.wirecard.at/</maintainerurl>
<targetplatform name="joomla" version="3.6"/>
</update>
</updates>
30 changes: 17 additions & 13 deletions wirecardceecheckout.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class plgVmPaymentwirecardceecheckout extends vmPSPlugin

protected static $WINDOW_NAME = 'WirecardCEECheckoutFrame';
protected static $PLUGIN_NAME = 'VirtueMart2_CheckoutPage';
protected static $PLUGIN_VERSION = '1.7.4';
protected static $PLUGIN_VERSION = '1.7.5';

protected $_method;
protected $_order;
Expand Down Expand Up @@ -832,19 +832,23 @@ protected function getPluginHtml($plugin, $selectedPlugin, $pluginSalesPrice)
$birthYear = $sessionWirecard->birthYear;
}

$customer_id = $this->_getCustomerId();
$ratepay = "";
if (((int)$this->_getMethod()->paymenttype_invoice == 1 && $this->_getInvoiceFinancialInstitution() == "ratepay") ||
((int)$this->_getMethod()->paymenttype_installment == 1 && $this->_getInstallmentFinancialInstitution() == "ratepay")) {
$customer_id = $this->_getCustomerId();
if (isset($_SESSION['wcp-consumerDeviceId'])) {
$consumerDeviceId = $_SESSION['wcp-consumerDeviceId'];
} else {
$timestamp = microtime();
$consumerDeviceId = md5( $customer_id . "_" . $timestamp );
$_SESSION['wcp-consumerDeviceId'] = $consumerDeviceId;
}

if( isset( $_SESSION['wcp-consumerDeviceId'] ) ) {
$consumerDeviceId = $_SESSION['wcp-consumerDeviceId'];
} else {
$timestamp = microtime();
$consumerDeviceId = md5( $customer_id . "_" . $timestamp );
$_SESSION['wcp-consumerDeviceId'] = $consumerDeviceId;
}
$ratepay = '<script language="JavaScript">var di = {t:"' . $consumerDeviceId . '",v:"WDWL",l:"Checkout"};</script>';
$ratepay .= '<script type="text/javascript" src="//d.ratepay.com/' . $consumerDeviceId . '/di.js"></script>';
$ratepay .= '<noscript><link rel="stylesheet" type="text/css" href="//d.ratepay.com/di.css?t=' . $consumerDeviceId . '&v=WDWL&l=Checkout"></noscript>';
$ratepay .= '<object type="application/x-shockwave-flash" data="//d.ratepay.com/WDWL/c.swf" width="0" height="0"><param name="movie" value="//d.ratepay.com/WDWL/c.swf" /><param name="flashvars" value="t=' . $consumerDeviceId . '&v=WDWL"/><param name="AllowScriptAccess" value="always"/></object>';
$ratepay = '<script language="JavaScript">var di = {t:"' . $consumerDeviceId . '",v:"WDWL",l:"Checkout"};</script>';
$ratepay .= '<script type="text/javascript" src="//d.ratepay.com/' . $consumerDeviceId . '/di.js"></script>';
$ratepay .= '<noscript><link rel="stylesheet" type="text/css" href="//d.ratepay.com/di.css?t=' . $consumerDeviceId . '&v=WDWL&l=Checkout"></noscript>';
$ratepay .= '<object type="application/x-shockwave-flash" data="//d.ratepay.com/WDWL/c.swf" width="0" height="0"><param name="movie" value="//d.ratepay.com/WDWL/c.swf" /><param name="flashvars" value="t=' . $consumerDeviceId . '&v=WDWL"/><param name="AllowScriptAccess" value="always"/></object>';
}

$html = $this->renderByLayout('displaypayment', array(
'paymenttypes' => $this->_getEnabledPaymentTypes(),
Expand Down
2 changes: 1 addition & 1 deletion wirecardceecheckout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<authorUrl>http://www.wirecard.at/</authorUrl>
<copyright>Copyright (C) 2013 Wirecard. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<version>1.7.4</version>
<version>1.7.5</version>
<description>VMPAYMENT_WIRECARDCEECHECKOUT_PAYMENT_DESCRIPTION</description>

<files>
Expand Down

0 comments on commit ed86745

Please sign in to comment.