diff --git a/Frontend/WirecardCheckoutPage/Bootstrap.php b/Frontend/WirecardCheckoutPage/Bootstrap.php index 0152076..7755ae6 100755 --- a/Frontend/WirecardCheckoutPage/Bootstrap.php +++ b/Frontend/WirecardCheckoutPage/Bootstrap.php @@ -71,7 +71,7 @@ public function getCapabilities() */ public function getVersion() { - return '1.5.8'; + return '1.5.9'; } /** @@ -526,6 +526,18 @@ protected function createForm() 'order' => ++$i ) ); + + $form->setElement( + 'checkbox', + 'FINANCIAL_INSTITUTION_SELECTION_ENABLED', + array( + 'label' => 'Auswahl des Finanzinstitutes erlauben.', + 'value' => 1, + 'description' => 'Bei Zahlungsmittel wie EPS und iDeal die Auswahl des Finanzinstitutes vor der Weiterleitung zum PSP erlauben.', + 'scope' => \Shopware\Models\Config\Element::SCOPE_SHOP, + 'required' => false, + 'order' => ++$i + )); } /** @@ -626,6 +638,10 @@ public function createTranslations() 'label' => 'Accepted currencies for Installment', 'description' => 'Please select at least one currency to use Installment.' ), + 'FINANCIAL_INSTITUTION_SELECTION_ENABLED' => Array( + 'label' => 'Selection of financial institute allowed.', + 'description' => 'Allow financial institute selection for payment methods like EPS or iDeal.' + ) ) ); @@ -931,6 +947,7 @@ public function onPostDispatch(Enlight_Event_EventArgs $args) $view->paymentDesc = Shopware()->Session()->sOrderVariables['sUserData']['additional']['payment']['description']; $view->paymentName = $paymentName; $view->paymentLogo = 'frontend/_public/images/' . $paymentName . '.png'; + $view->financialInstitutionSelectionEnabled = Shopware()->WirecardCheckoutPage()->getConfig()->FINANCIAL_INSTITUTION_SELECTION_ENABLED; if(Shopware()->Session()->offsetGet('wcpConsumerDeviceId') != null) { $consumerDeviceId = Shopware()->Session()->offsetGet('wcpConsumerDeviceId'); diff --git a/Frontend/WirecardCheckoutPage/Models/Page.php b/Frontend/WirecardCheckoutPage/Models/Page.php index 8611cf0..0b9d006 100644 --- a/Frontend/WirecardCheckoutPage/Models/Page.php +++ b/Frontend/WirecardCheckoutPage/Models/Page.php @@ -77,7 +77,10 @@ protected function getFrontendClient(Shopware_Plugins_Frontend_WirecardCheckoutP public function initiatePayment($paymentType, $amount, $currency, $returnUrl, $confimUrl, $params = array()) { $oFrontendClient = $this->getFrontendClient(Shopware()->WirecardCheckoutPage()->getConfig()); - if (in_array(strtolower($paymentType), Shopware()->WirecardCheckoutPage()->getConfig()->getPaymentsFinancialInstitution())) { + if (Shopware()->WirecardCheckoutPage()->getConfig()->FINANCIAL_INSTITUTION_SELECTION_ENABLED + && in_array(strtolower($paymentType), + Shopware()->WirecardCheckoutPage()->getConfig()->getPaymentsFinancialInstitution()) + ) { $oFrontendClient->setFinancialInstitution(Shopware()->WirecardCheckoutPage()->financialInstitution); } $email = (string) Shopware()->WirecardCheckoutPage()->getUser('user')->email; diff --git a/Frontend/WirecardCheckoutPage/Views/responsive/frontend/checkout/confirm.tpl b/Frontend/WirecardCheckoutPage/Views/responsive/frontend/checkout/confirm.tpl index ed8873d..15b21d7 100755 --- a/Frontend/WirecardCheckoutPage/Views/responsive/frontend/checkout/confirm.tpl +++ b/Frontend/WirecardCheckoutPage/Views/responsive/frontend/checkout/confirm.tpl @@ -41,10 +41,13 @@ } }; + {if $financialInstitutionSelectionEnabled} function setFinancialInstitution() { var paymentForm = $('#confirm--form'); + console.log($('#financialInstitutions').val()); paymentForm.append(''); } + {/if} window.onload = function() { $(document).ready(function() { @@ -52,10 +55,12 @@ { checkbirthday(); } + {if $financialInstitutionSelectionEnabled} else if ( {$paymentName|json_encode} == 'wcp_ideal' || {$paymentName|json_encode} == 'wcp_eps') { setFinancialInstitution(); } + {/if} }); }; @@ -77,28 +82,30 @@ {block name='frontend_checkout_confirm_product_table' prepend} {if $wcpAdditional eq 'financialInstitutions'} -