From dde72fccd8ca58004f1745f003f11c8a1c9ec181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Wed, 13 Nov 2024 18:23:10 +0100 Subject: [PATCH] MAG2-327 - Changed SDK URL parameter, always send invoice list for PPE V2 --- Block/Paypal/ExpressButtonV2.php | 2 +- Model/Api/Request/Genericpayment/PayPalExpress.php | 6 +++--- Model/Methods/PaypalV2.php | 8 ++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Block/Paypal/ExpressButtonV2.php b/Block/Paypal/ExpressButtonV2.php index 0bfb029b..f74656f9 100644 --- a/Block/Paypal/ExpressButtonV2.php +++ b/Block/Paypal/ExpressButtonV2.php @@ -209,7 +209,7 @@ protected function getClientId() */ public function getJavascriptUrl() { - $sUrl = "https://www.paypal.com/sdk/js?client-id=".$this->getClientId()."&merchant-id=".$this->getMerchantId()."¤cy=".$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()."¤cy=".$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"; } diff --git a/Model/Api/Request/Genericpayment/PayPalExpress.php b/Model/Api/Request/Genericpayment/PayPalExpress.php index 2094ba63..d858d2f6 100644 --- a/Model/Api/Request/Genericpayment/PayPalExpress.php +++ b/Model/Api/Request/Genericpayment/PayPalExpress.php @@ -97,10 +97,10 @@ public function sendRequest(Quote $oQuote, PayoneMethod $oPayment, $sWorkorderId if ($oPayment instanceof PaypalV2) { $this->addParameter('add_paydata[payment_action]', $oPayment->getAuthorizationMode() == PayoneConfig::REQUEST_TYPE_AUTHORIZATION ? 'Capture' : 'Authorize'); # Is either Capture (for Authorization call) or Authorize (for preauthorization call) } - } - if ($this->apiHelper->isInvoiceDataNeeded($oPayment)) { - $this->invoiceGenerator->addProductInfo($this, $oQuote); + if ($this->apiHelper->isInvoiceDataNeeded($oPayment)) { + $this->invoiceGenerator->addProductInfo($this, $oQuote); + } } $this->addRedirectUrls($oPayment); diff --git a/Model/Methods/PaypalV2.php b/Model/Methods/PaypalV2.php index b05070dd..0f487337 100644 --- a/Model/Methods/PaypalV2.php +++ b/Model/Methods/PaypalV2.php @@ -63,6 +63,14 @@ class PaypalV2 extends PayoneMethod */ protected $blNeedsRedirectUrls = true; + /** + * Determines if the invoice information has to be added + * to the authorization-request + * + * @var bool + */ + protected $blNeedsProductInfo = true; + /** * Return success url for redirect payment types *