From 69ed09313da11c393f88f27cf23f5cdac0f96821 Mon Sep 17 00:00:00 2001 From: Jacqueline Rinnhofer Date: Mon, 28 Aug 2017 14:12:03 +0200 Subject: [PATCH 1/3] #8 Add consumerDeviceId --- wirecardceecheckout.php | 37 ++++++++++++++++----- wirecardceecheckout/tmpl/displaypayment.php | 1 + 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/wirecardceecheckout.php b/wirecardceecheckout.php index 415b16c..452c414 100644 --- a/wirecardceecheckout.php +++ b/wirecardceecheckout.php @@ -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.0'; + protected static $PLUGIN_VERSION = '1.7.1'; protected $_method; protected $_order; @@ -678,7 +678,6 @@ public function plgVmOnCheckoutCheckDataPayment(VirtueMartCart $cart) break; } } - return $found; } @@ -833,13 +832,28 @@ protected function getPluginHtml($plugin, $selectedPlugin, $pluginSalesPrice) $birthYear = $sessionWirecard->birthYear; } + $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; + } + $ratepay = ''; + $ratepay .= ''; + $ratepay .= ''; + $ratepay .= ''; + $html = $this->renderByLayout('displaypayment', array( 'paymenttypes' => $this->_getEnabledPaymentTypes(), 'paymentmethod_id' => $plugin->$pluginmethod_id, 'paymenttype_selected' => $paymenttype_selected, 'birth_day' => $birthDay, 'birth_month' => $birthMonth, - 'birth_year' => $birthYear + 'birth_year' => $birthYear, + 'ratepay_script' => $ratepay )); return $html; @@ -937,6 +951,11 @@ protected function _initiatePayment($cart) ->setAutoDeposit($this->_getAutoDeposit($paymentType)) ->setWindowName($this->_getWindowName()); + if ( isset( $_SESSION['wcp-consumerDeviceId'] ) ){ + $client->consumerDeviceId = $_SESSION['wcp-consumerDeviceId']; + unset( $_SESSION['wcp-consumerDeviceId'] ); + } + if ($paymentType == \WirecardCEE_QPay_PaymentType::MASTERPASS) { $client->setShippingProfile('NO_SHIPPING'); } @@ -1309,11 +1328,13 @@ protected function _setConsumerBillingInformation(WirecardCEE_Stdlib_ConsumerDat $session = JFactory::getSession(); $data = $session->get('WIRECARDCEECHECKOUT', null, 'vm'); $sessionWirecard = unserialize($data); - $birthDay = $sessionWirecard->birthDay; - $birthMonth = $sessionWirecard->birthMonth; - $birthYear = $sessionWirecard->birthYear; - $birthday = new DateTime($birthYear . "-" . $birthMonth . "-" . $birthDay); - $consumerData->setBirthDate($birthday); + if (isset($sessionWirecard->birthDay)) { + $birthDay = $sessionWirecard->birthDay; + $birthMonth = $sessionWirecard->birthMonth; + $birthYear = $sessionWirecard->birthYear; + $birthday = new DateTime($birthYear . "-" . $birthMonth . "-" . $birthDay); + $consumerData->setBirthDate($birthday); + } } $consumerData->setEmail($billingData->email); diff --git a/wirecardceecheckout/tmpl/displaypayment.php b/wirecardceecheckout/tmpl/displaypayment.php index 6ccf875..1621e64 100644 --- a/wirecardceecheckout/tmpl/displaypayment.php +++ b/wirecardceecheckout/tmpl/displaypayment.php @@ -34,6 +34,7 @@ ?> + _psType . '/'; From e69de43a00d40abc99db0ccd00c02792625096ce Mon Sep 17 00:00:00 2001 From: Jacqueline Rinnhofer Date: Mon, 28 Aug 2017 14:17:03 +0200 Subject: [PATCH 2/3] #8 Adapt xml for update --- .../plg_vmpayment_wirecardceecheckout_update.xml | 15 +++++++++++++++ wirecardceecheckout.xml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/update/plg_vmpayment_wirecardceecheckout_update.xml b/update/plg_vmpayment_wirecardceecheckout_update.xml index a9898d0..da79f30 100644 --- a/update/plg_vmpayment_wirecardceecheckout_update.xml +++ b/update/plg_vmpayment_wirecardceecheckout_update.xml @@ -30,4 +30,19 @@ https://www.wirecard.at/ + + Wirecard Checkout Page + Wirecard - Your Full Service Payment Provider + plugin + vmpayment + wirecardceecheckout + 1.7.1 + site + + https://github.com/wirecard/virtuemart3-wcp/archive/1.7.1.zip + + Wirecard + https://www.wirecard.at/ + + \ No newline at end of file diff --git a/wirecardceecheckout.xml b/wirecardceecheckout.xml index 2f7ef4f..258144d 100644 --- a/wirecardceecheckout.xml +++ b/wirecardceecheckout.xml @@ -36,7 +36,7 @@ http://www.wirecard.at/ Copyright (C) 2013 Wirecard. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL - 1.7.0 + 1.7.1 VMPAYMENT_WIRECARDCEECHECKOUT_PAYMENT_DESCRIPTION From dcf43c0258d9a974809069a3d73e4f3e630ef61b Mon Sep 17 00:00:00 2001 From: Jacqueline Rinnhofer Date: Mon, 28 Aug 2017 14:22:01 +0200 Subject: [PATCH 3/3] #8 Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a740e0e..fcb310d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Wirecard Checkout Page plugin for VirtueMart 3.0 -Tested with Joomla 3.6.5/VirtueMart 3.0.18. +Tested with Joomla 3.7.5/VirtueMart 3.2.4. Our [Online Guides](https://guides.wirecard.at/) provide further information on payment methods and additional features. Please observe our [terms of use](https://guides.wirecard.at/shop_plugins:info#terms_of_use) regarding plugins.