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

OX6-157: Rename Giropay and add two request parameter with config options #277

Merged
Merged
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 application/translations/de/fcPayOne_lang.php
Original file line number Diff line number Diff line change
@@ -254,7 +254,7 @@
'PAYONE Kreditkarte' => 'PAYONE Kreditkarte',
'PAYONE Lastschrift' => 'PAYONE Lastschrift',
'PAYONE Nachnahme' => 'PAYONE Nachnahme',
'PAYONE paydirekt' => 'PAYONE paydirekt',
'PAYONE paydirekt' => 'PAYONE Giropay',
'PAYONE PayPal Express' => 'PAYONE PayPal Express',
'PAYONE PayPal' => 'PAYONE PayPal',
'PAYONE PostFinance Card' => 'PAYONE PostFinance Card',
2 changes: 1 addition & 1 deletion application/translations/en/fcPayOne_lang.php
Original file line number Diff line number Diff line change
@@ -265,7 +265,7 @@
'PAYONE Kreditkarte' => 'PAYONE Credit Card',
'PAYONE Lastschrift' => 'PAYONE Direct Debit',
'PAYONE Nachnahme' => 'PAYONE Cash on Delivery',
'PAYONE paydirekt' => 'PAYONE paydirekt',
'PAYONE paydirekt' => 'PAYONE Giropay',
'PAYONE PayPal Express' => 'PAYONE PayPal Express',
'PAYONE PayPal' => 'PAYONE PayPal',
'PAYONE PostFinance Card' => 'PAYONE PostFinance Card',
9 changes: 8 additions & 1 deletion application/views/admin/de/fcPayOne_lang.php
Original file line number Diff line number Diff line change
@@ -387,6 +387,13 @@
'FCPO_BNPL_CANCELLATION_REASON_DUP' => 'Die Bestellung wurde versehentlich zweimal erstellt',
'FCPO_BNPL_CANCELLATION_REASON_FRD' => 'Der Verbraucher entpuppte sich als Betrüger',
'FCPO_BNPL_CANCELLATION_REASON_UND' => 'Der Händler kann die Bestellung nicht ausführen',
'FCPO_CONFIG_GROUP_PAYDIREKT' => 'Giropay',
'FCPO_PAYDIREKT_SECURED_PREORDER' => 'Gesicherte Vorbestellung',
'FCPO_HELP_PAYDIREKT_SECURED_PREORDER' => 'Bei einer gesicherten Vorbestellung wird dem Händler eine Zahlungsgarantie für den gewählten Zeitraum (maximal 15 Kalendertage) gewährt. Captures (Teilzahlungen) müssen immer innerhalb des Garantiezeitraums ausgeführt werden.',
'FCPO_PAYDIREKT_SECURED_PREORDER_YES' => 'Ja',
'FCPO_PAYDIREKT_SECURED_PREORDER_NO' => 'Nein',
'FCPO_PAYDIREKT_SECURED_PREORDER_GUARANTEE_PERIOD' => 'Garantiezeitraum',
'FCPO_HELP_PAYDIREKT_SECURED_PREORDER_GUARANTEE_PERIOD' => 'Gewünschter Garantiezeitraum (maximal 15 Kalendertage) für eine gesicherte Vorbestellung',
'FCPO_GROUP_LOGGING' => 'Protokollierung',
'FCPO_TRANSACTIONREDIRECTLOGGING_NONE' => 'Keine Protokollierung (Standard)',
'FCPO_TRANSACTIONREDIRECTLOGGING_ALL' => 'Alles protokollieren',
@@ -460,7 +467,7 @@
'PAYONE Kreditkarte' => 'PAYONE Kreditkarte',
'PAYONE Lastschrift' => 'PAYONE Lastschrift',
'PAYONE Nachnahme' => 'PAYONE Nachnahme',
'PAYONE paydirekt' => 'PAYONE paydirekt',
'PAYONE paydirekt' => 'PAYONE Giropay',
'PAYONE PayPal Express' => 'PAYONE PayPal Express',
'PAYONE PayPal' => 'PAYONE PayPal',
'PAYONE PostFinance Card' => 'PAYONE PostFinance Card',
9 changes: 8 additions & 1 deletion application/views/admin/en/fcPayOne_lang.php
Original file line number Diff line number Diff line change
@@ -396,6 +396,13 @@
'FCPO_BNPL_CANCELLATION_REASON_DUP' => 'The Order was created twice accidentally',
'FCPO_BNPL_CANCELLATION_REASON_FRD' => 'Consumer turned out to be a fraudster',
'FCPO_BNPL_CANCELLATION_REASON_UND' => 'The merchant cannot fulfill the Order',
'FCPO_CONFIG_GROUP_PAYDIREKT' => 'Giropay',
'FCPO_PAYDIREKT_SECURED_PREORDER' => 'Secured pre-order',
'FCPO_HELP_PAYDIREKT_SECURED_PREORDER' => 'In the case of a secured pre-order, the retailer is granted a payment guarantee for the selected period (maximum 15 calendar days). Captures (partial payments) must always be executed within the guarantee period.',
'FCPO_PAYDIREKT_SECURED_PREORDER_YES' => 'Yes',
'FCPO_PAYDIREKT_SECURED_PREORDER_NO' => 'No',
'FCPO_PAYDIREKT_SECURED_PREORDER_GUARANTEE_PERIOD' => 'Guarantee period',
'FCPO_HELP_PAYDIREKT_SECURED_PREORDER_GUARANTEE_PERIOD' => 'Desired guarantee period (maximum 15 calendar days) for a secured pre-order',
'FCPO_GROUP_LOGGING' => 'Logging',
'FCPO_TRANSACTIONREDIRECTLOGGING_NONE' => 'No logs (Default)',
'FCPO_TRANSACTIONREDIRECTLOGGING_ALL' => 'Log everything',
@@ -469,7 +476,7 @@
'PAYONE Kreditkarte' => 'PAYONE Credit Card',
'PAYONE Lastschrift' => 'PAYONE Direct Debit',
'PAYONE Nachnahme' => 'PAYONE Cash on Delivery',
'PAYONE paydirekt' => 'PAYONE paydirekt',
'PAYONE paydirekt' => 'PAYONE Giropay',
'PAYONE PayPal Express' => 'PAYONE PayPal Express',
'PAYONE PayPal' => 'PAYONE PayPal',
'PAYONE PostFinance Card' => 'PAYONE PostFinance Card',
42 changes: 42 additions & 0 deletions application/views/admin/tpl/fcpayone_main.tpl
Original file line number Diff line number Diff line change
@@ -900,6 +900,48 @@
</div>
</div>

