diff --git a/README.md b/README.md index b2478d3..475ab54 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Wirecard Checkout Page extension for Magento [![License](https://img.shields.io/badge/license-GPLv2-blue.svg)](https://raw.githubusercontent.com/wirecard/Magento-WCP/master/LICENSE) -[![Magento Community Edition 1.9.3.1](https://img.shields.io/badge/Magento_CE-v1.9.3.1-green.svg)](https://www.magento.com/) +[![Magento Community Edition 1.9.3.4](https://img.shields.io/badge/Magento_CE-v1.9.3.4-green.svg)](https://www.magento.com/) [![PHP v5.6](https://img.shields.io/badge/php-v5.6-yellow.svg)](http://www.php.net) Wirecard Checkout Page extension for Magento. diff --git a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php new file mode 100644 index 0000000..21a25d3 --- /dev/null +++ b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php @@ -0,0 +1,57 @@ +setTemplate('wirecard/checkoutpage/additional/invoice.phtml'); + } + + + + public function getConsumerDeviceId() { + $session = Mage::getModel('customer/session'); + + if (strlen($session->getData('wirecard_cp_consumerDeviceId'))) { + return $session->getData('wirecard_cp_consumerDeviceId'); + } + else { + $timestamp = microtime(); + $consumerDeviceId = md5(Mage::helper('wirecard_checkoutpage')->getConfigData('settings/customer_id') . "_" . $timestamp); + $session->setData('wirecard_cp_consumerDeviceId', $consumerDeviceId); + return $consumerDeviceId; + } + } +} \ No newline at end of file diff --git a/app/code/community/Wirecard/CheckoutPage/Model/Abstract.php b/app/code/community/Wirecard/CheckoutPage/Model/Abstract.php index 80808b4..1223b2d 100644 --- a/app/code/community/Wirecard/CheckoutPage/Model/Abstract.php +++ b/app/code/community/Wirecard/CheckoutPage/Model/Abstract.php @@ -117,6 +117,7 @@ public function initPayment() { $order = $this->getOrder(); /** @var Wirecard_CheckoutPage_Helper_Data $helper */ $helper = Mage::helper( 'wirecard_checkoutpage' ); + $session = Mage::getModel('customer/session'); $precision = 2; @@ -153,6 +154,11 @@ public function initPayment() { ->createConsumerMerchantCrmId( $this->getOrder()->getCustomerEmail() ) ->setConsumerData( $this->_getConsumerData() ); + if (strlen($session->getData('wirecard_cp_consumerDeviceId'))) { + $init->consumerDeviceId = $session->getData('wirecard_cp_consumerDeviceId'); + $session->unsetData('wirecard_cp_consumerDeviceId'); + } + if ($paymenttype == WirecardCEE_Stdlib_PaymentTypeAbstract::MASTERPASS) { $init->setShippingProfile('NO_SHIPPING'); } diff --git a/app/code/community/Wirecard/CheckoutPage/etc/config.xml b/app/code/community/Wirecard/CheckoutPage/etc/config.xml index df725bf..d4fe205 100644 --- a/app/code/community/Wirecard/CheckoutPage/etc/config.xml +++ b/app/code/community/Wirecard/CheckoutPage/etc/config.xml @@ -34,7 +34,7 @@ - 4.2.0 + 4.2.1 diff --git a/app/design/frontend/base/default/layout/wirecard_checkoutpage.xml b/app/design/frontend/base/default/layout/wirecard_checkoutpage.xml index 80e6847..fcf5c03 100644 --- a/app/design/frontend/base/default/layout/wirecard_checkoutpage.xml +++ b/app/design/frontend/base/default/layout/wirecard_checkoutpage.xml @@ -86,5 +86,11 @@ template="wirecard/checkoutpage/return.phtml"/> + + + + + diff --git a/app/design/frontend/base/default/template/wirecard/checkoutpage/additional/script.phtml b/app/design/frontend/base/default/template/wirecard/checkoutpage/additional/script.phtml new file mode 100644 index 0000000..f43cf58 --- /dev/null +++ b/app/design/frontend/base/default/template/wirecard/checkoutpage/additional/script.phtml @@ -0,0 +1,14 @@ +getConsumerDeviceId()) { ?> + + + + + + + + + \ No newline at end of file