From 198a449a55d7b4999961e519a9833695349fd5ed Mon Sep 17 00:00:00 2001 From: David Rodenkirchen Date: Mon, 3 Feb 2025 07:30:14 +0000 Subject: [PATCH] extend paypal payment info (#7) Co-authored-by: David Rodenkirchen Reviewed-on: https://git.ezgg-ev.de/Vereins-IT/ez-lan-manager/pulls/7 --- src/ez_lan_manager/pages/Account.py | 69 ++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 6 deletions(-) diff --git a/src/ez_lan_manager/pages/Account.py b/src/ez_lan_manager/pages/Account.py index 446bf40..e68588e 100644 --- a/src/ez_lan_manager/pages/Account.py +++ b/src/ez_lan_manager/pages/Account.py @@ -15,6 +15,7 @@ class AccountPage(Component): balance: Optional[int] = None transaction_history: list[Transaction] = list() banking_info_revealer_open: bool = False + paypal_info_revealer_open: bool = False @event.on_populate async def on_populate(self) -> None: @@ -23,9 +24,12 @@ class AccountPage(Component): self.balance = await self.session[AccountingService].get_balance(self.user.user_id) self.transaction_history = await self.session[AccountingService].get_transaction_history(self.user.user_id) - async def _on_banking_info_press(self): + async def _on_banking_info_press(self) -> None: self.banking_info_revealer_open = not self.banking_info_revealer_open + async def _on_paypal_info_press(self) -> None: + self.paypal_info_revealer_open = not self.paypal_info_revealer_open + def build(self) -> Component: if not self.user and not self.balance: return Column( @@ -55,10 +59,52 @@ class AccountPage(Component): align_x=0.5 ), Text( - "Kontoinhaber: Einfach Zocken Gaming Gesellschaft\n" - "IBAN: DE47 5176 2434 0019 8566 07\n" - "BLZ: 51762434\n" - "BIC: GENODE51BIK\n\n" + "Kontoinhaber: Einfach Zocken Gaming Gesellschaft\n" + "IBAN: DE47 5176 2434 0019 8566 07\n" + "BLZ: 51762434\n" + "BIC: GENODE51BIK\n\n" + "Verwendungszweck:", + style=TextStyle( + fill=self.session.theme.background_color, + font_size=0.7 + ), + margin=0, + margin_bottom=1, + align_x=0.2 + ), + Text( + f"AUFLADUNG - {self.user.user_id} - {self.user.user_name}", + style=TextStyle( + fill=self.session.theme.neutral_color + ), + margin=0, + margin_bottom=1, + align_x=0.5 + ) + ), + margin=2, + margin_top=0, + margin_bottom=1, + grow_x=True + ) + + paypal_info_revealer = Revealer( + is_open=self.bind().paypal_info_revealer_open, + header=None, + content=Column( + Text( + "PayPal Verbindung:", + style=TextStyle( + fill=self.session.theme.background_color + ), + margin=0, + margin_top=0, + margin_bottom=1, + align_x=0.5 + ), + Text( + "Empfänger: tech@ezgg-ev.de\n" + "Zahlungsart: Freunde und Familie\n" "Verwendungszweck:", style=TextStyle( fill=self.session.theme.background_color, @@ -161,9 +207,20 @@ class AccountPage(Component): on_press=self._on_banking_info_press ), banking_info_revealer, + Button( + content=Text("PAYPAL (ohne Gebühr - Freunde&Familie)", style=TextStyle(fill=Color.from_hex("121212"), font_size=0.8), justify="center"), + shape="rectangle", + style="major", + color="secondary", + grow_x=True, + margin=2, + margin_top=0, + on_press=self._on_paypal_info_press + ), + paypal_info_revealer, Link( content=Button( - content=Text("PAYPAL (3% Gebühr)", style=TextStyle(fill=Color.from_hex("121212"), font_size=0.8), justify="center"), + content=Text("PAYPAL (3% Gebühr - Gewerblich)", style=TextStyle(fill=Color.from_hex("121212"), font_size=0.8), justify="center"), shape="rectangle", style="major", color="secondary",