Skip to content

Commit

Permalink
Merge pull request #69 from wirecard/TPWDCEE-1328
Browse files Browse the repository at this point in the history
#68 Update terms check
  • Loading branch information
jpy authored Aug 24, 2018
2 parents f42e700 + de830ef commit f1201ca
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Frontend/WirecardCheckoutPage/Models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function initiatePayment($paymentType, $amount, $currency, $returnUrl, $c
->setConsumerData($this->getConsumerData($paymentType))
->createConsumerMerchantCrmId($email);

if(Shopware()->Session()->offsetGet('wcpConsumerDeviceId') != null) {
if (Shopware()->Session()->offsetGet('wcpConsumerDeviceId') != null) {
$oFrontendClient->consumerDeviceId = Shopware()->Session()->offsetGet('wcpConsumerDeviceId');
//default set to null, but no effect
Shopware()->Session()->offsetSet('wcpConsumerDeviceId', null);
Expand All @@ -112,7 +112,7 @@ public function initiatePayment($paymentType, $amount, $currency, $returnUrl, $c
) {
$oFrontendClient->setBasket($this->getShoppingBasket());
}
if(Shopware()->WirecardCheckoutPage()->getConfig()->ENABLE_DUPLICATE_REQUEST_CHECK){
if (Shopware()->WirecardCheckoutPage()->getConfig()->ENABLE_DUPLICATE_REQUEST_CHECK){
$oFrontendClient->setDuplicateRequestCheck(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
{$wcpConsumerDeviceIdScript}
{/if}
<script type="text/javascript">
function enableButton() {
$('#wcsPayolutionTermsAccept').hide();
$('.is--primary').attr('disabled', false);
}
function checkbirthday() {
var m = $('#wcp-month').val();
var d = $('#wcp-day').val();
Expand All @@ -15,18 +20,20 @@
var minAge = 18;
var birthdate = new Date(dateStr);
var year = birthdate.getFullYear();
var today = new Date();
var limit = new Date((today.getFullYear() - minAge), today.getMonth(), today.getDate());
if (birthdate < limit) {
$('#wcp-birthdate').val(dateStr);
$('#wcpPayolutionAging').hide();
if ($('#wcpInvoiceTermsChecked').is(':checked')) {
$('#wcpPayolutionTermsAccept').hide();
$('.is--primary').attr('disabled', false);
if ($('#wcsInvoiceTermsChecked').length) {
if ($('#wcpInvoiceTermsChecked').is(':checked')) {
enableButton();
} else {
$('.is--primary').attr('disabled', true);
$('#wcpPayolutionTermsAccept').show();
}
} else {
$('.is--primary').attr('disabled', true);
$('#wcpPayolutionTermsAccept').show();
enableButton();
}
}
else {
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.5-green.svg)](https://www.shopware.com/)
[![Shopware](https://img.shields.io/badge/Shopware-v5.2.0--v5.4.6-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 f1201ca

Please sign in to comment.