Skip to content

Commit

Permalink
Merge pull request #32 from wirecard/TPWDCEE-678
Browse files Browse the repository at this point in the history
Tpwdcee 678
  • Loading branch information
tomazpu authored Feb 9, 2018
2 parents f6cb9aa + bac005d commit 8c30c68
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ public function getCustomerDobMonth() {
public function getCustomerDobDay() {
return $this->getCustomerDobPart('dd');
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,24 @@ protected function _construct()
$this->setTemplate('wirecard/checkoutpage/additional/invoice.phtml');
}

public function isRatepayPaymentProvider()
{
$installment = new Wirecard_CheckoutPage_Model_Installment();
$invoice = new Wirecard_CheckoutPage_Model_Invoice();

$payments = Mage::getSingleton('payment/config')->getActiveMethods();
$methods = array();

foreach ($payments as $paymentCode=>$paymentModel) {
$methods[] = $paymentCode;
}

$installment_active = in_array('wirecard_checkoutpage_installment', $methods);
$invoice_active = in_array('wirecard_checkoutpage_invoice', $methods);


return (($installment->getConfigData('provider') == "ratepay" && $installment_active) || ($invoice->getConfigData('provider') == "ratepay" && $invoice_active));
}

public function getConsumerDeviceId() {
$session = Mage::getModel('customer/session');
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Wirecard/CheckoutPage/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
class Wirecard_CheckoutPage_Helper_Data extends Mage_Payment_Helper_Data
{

protected $_pluginVersion = '4.2.6';
protected $_pluginVersion = '4.2.7';
protected $_pluginName = 'Wirecard/CheckoutPage';

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Wirecard/CheckoutPage/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<config>
<modules>
<Wirecard_CheckoutPage>
<version>4.2.6</version>
<version>4.2.7</version>
</Wirecard_CheckoutPage>
</modules>
<global>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php if ($this->getConsumerDeviceId()) { ?>
<script language="JavaScript">
var di = {t:'<?php echo $this->getConsumerDeviceId(); ?>',v:'WDWL',l:'Checkout'};
</script>
<script type="text/javascript" src="//d.ratepay.com/<?php echo $this->getConsumerDeviceId(); ?>/di.js"></script>
<noscript>
<link rel="stylesheet" type="text/css" href="//d.ratepay.com/di.css?t=<?php echo $this->getConsumerDeviceId(); ?>&v=WDWL&l=Checkout">
</noscript>
<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=<?php echo $this->getConsumerDeviceId(); ?>&v=WDWL"/>
<param name="AllowScriptAccess" value="always"/>
</object>
<?php if ($this->getConsumerDeviceId() && $this->isRatepayPaymentProvider()) { ?>
<script language="JavaScript">
var di = {t:'<?php echo $this->getConsumerDeviceId(); ?>',v:'WDWL',l:'Checkout'};
</script>
<script type="text/javascript" src="//d.ratepay.com/<?php echo $this->getConsumerDeviceId(); ?>/di.js"></script>
<noscript>
<link rel="stylesheet" type="text/css" href="//d.ratepay.com/di.css?t=<?php echo $this->getConsumerDeviceId(); ?>&v=WDWL&l=Checkout">
</noscript>
<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=<?php echo $this->getConsumerDeviceId(); ?>&v=WDWL"/>
<param name="AllowScriptAccess" value="always"/>
</object>
<?php } ?>
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wirecard/magento-wcp",
"license": "GPL-2.0",
"license": "GPL-2.0-only",
"type": "magento-module",
"description": "Wirecard Checkout Page extension for Magento",
"keywords": ["wirecard", "checkout", "page", "payment", "magento"],
Expand Down

0 comments on commit 8c30c68

Please sign in to comment.