Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oxid_4108_compat #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Wirecard Checkout Seamless extension for OXID eSales

[![License](https://img.shields.io/badge/license-GPLv2-blue.svg)](https://raw.githubusercontent.com/wirecard/Magento-WCP/master/LICENSE)
[![OXID eSales Community Edition 4.10.6](https://img.shields.io/badge/OXID_CE-v4.10.6-green.svg)](http://www.oxid-esales.com/)
[![OXID eSales Community Edition 4.10.8](https://img.shields.io/badge/OXID_CE-v4.10.8-green.svg)](http://www.oxid-esales.com/)
[![OXID eSales Enterprise Edition 5.2.9](https://img.shields.io/badge/OXID_EE-v5.2.9-green.svg)](http://www.oxid-esales.com/)
[![PHP v5.3](https://img.shields.io/badge/php-v5.3-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
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public function validatePayment()
$config = wirecardCheckoutSeamlessConfig::getInstance();
$oUser = $this->getUser();
$oLang = oxRegistry::get('oxLang');
$provider = null;

switch ($sPaymenttype) {
case WirecardCEE_QMore_PaymentType::IDL:
Expand Down Expand Up @@ -119,9 +120,15 @@ public function validatePayment()
break;

case WirecardCEE_QMore_PaymentType::INVOICE . '_B2C':
$provider = $config->getInvoiceProvider();

case WirecardCEE_QMore_PaymentType::INSTALLMENT:
if ($config->getInstallmentProvider() == 'PAYOLUTION') {

if ($provider === null) {
$provider = $config->getInstallmentProvider();
}

if ($provider == 'PAYOLUTION') {
if ($this->hasWcsDobField($sPaymentId) && $oUser->oxuser__oxbirthdate == '0000-00-00') {
$iBirthdayYear = oxRegistry::getConfig()->getRequestParameter($sPaymentId . '_iBirthdayYear');
$iBirthdayDay = oxRegistry::getConfig()->getRequestParameter($sPaymentId . '_iBirthdayDay');
Expand Down Expand Up @@ -155,7 +162,9 @@ public function validatePayment()
return;
}

if ($this->showWcsInstallmentTrustedShopsCheckbox($sPaymentId)) {
}

if ($this->showWcsTrustedShopsCheckbox($sPaymentId)) {
if (!oxRegistry::getConfig()->getRequestParameter('payolutionTerms')) {
oxRegistry::getSession()->setVariable('wcs_payerrortext',
$oLang->translateString('WIRECARD_CHECKOUT_SEAMLESS_CONFIRM_PAYOLUTION_TERMS',
Expand All @@ -166,7 +175,6 @@ public function validatePayment()
return;
}
}
}
break;
}

Expand Down Expand Up @@ -612,33 +620,24 @@ public function hasWcsVatIdField($sPaymentId)
return false;
}


function showWcsTrustedShopsCheckbox($sPaymentId)
{
$config = wirecardCheckoutSeamlessConfig::getInstance();

if ($config->getInvoiceProvider() == 'PAYOLUTION') {
$installmentPayolution = $config->getInstallmentProvider() == 'PAYOLUTION';
$invoicePayolution = $config->getInvoiceProvider() == 'PAYOLUTION';
switch ($sPaymentId) {
case 'wcs_installment':
return $installmentPayolution ? $config->getInstallmentTrustedShopsCheckbox() : false;
case 'wcs_invoice_b2b':
return $config->getInvoiceb2bTrustedShopsCheckbox();
return $invoicePayolution ? $config->getInvoiceb2bTrustedShopsCheckbox() : false;
case 'wcs_invoice_b2c':
return $config->getInvoiceb2cTrustedShopsCheckbox();
return $invoicePayolution ? $config->getInvoiceb2cTrustedShopsCheckbox() : false;
default:
return false;
}
}
}

function showWcsInstallmentTrustedShopsCheckbox($sPaymentId)
{
$config = wirecardCheckoutSeamlessConfig::getInstance();

if ($config->getInstallmentProvider() == 'PAYOLUTION') {
return $config->getInstallmentTrustedShopsCheckbox();
}
return false;
}

function getWcsInvoicePayolutionTerms()
{
$oLang = oxRegistry::get('oxLang');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</div>
[{/if}]

[{if $oView->showWcsInstallmentTrustedShopsCheckbox($sPaymentID)}]
[{if $oView->showWcsTrustedShopsCheckbox($sPaymentID)}]
<input id="payolutionTerms" class='js-oxValidate js-oxValidate_notEmpty' name='payolutionTerms' type="checkbox" value="1" autocomplete="off" />[{ $oView->getWcsInstallmentPayolutionTerms() }]
[{/if}]
</dd>
Expand Down