feat: add PayKilla payment provider
This commit is contained in:
@@ -369,7 +369,7 @@ SETTINGS_MANIFEST: List[SettingField] = [
|
||||
"string",
|
||||
"payments",
|
||||
"Порядок методов оплаты",
|
||||
"Через запятую: severpay,freekassa,yookassa,platega,stars,cryptopay,heleket",
|
||||
"Через запятую: severpay,freekassa,yookassa,platega,stars,cryptopay,heleket,paykilla",
|
||||
subsection="common",
|
||||
),
|
||||
# ─── Trial ─────────────────────────────────────────────────────
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, Iterable, List, Mapping, Optional
|
||||
|
||||
from . import cryptopay, freekassa, heleket, platega, severpay, stars, wata, yookassa
|
||||
from . import cryptopay, freekassa, heleket, paykilla, platega, severpay, stars, wata, yookassa
|
||||
from .base import (
|
||||
PaymentProviderPresentation,
|
||||
PaymentProviderSpec,
|
||||
@@ -21,6 +21,7 @@ PAYMENT_PROVIDER_SPECS: tuple[PaymentProviderSpec, ...] = (
|
||||
stars.SPEC,
|
||||
cryptopay.SPEC,
|
||||
heleket.SPEC,
|
||||
paykilla.SPEC,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ class PaymentContextMixin:
|
||||
"severpay": "SeverPay",
|
||||
"wata": "Wata",
|
||||
"cryptopay": "Crypto Pay",
|
||||
"paykilla": "PayKilla",
|
||||
"telegram_stars": "Telegram Stars",
|
||||
}
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ class Settings(BaseSettings):
|
||||
STARS_ADMIN_ONLY_ENABLED: bool = Field(default=False)
|
||||
PAYMENT_METHODS_ORDER: Optional[str] = Field(
|
||||
default=None,
|
||||
description="Comma-separated list of payment methods to show (e.g., severpay,wata,freekassa,yookassa,platega,stars,cryptopay)", # noqa: E501
|
||||
description="Comma-separated list of payment methods to show (e.g., severpay,wata,freekassa,yookassa,platega,stars,cryptopay,heleket,paykilla)", # noqa: E501
|
||||
)
|
||||
SUBSCRIPTION_PURCHASE_DESCRIPTION_ENABLED: bool = Field(
|
||||
default=True,
|
||||
@@ -1026,6 +1026,7 @@ class Settings(BaseSettings):
|
||||
"stars",
|
||||
"cryptopay",
|
||||
"heleket",
|
||||
"paykilla",
|
||||
]
|
||||
# Make sure default_order itself includes every registered spec.
|
||||
for sid in spec_ids:
|
||||
|
||||
@@ -75,6 +75,7 @@ SUPPORTED_REMNASHOP_PROVIDER_TYPES = {
|
||||
"TELEGRAM_STARS",
|
||||
"YOOKASSA",
|
||||
"HELEKET",
|
||||
"PAYKILLA",
|
||||
"CRYPTOPAY",
|
||||
"FREEKASSA",
|
||||
"PLATEGA",
|
||||
@@ -93,6 +94,7 @@ PAYMENT_WEBHOOK_PATHS = {
|
||||
"wata": "/webhook/wata",
|
||||
"cryptopay": "/webhook/cryptopay",
|
||||
"heleket": "/webhook/heleket",
|
||||
"paykilla": "/webhook/paykilla",
|
||||
"freekassa": "/webhook/freekassa",
|
||||
"platega": "/webhook/platega",
|
||||
}
|
||||
@@ -477,6 +479,26 @@ def remnashop_payment_gateway_overrides(
|
||||
)
|
||||
return _provider_mapping_result(gateway_type, ["heleket"], overrides, warnings)
|
||||
|
||||
if gateway_type == "PAYKILLA":
|
||||
_add_override(overrides, "PAYKILLA_ENABLED", active)
|
||||
_add_override(
|
||||
overrides,
|
||||
"PAYKILLA_API_KEY",
|
||||
settings.get("api_key") or settings.get("public_key") or settings.get("publicKey"),
|
||||
)
|
||||
_add_override(
|
||||
overrides,
|
||||
"PAYKILLA_SECRET_KEY",
|
||||
settings.get("secret_key") or settings.get("secretKey"),
|
||||
)
|
||||
if currency and currency != "RUB":
|
||||
warnings.append(
|
||||
f"PayKilla source currency was {currency}; Minishop keeps payment currency "
|
||||
"controlled by tariffs/default currency. Configure PAYKILLA_CURRENCY and "
|
||||
"PAYKILLA_PAYMENT_CURRENCIES manually if this instance needs a different default."
|
||||
)
|
||||
return _provider_mapping_result(gateway_type, ["paykilla"], overrides, warnings)
|
||||
|
||||
if gateway_type == "FREEKASSA":
|
||||
_add_override(overrides, "FREEKASSA_ENABLED", active)
|
||||
_add_override(overrides, "FREEKASSA_MERCHANT_ID", settings.get("shop_id"))
|
||||
@@ -539,6 +561,7 @@ def remnashop_post_migration_actions(
|
||||
"wata": "WATA merchant dashboard -> webhook/callback URL",
|
||||
"cryptopay": "CryptoBot/Crypto Pay app -> webhook URL",
|
||||
"heleket": "Heleket merchant dashboard -> payment webhook/callback URL",
|
||||
"paykilla": "PayKilla Dashboard -> Settings -> Webhooks",
|
||||
"freekassa": "FreeKassa shop settings -> notification/result URL",
|
||||
"platega": "Platega merchant/project settings -> webhook URL",
|
||||
}.get(provider_id, "Payment provider dashboard -> webhook/callback URL"),
|
||||
|
||||
Reference in New Issue
Block a user