Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion solid/D-solid-solution.py
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# Here your solution
# Here your solution
# Implementando "Unica responsabilidad"

class PayPalService:
@staticmethod
def pay(amount: float):
print(f"Paying {amount} using PayPal...")

# separamos la creación del servicio de pago del procesamiento


class PaymentProcessor:
def __init__(self, pay_service):
self.pay_service = pay_service

def process_payment(self, amount: float):
self.pay_service.pay(amount)
24 changes: 23 additions & 1 deletion solid/I-solid-solution.py
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
# Here your solution
# Here your solution

from abc import ABC, abstractmethod

# Creamos interfaces que se necesiten(Interfaces específicas)


class IPaymentGateway(ABC):
@abstractmethod
def pay(self, amount: float) -> None:
pass


class Refunds(ABC):
@abstractmethod
def refund(self, amount: float) -> None:
pass


class Handlerdispute(ABC):
@abstractmethod
def handle_dispute(self, dispute_id: str) -> None:
pass