<div class="groupExp">
<div>
<a href="#" onclick="_groupExp(this);return false;" class="rc"><b>[{oxmultilang ident="FCPO_CONFIG_GROUP_PAYDIREKT"}]</b></a>
<dl>
<dt>
<select name="confbools[blFCPOPaydirektSecuredPreorder]" onchange="fcpoTogglePaydirektGuaranteePeriod(this, 'fcpoPaydirektGuaranteePeriod')">
<option value="false">
[{oxmultilang ident="FCPO_PAYDIREKT_SECURED_PREORDER_NO"}]
</option>
<option value="true" [{if $confbools.blFCPOPaydirektSecuredPreorder}]SELECTED[{/if}]>
[{oxmultilang ident="FCPO_PAYDIREKT_SECURED_PREORDER_YES"}]
</option>
</select>
[{oxinputhelp ident="FCPO_HELP_PAYDIREKT_SECURED_PREORDER"}]
</dt>
<dd>
[{oxmultilang ident="FCPO_PAYDIREKT_SECURED_PREORDER"}]
</dd>
<div class="spacer"></div>
</dl>

<div id="fcpoPaydirektGuaranteePeriod" style="[{if $confbools.blFCPOPaydirektSecuredPreorder == false}] display:none [{/if}]">
<dl>
<dt>
<select name="confstrs[sFCPOPaydirektSecuredPreorderGuaranteePeriod]">
[{section name=day start=1 loop=16 step=1}]
<option value="[{$smarty.section.day.index}]" [{if $confstrs.sFCPOPaydirektSecuredPreorderGuaranteePeriod == $smarty.section.day.index}]SELECTED[{/if}]>
[{$smarty.section.day.index}]
</option>
[{/section}]
</select>
[{oxinputhelp ident="FCPO_HELP_PAYDIREKT_SECURED_PREORDER_GUARANTEE_PERIOD"}]
</dt>
<dd>
[{oxmultilang ident="FCPO_PAYDIREKT_SECURED_PREORDER_GUARANTEE_PERIOD"}]
</dd>
<div class="spacer"></div>
</dl>
</div>
</div>
</div>

