Skip to content

Commit a116721

Browse files
MC-42358: Flex attributes are sent to PayPal even though Text style was configured for Message
- change if statements
1 parent 9950ea5 commit a116721

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

app/code/Magento/Paypal/Model/PayLaterConfig.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,20 @@ public function getSectionConfig(string $section, string $key)
111111
*/
112112
private function getConfigStyles(string $sectionName): array
113113
{
114+
$logoType = $logoPosition = $textColor = $textSize = null;
115+
$color = $ratio = null;
114116
$styleLayout = $this->config->getPayLaterConfigValue("${sectionName}_stylelayout");
115-
$logoType = $styleLayout === 'text'
116-
? $this->config->getPayLaterConfigValue("${sectionName}_logotype") : null;
117-
$logoPosition = $styleLayout === 'text' && ($logoType === 'primary' || $logoType === 'alternative')
118-
? $this->config->getPayLaterConfigValue("${sectionName}_logoposition") : null;
119-
$textColor = $styleLayout === 'text'
120-
? $this->config->getPayLaterConfigValue("${sectionName}_textcolor") : null;
121-
$textSize = $styleLayout === 'text'
122-
? $this->config->getPayLaterConfigValue("${sectionName}_textsize") : null;
123-
$color = $styleLayout === 'flex'
124-
? $this->config->getPayLaterConfigValue("${sectionName}_color") : null;
125-
$ratio = $styleLayout === 'flex'
126-
? $this->config->getPayLaterConfigValue("${sectionName}_ratio") : null;
117+
if ($styleLayout === 'text') {
118+
$logoType = $this->config->getPayLaterConfigValue("${sectionName}_logotype");
119+
if ($logoType === 'primary' || $logoType === 'alternative') {
120+
$logoPosition = $this->config->getPayLaterConfigValue("${sectionName}_logoposition");
121+
}
122+
$textColor = $this->config->getPayLaterConfigValue("${sectionName}_textcolor");
123+
$textSize = $this->config->getPayLaterConfigValue("${sectionName}_textsize");
124+
} elseif ($styleLayout === 'flex') {
125+
$color = $this->config->getPayLaterConfigValue("${sectionName}_color");
126+
$ratio = $this->config->getPayLaterConfigValue("${sectionName}_ratio");
127+
}
127128

128129
return [
129130
'data-pp-style-layout' => $styleLayout,

0 commit comments

Comments
 (0)