Skip to content

Commit

Permalink
Merge pull request #71 from wirecard/TPWDCEE-2035
Browse files Browse the repository at this point in the history
Compatibility update Shopware 5.1.1 TPWDCEE-2035
  • Loading branch information
rinnhofer authored Oct 2, 2018
2 parents f1201ca + 58f55bb commit 2ff4d0b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
7 changes: 6 additions & 1 deletion Frontend/WirecardCheckoutPage/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getCapabilities()
*/
public function getVersion()
{
return '1.6.1';
return '1.6.2';
}

/**
Expand Down Expand Up @@ -902,6 +902,11 @@ public function onPreDispatch(Enlight_Event_EventArgs $args)
self::init();
Shopware()->WirecardCheckoutPage()->financialInstitution = $financialInstitution;
}
$birthDate = $args->getSubject()->Request()->get('birthdate');
if (!empty($birthDate)) {
self::init();
Shopware()->Session()->sOrderVariables['sUserData']['additional']['user']['birthday'] = $birthDate;
}
}

/**
Expand Down
9 changes: 5 additions & 4 deletions Frontend/WirecardCheckoutPage/Models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,12 @@ public function getConsumerData($paymentType)

$userData = Shopware()->Session()->sOrderVariables['sUserData'];
$birthday = $userData['additional']['user']['birthday'];
$birthday = $this->getDateObject($birthday);
if (false !== $birthday) {
$consumerData = $consumerData->setBirthDate($birthday);
if (!empty($birthday)) {
$birthday = $this->getDateObject($birthday);
if (false !== $birthday) {
$consumerData = $consumerData->setBirthDate($birthday);
}
}

}

return $consumerData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{/if}
<script type="text/javascript">
function enableButton() {
$('#wcsPayolutionTermsAccept').hide();
$('#wcpPayolutionTermsAccept').hide();
$('.is--primary').attr('disabled', false);
}
Expand All @@ -25,7 +25,7 @@
if (birthdate < limit) {
$('#wcp-birthdate').val(dateStr);
$('#wcpPayolutionAging').hide();
if ($('#wcsInvoiceTermsChecked').length) {
if ($('#wcpInvoiceTermsChecked').length) {
if ($('#wcpInvoiceTermsChecked').is(':checked')) {
enableButton();
} else {
Expand All @@ -49,7 +49,6 @@
{if $financialInstitutionSelectionEnabled}
function setFinancialInstitution() {
var paymentForm = $('#confirm--form');
console.log($('#financialInstitutions').val());
paymentForm.append('<input type="hidden" name="financialInstitution" value="' + $('#financialInstitutions').val() + '" />');
}
{/if}
Expand All @@ -58,13 +57,14 @@
$(document).ready(function() {
if ( {$paymentName|json_encode} == 'wcp_invoice' || {$paymentName|json_encode} == 'wcp_installment')
{
$('#confirm--form').append('<input type="hidden" name="birthdate" id="wcp-birthdate" value="" />');
checkbirthday();
}
{if $financialInstitutionSelectionEnabled}
else if ( {$paymentName|json_encode} == 'wcp_ideal' || {$paymentName|json_encode} == 'wcp_eps')
{
setFinancialInstitution();
}
if ( {$paymentName|json_encode} == 'wcp_ideal' || {$paymentName|json_encode} == 'wcp_eps')
{
setFinancialInstitution();
}
{/if}
});
};
Expand Down Expand Up @@ -141,7 +141,6 @@
<div class="payment--selection-label is--underline" name="birthdate">{s name="WirecardCheckoutPageBirthday"}Geburtsdatum{/s}</div>
<div class="payment--form-group">
<div class="row">
<input type="hidden" name="birthdate" id="wcp-birthdate" value="" />
<select name="days" id="wcp-day" onchange="checkbirthday();" required>
<option value="0">-</option>
{foreach from=$days item=v}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Wirecard Checkout Page plugin for Shopware

[![License](https://img.shields.io/badge/license-GPLv2-blue.svg)](https://raw.githubusercontent.com/wirecard/shopware-wcp/master/LICENSE)
[![Shopware](https://img.shields.io/badge/Shopware-v5.2.0--v5.4.6-green.svg)](https://www.shopware.com/)
[![Shopware](https://img.shields.io/badge/Shopware-v5.2.0--v5.5.1-green.svg)](https://www.shopware.com/)
[![PHP v7](https://img.shields.io/badge/php-v7-yellow.svg)](http://www.php.net)
[![PHP v5.6](https://img.shields.io/badge/php-v5.6-yellow.svg)](http://www.php.net)

Expand Down

0 comments on commit 2ff4d0b

Please sign in to comment.