Skip to content

Commit

Permalink
OX6-164 - Added separate checkbox for sending billing address as ship…
Browse files Browse the repository at this point in the history
…ping address
  • Loading branch information
FatchipRobert committed Nov 29, 2024
1 parent 4196d71 commit 463d2df
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 3 deletions.
9 changes: 9 additions & 0 deletions application/controllers/admin/fcpayone_main.php
Original file line number Diff line number Diff line change
Expand Up @@ -1155,4 +1155,13 @@ private function writeFile($filename, $content, $destinationPath)
}
}

public function isPayPalV2DelAddressActive()
{
$aConfBools = $this->fcpoGetConfBools();
$sConfigOptionName = "blFCPOPayPalV2DelAddress";
if (!isset($aConfBools[$sConfigOptionName]) || $aConfBools[$sConfigOptionName] === true) {
return true;
}
return false;
}
}
2 changes: 2 additions & 0 deletions application/views/admin/de/fcPayOne_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@
'FCPO_EXPORT_CONFIG' => "Konfiguration exportieren",

'FCPO_PAYPAL_DELADDRESS' => 'Rechnungsadresse bei fehlender Lieferadresse als Lieferadresse übergeben.',
'FCPO_PAYPALV2_DELADDRESS' => 'Rechnungsadresse bei fehlender Lieferadresse als Lieferadresse übergeben.',
'FCPO_HELP_PAYPAL_DELADDRESS' => 'Wird für den PayPal Verkäuferschutz benötigt.',
'FCPO_HELP_PAYPALV2_DELADDRESS' => 'Wird für den PayPal Verkäuferschutz benötigt.',
'FCPO_PAYPAL_LOGOS' => 'Hier können Sie die verwendeten PayPal Express Logos hinterlegen.',
'FCPO_PAYPAL_LOGOS_ACTIVE' => 'Aktiv',
'FCPO_PAYPAL_LOGOS_LANG' => 'Sprache',
Expand Down
2 changes: 2 additions & 0 deletions application/views/admin/en/fcPayOne_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@
'FCPO_EXPORT_CONFIG' => "Export configuration",

'FCPO_PAYPAL_DELADDRESS' => 'Transmit the billing-address as delivery-address if delivery-address is missing.',
'FCPO_PAYPALV2_DELADDRESS' => 'Transmit the billing-address as delivery-address if delivery-address is missing.',
'FCPO_HELP_PAYPAL_DELADDRESS' => 'This is used for the PayPal seller protection.',
'FCPO_HELP_PAYPALV2_DELADDRESS' => 'This is used for the PayPal seller protection.',
'FCPO_PAYPAL_LOGOS' => 'You can upload the PayPal Express logos here.',
'FCPO_PAYPAL_LOGOS_ACTIVE' => 'active',
'FCPO_PAYPAL_LOGOS_LANG' => 'language',
Expand Down
11 changes: 11 additions & 0 deletions application/views/admin/tpl/fcpayone_main.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,17 @@
<div class="groupExp">
<div [{if $oView->fcpoIsLogoAdded()}] class="exp"[{/if}]>
<a href="#" onclick="_groupExp(this);return false;" class="rc"><b>[{oxmultilang ident="FCPO_CONFIG_GROUP_PAYPALV2"}]</b></a>
<dl>
<dt>
<input type="hidden" name="confbools[blFCPOPayPalV2DelAddress]" value="false">
<input type="checkbox" name="confbools[blFCPOPayPalV2DelAddress]" value="true" [{if $oView->isPayPalV2DelAddressActive()}]checked[{/if}]>
[{oxinputhelp ident="FCPO_HELP_PAYPALV2_DELADDRESS"}]
</dt>
<dd>
[{oxmultilang ident="FCPO_PAYPALV2_DELADDRESS"}]
</dd>
<div class="spacer"></div>
</dl>
<dl>
<dt>
<input type="hidden" name="confbools[blFCPOPayPalV2BNPL]" value="false">
Expand Down
18 changes: 17 additions & 1 deletion extend/application/models/fcPayOneOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1665,8 +1665,24 @@ public function fcIsPayPalOrder()
$blReturn = false;
if (in_array($this->oxorder__oxpaymenttype->value, [
'fcpopaypal',
'fcpopaypalv2',
fcpopaypalhelper::PPE_EXPRESS,
])) {
$blReturn = true;
}
return $blReturn;
}

/**
* Method checks via current paymenttype is of payone paypal V2 type
*
* @param void
* @return boolean
*/
public function fcIsPayPalV2Order()
{
$blReturn = false;
if (in_array($this->oxorder__oxpaymenttype->value, [
'fcpopaypalv2',
fcpopaypalhelper::PPE_V2_EXPRESS,
])) {
$blReturn = true;
Expand Down
4 changes: 2 additions & 2 deletions lib/fcporequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ protected function setAuthorizationParameters($oOrder, $oUser, $aDynvalue, $sRef

$blIsWalletTypePaymentWithDelAddress = (
$oOrder->oxorder__oxpaymenttype->value == 'fcpopaydirekt' ||
$oOrder->fcIsPayPalOrder() === true &&
$this->getConfig()->getConfigParam('blFCPOPayPalDelAddress') === true
($oOrder->fcIsPayPalOrder() === true && $this->getConfig()->getConfigParam('blFCPOPayPalDelAddress') === true) ||
($oOrder->fcIsPayPalV2Order() === true && $this->getConfig()->getConfigParam('blFCPOPayPalV2DelAddress') === true)
);

$blIsBNPLPayment = (
Expand Down

0 comments on commit 463d2df

Please sign in to comment.