from app.services.payment.base import PaymentGateway, PaymentOrder, PaymentCallback
from app.services.payment.mock_gateway import MockGateway
from app.services.payment.wechat_pay import WeChatPayGateway
from app.services.payment.alipay import AlipayGateway


def get_payment_gateway(provider: str = "wechat") -> PaymentGateway:
    from app.config import settings

    if settings.PAYMENT_MODE == "mock" or not settings.WECHAT_PAY_MCH_ID:
        return MockGateway()

    if provider == "wechat":
        return WeChatPayGateway()
    elif provider == "alipay":
        return AlipayGateway()

    return MockGateway()


__all__ = [
    "PaymentGateway",
    "PaymentOrder",
    "PaymentCallback",
    "MockGateway",
    "WeChatPayGateway",
    "AlipayGateway",
    "get_payment_gateway",
]
