Skip to content

Commit cb337d1

Browse files
authored
CC-1548/update-styling (#197)
1 parent 6f6b22d commit cb337d1

File tree

4 files changed

+81
-38
lines changed

4 files changed

+81
-38
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @unzerdev/connectivity

src/Resources/EmbeddedResources/Paypage/Style.php

Lines changed: 66 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,60 @@
66

77
class Style extends AbstractUnzerResource
88
{
9-
protected ?string $fontFamily = null;
10-
protected ?string $buttonColor = null;
11-
protected ?string $primaryTextColor = null;
12-
protected ?string $linkColor = null;
9+
protected ?bool $hideUnzerLogo = null;
10+
protected ?bool $shadows = null;
1311
protected ?string $backgroundColor = null;
12+
protected ?string $backgroundImage = null;
13+
protected ?string $brandColor = null;
1414
protected ?string $cornerRadius = null;
15-
protected ?bool $shadows = null;
16-
protected ?bool $hideUnzerLogo = null;
15+
protected ?string $font = null;
16+
protected ?string $footerColor = null;
17+
protected ?string $headerColor = null;
18+
protected ?string $logoImage = null;
19+
protected ?string $linkColor = null;
20+
protected ?string $textColor = null;
1721

18-
public function getFontFamily(): ?string
22+
public function getLogoImage(): ?string
1923
{
20-
return $this->fontFamily;
24+
return $this->logoImage;
2125
}
2226

23-
public function setFontFamily(?string $fontFamily): Style
27+
public function setLogoImage(?string $logoImage): Style
2428
{
25-
$this->fontFamily = $fontFamily;
29+
$this->logoImage = $logoImage;
2630
return $this;
2731
}
2832

29-
public function getButtonColor(): ?string
33+
public function getFont(): ?string
3034
{
31-
return $this->buttonColor;
35+
return $this->font;
3236
}
3337

34-
public function setButtonColor(?string $buttonColor): Style
38+
public function setFont(?string $font): Style
3539
{
36-
$this->buttonColor = $buttonColor;
40+
$this->font = $font;
3741
return $this;
3842
}
3943

40-
public function getPrimaryTextColor(): ?string
44+
public function getBrandColor(): ?string
4145
{
42-
return $this->primaryTextColor;
46+
return $this->brandColor;
4347
}
4448

45-
public function setPrimaryTextColor(?string $primaryTextColor): Style
49+
public function setBrandColor(?string $brandColor): Style
4650
{
47-
$this->primaryTextColor = $primaryTextColor;
51+
$this->brandColor = $brandColor;
52+
return $this;
53+
}
54+
55+
public function getTextColor(): ?string
56+
{
57+
return $this->textColor;
58+
}
59+
60+
public function setTextColor(?string $textColor): Style
61+
{
62+
$this->textColor = $textColor;
4863
return $this;
4964
}
5065

@@ -102,4 +117,37 @@ public function setHideUnzerLogo(?bool $hideUnzerLogo): Style
102117
$this->hideUnzerLogo = $hideUnzerLogo;
103118
return $this;
104119
}
120+
121+
public function getBackgroundImage(): ?string
122+
{
123+
return $this->backgroundImage;
124+
}
125+
126+
public function setBackgroundImage(?string $backgroundImage): Style
127+
{
128+
$this->backgroundImage = $backgroundImage;
129+
return $this;
130+
}
131+
132+
public function getFooterColor(): ?string
133+
{
134+
return $this->footerColor;
135+
}
136+
137+
public function setFooterColor(?string $footerColor): Style
138+
{
139+
$this->footerColor = $footerColor;
140+
return $this;
141+
}
142+
143+
public function getHeaderColor(): ?string
144+
{
145+
return $this->headerColor;
146+
}
147+
148+
public function setHeaderColor(?string $headerColor): Style
149+
{
150+
$this->headerColor = $headerColor;
151+
return $this;
152+
}
105153
}

src/Resources/V2/Paypage.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class Paypage extends AbstractUnzerResource
2424
*/
2525
protected ?string $checkoutType = null;
2626
protected ?string $invoiceId = null;
27-
protected ?string $logoImage = null;
2827
protected ?string $orderId = null;
2928
protected ?string $paymentReference = null;
3029
protected ?string $recurrenceType = null;
@@ -178,17 +177,6 @@ public function setRecurrenceType(?string $recurrenceType): Paypage
178177
return $this;
179178
}
180179

181-
public function getLogoImage(): ?string
182-
{
183-
return $this->logoImage;
184-
}
185-
186-
public function setLogoImage(?string $logoImage): Paypage
187-
{
188-
$this->logoImage = $logoImage;
189-
return $this;
190-
}
191-
192180
public function getShopName(): ?string
193181
{
194182
return $this->shopName;

test/integration/Resources/PaypageV2Test.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,24 @@ public function createPaypageWithUrls()
163163

164164
/**
165165
* @test
166+
* @group CC-1548
166167
*/
167168
public function createPaypageWithStyle()
168169
{
169170
$style = new Style();
170-
$style->setFontFamily('comic sans');
171-
$style->setButtonColor('red');
172-
$style->setPrimaryTextColor('green');
173-
$style->setLinkColor('blue');
174-
$style->setBackgroundColor('black');
175-
$style->setCornerRadius('5px');
176-
$style->setShadows(true);
177-
$style->setHideUnzerLogo(true);
171+
$style
172+
->setBackgroundColor('#1f1f1f')
173+
->setBackgroundImage('https://backgroundimage.com')
174+
->setBrandColor('#1f1f1f')
175+
->setCornerRadius('5px')
176+
->setFont('comic sans')
177+
->setFooterColor('#1f1f1f')
178+
->setHeaderColor('#ff7f7f')
179+
->setHideUnzerLogo(true)
180+
->setLogoImage('https://logoimage.com')
181+
->setLinkColor('#1f1f1f')
182+
->setShadows(true)
183+
->setTextColor('#1f1f1f');
178184

179185
$paypage = new Paypage(9.99, 'EUR', 'charge');
180186
$paypage->setStyle($style);

0 commit comments

Comments
 (0)