Skip to content

Commit

Permalink
OX6-164 - Fixed some remaining issues
Browse files Browse the repository at this point in the history
  • Loading branch information
FatchipRobert committed Nov 13, 2024
1 parent 4d1f7cf commit 8351b1d
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
4 changes: 2 additions & 2 deletions application/helper/fcpopaypalhelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static function destroyInstance()
/**
* @return bool
*/
protected function showBNPLButton()
public function showBNPLButton()
{
$blReturn = false;
if ((bool)$this->getMainHelper()->fcpoGetConfig()->getConfigParam('blFCPOPayPalV2BNPL') === true) {
Expand Down Expand Up @@ -138,7 +138,7 @@ protected function getLocale()
*/
public function getJavascriptUrl()
{
$sUrl = "https://www.paypal.com/sdk/js?client-id=".$this->getClientId()."&merchant-id=".$this->getMerchantId()."&currency=".$this->getCurrency()."&intent=".$this->getIntent()."&locale=".$this->getLocale()."&commit=true&vault=false&disable-funding=card,sepa,bancontact";
$sUrl = "https://www.paypal.com/sdk/js?client-id=".$this->getClientId()."&merchant-id=".$this->getMerchantId()."&currency=".$this->getCurrency()."&intent=".$this->getIntent()."&locale=".$this->getLocale()."&commit=false&vault=false&disable-funding=card,sepa,bancontact";
if ($this->showBNPLButton() === true) {
$sUrl .= "&enable-funding=paylater";
}
Expand Down
2 changes: 1 addition & 1 deletion application/views/frontend/tpl/fcpo_paypal_express_v2.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[{assign var="buttonId" value='fcpoPayPalExpressV2'|cat:$_payone_position}]
[{assign var="buttonId" value=$oViewConf->fcpoGetPayPalExpressV2GetButtonId($_payone_position)}]

<div id="[{$buttonId}]"></div>

Expand Down
2 changes: 2 additions & 0 deletions extend/application/models/fcPayOneOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,8 @@ public function isDetailedProductInfoNeeded()
'fcpopl_secinvoice',
'fcpopl_secinstallment',
'fcpopl_secdebitnote',
'fcpopl_secdebitnote',
fcpopaypalhelper::PPE_V2_EXPRESS,
])) {
return true;
}
Expand Down
14 changes: 14 additions & 0 deletions extend/core/fcPayOneViewConf.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,20 @@ public function fcpoCanDisplayPayPalExpressV2Button()
return fcpopaymenthelper::getInstance()->isPaymentMethodActive(fcpopaypalhelper::PPE_V2_EXPRESS);
}

/**
* Returns PayPal V2 Express Button ID
*
* @return string
*/
public function fcpoGetPayPalExpressV2GetButtonId($sPosition)
{
$sButtonId = "fcpoPayPalExpressV2";
if (fcpopaypalhelper::getInstance()->showBNPLButton() === true) {
$sButtonId .= "PayLater";
}
return $sButtonId.$sPosition;
}

/**
* Returns PayPal V2 Express Button Javascript URL
*
Expand Down
4 changes: 1 addition & 3 deletions lib/fcporequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2394,9 +2394,7 @@ public function sendRequestGenericPayment($sPaymentType, $sWorkorderId = false)
}
$this->addParameter('add_paydata[payment_action]', $sPaymentAction);

if ((bool)$this->_oFcpoHelper->fcpoGetConfig()->getConfigParam('blFCPOSendArticlelist') === true) {
$this->_fcpoAddBasketItemsFromSession();
}
$this->_fcpoAddBasketItemsFromSession();
}

$this->_addRedirectUrls('basket', false, 'fcpoHandlePayPalExpress');
Expand Down
6 changes: 6 additions & 0 deletions out/src/css/fcpopaypalexpress.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@
width: 217px;
float: right;
padding-right: 12px;
}

#fcpoPayPalExpressV2PayLaterBasketTop, #fcpoPayPalExpressV2PayLaterBasketBottom {
width: 444px;
float: right;
padding-right: 4px;
}

0 comments on commit 8351b1d

Please sign in to comment.