<div class="groupExp">
<div>
<a href="#" onclick="_groupExp(this);return false;" class="rc"><b>[{oxmultilang ident="FCPO_FORWARD_REDIRECTS"}]</b></a>
10 changes: 7 additions & 3 deletions core/fcpayone_events.php
Original file line number Diff line number Diff line change
@@ -47,7 +47,8 @@ class fcpayone_events
'fcpobillsafe',
'fcpoonlineueberweisung',
'fcpoklarna',
'fcpopaydirekt_express'
'fcpopaydirekt_express',
'fcpo_giropay'
);

/**
@@ -414,15 +415,14 @@ class fcpayone_events
'fcpoklarna_installments' => 'PAYONE Klarna Ratenkauf',
'fcpoklarna_directdebit' => 'PAYONE Klarna Sofort bezahlen',
'fcpobarzahlen' => 'PAYONE Barzahlen',
'fcpopaydirekt' => 'PAYONE paydirekt',
'fcpopaydirekt' => 'PAYONE Giropay',
'fcpopo_bill' => 'PAYONE Unzer Rechnungskauf',
'fcpopo_debitnote' => 'PAYONE Unzer Lastschrift',
'fcpopo_installment' => 'PAYONE Unzer Ratenkauf',
'fcporp_bill' => 'PAYONE Ratepay Rechnungskauf',
'fcpoamazonpay' => 'PAYONE Amazon Pay',
'fcpo_secinvoice' => 'PAYONE Gesicherter Rechnungskauf',
'fcpo_sofort' => 'PAYONE Sofort Überweisung',
'fcpo_giropay' => 'PAYONE Giropay',
'fcpo_eps' => 'PAYONE eps Überweisung',
'fcpo_pf_finance' => 'PAYONE PostFinance E-Finance',
'fcpo_pf_card' => 'PAYONE PostFinance Card',
@@ -1022,6 +1022,10 @@ public static function setDefaultConfigValues()
if (!$oConfig->getConfigParam('sFCPOAddresscheck')) {
$oConfig->saveShopConfVar('str', 'sFCPOAddresscheck', 'NO');
}

if (is_null($oConfig->getConfigParam('blFCPOPaydirektSecuredPreorder'))) {
$oConfig->saveShopConfVar('bool', 'blFCPOPaydirektSecuredPreorder', false);
}
}

/**
12 changes: 10 additions & 2 deletions lib/fcporequest.php
Original file line number Diff line number Diff line change
@@ -321,7 +321,7 @@ protected function setAuthorizationParameters($oOrder, $oUser, $aDynvalue, $sRef
}
}

$blPaymentTypeKnown = $this->setPaymentParameters($oOrder, $aDynvalue, $sRefNr);
$blPaymentTypeKnown = $this->setPaymentParameters($oOrder, $aDynvalue, $sRefNr, $blIsPreauthorization);

$blAddProductInfo = $oOrder->isDetailedProductInfoNeeded();

@@ -465,7 +465,7 @@ protected function _fcpoGetKlarnaFinancingType($sPaymentId)
*
* @return bool
*/
protected function setPaymentParameters($oOrder, $aDynvalue, $sRefNr)
protected function setPaymentParameters($oOrder, $aDynvalue, $sRefNr, $blIsPreauthorization = false)
{
$blAddRedirectUrls = false;
$oConfig = $this->getConfig();
@@ -553,6 +553,14 @@ protected function setPaymentParameters($oOrder, $aDynvalue, $sRefNr)
$this->addParameter('add_paydata[over_capture]','yes');
}
}
$blIsSecuredPreorder = $blIsPreauthorization
&& $oConfig->getConfigParam('blFCPOPaydirektSecuredPreorder');
if ($blIsSecuredPreorder) {
$iPaydirektGuaranteePeriod = (int) $oConfig->getConfigParam('sFCPOPaydirektSecuredPreorderGuaranteePeriod');
$this->addParameter('add_paydata[order_secured]', 'yes');
$this->addParameter('add_paydata[preauthorization_validity]', $iPaydirektGuaranteePeriod);
}

$blAddRedirectUrls = true;
break;
case 'fcpopo_bill':
8 changes: 8 additions & 0 deletions out/src/js/fcpayone_main.js
Original file line number Diff line number Diff line change
@@ -69,4 +69,12 @@ function fcpoHandleCss(oSelect, sRowName) {
} else {
fcpoInputDisable('input_css_' + sRowName);
}
}

function fcpoTogglePaydirektGuaranteePeriod(oSelect, sFieldId) {
if (oSelect.options[oSelect.selectedIndex].value === 'true') {
document.getElementById(sFieldId).style.display = 'block';
} else {
document.getElementById(sFieldId).style.display = 'none';
}
}
Loading