Skip to content

Commit

Permalink
Merge pull request #570 from FatchipRobert/MAG2-327-Paypal-SDK-Parameter
Browse files Browse the repository at this point in the history
MAG2-327 - Changed SDK URL parameter, always send invoice list for PP…
  • Loading branch information
jvarelmann authored Nov 14, 2024
2 parents ace90e7 + dde72fc commit b770820
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Block/Paypal/ExpressButtonV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()."&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
6 changes: 3 additions & 3 deletions Model/Api/Request/Genericpayment/PayPalExpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions Model/Methods/PaypalV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit b770820

Please sign in to comment.