Skip to content
Merged
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
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
Expand All @@ -72,12 +72,12 @@ jobs:
run: |
make test
env:
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
COVERAGE_FILE: coverage/.coverage.py${{ matrix.python-version }}
CONTEXT: py${{ matrix.python-version }}
- name: Store coverage files
uses: actions/upload-artifact@v4
with:
name: coverage-${{ runner.os }}-py${{ matrix.python-version }}
name: coverage-py${{ matrix.python-version }}
path: coverage
include-hidden-files: true
coverage-combine:
Expand Down Expand Up @@ -108,6 +108,9 @@ jobs:
with:
path: .venv
key: venv-Linux-3.9-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
if: steps.cached-uv-dependencies.outputs.cache-hit != 'true'
run: uv sync --no-dev --no-group=docs
#----------------------------------------------
- name: Get coverage files
uses: actions/download-artifact@v4
Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ repos:
hooks:
- id: format
name: format
entry: make format
language: system
pass_filenames: false
files: \.py
entry: duty format
- id: lint
name: lint
entry: make lint
language: system
pass_filenames: false
files: \.py
entry: duty lint
- id: typecheck
name: typecheck
entry: make type-check
language: system
pass_filenames: false
files: \.py
entry: duty type-check
- id: secure
name: secure
entry: make secure
entry: duty secure
language: system
pass_filenames: false
- id: docs
name: docs
entry: make docs
entry: duty docs
language: system
pass_filenames: false
- id: test
name: test
entry: make test
entry: duty test
language: system
pass_filenames: false

4 changes: 1 addition & 3 deletions docs/az/docs/integrations/epoint/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
Bu sorğulardan istifadə etmək üçün, bu dəyərləri "environment variable"-larına əlavə etməlisiniz: `EPOINT_PUBLIC_KEY`, `EPOINT_PRIVATE_KEY`

???+ note
EPoint interfeysinin dilini dəyişmək istəyirsinizsə, `EPOINT_INTERFACE_LANG` "environment variable"-na dəyər verin. Default olaraq, Azərbaycan dili olacaq.

Sorğular uğurlu və ya uğursuz olduqda, spesifik URL-ə yönləndirmək istəyirsinizsə, bu dəyişənlərə də mühit levelində dəyər verin: `EPOINT_SUCCESS_REDIRECT_URL`, `EPOINT_FAILED_REDIRECT_URL`
Mühit dəyişənləri haqqında [burdan](./env.md) oxuya bilərsiniz.

## Rəsmi Dokumentasiya (v1.0.3) { #official-documentation }

Expand Down
4 changes: 3 additions & 1 deletion docs/az/docs/integrations/epoint/api-reference/callback.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# EPoint callback sorğu schema-ları

::: integrify.epoint.schemas.callback.CallbackDataSchema

::: integrify.epoint.schemas.callback.DecodedCallbackDataSchema
::: integrify.epoint.schemas.callback.DecodedCallbackDataSchema
2 changes: 1 addition & 1 deletion docs/az/docs/integrations/epoint/api-reference/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

İstifadəsi göstərilən bütün sorğular sinxrondur. Asinxron versiyasaları istifadə etmək üçün
bu importu edin və eyni-adlı funksiyaları `await` ilə çağırın:

```python
from integrify.epoint import EPointAsyncRequest
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# EPoint köməkçi funksiyaları

::: integrify.epoint.helpers.decode_callback_data
handler: python
options:
Expand Down
6 changes: 4 additions & 2 deletions docs/az/docs/integrations/epoint/api-reference/response.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Main
# EPoint sorğu cavabı schema-ları

## Main

::: integrify.epoint.schemas.response.MinimalResponseSchema

Expand All @@ -14,6 +16,6 @@

::: integrify.epoint.schemas.response.SplitPayWithSavedCardResponseSchema

# Extra
## Extra

::: integrify.epoint.schemas.response.BaseWithCodeSchema
23 changes: 23 additions & 0 deletions docs/az/docs/integrations/epoint/env.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# EPoint mühit dəyişənləri

## Haqqında

Aşağıdakı cədvəldə bütün mühit dəyişənləri ilə tanış ola bilərsiniz.

| Dəyişənin adı | Məcburi? | Mənası | Default dəyəri |
| :-------------------------- | :------------------------ | :--------------------------------------------------------: | :------------: |
| EPOINT_PUBLIC_KEY | :fontawesome-solid-check: | EPoint tərəfindən verilmiş public açar | `-` |
| EPOINT_PRIVATE_KEY | :fontawesome-solid-check: | EPoint tərəfindən verilmiş private açar | `-` |
| EPOINT_INTERFACE_LANG | :x: | İstifadəçilərin yönələcəyi EPoint səhifəsinin dili | `az` |
| EPOINT_SUCCESS_REDIRECT_URL | :x: | İstifadəçilərin **uğurlu** ödənişdən sonra yönələcəyi url | `-` |
| EPOINT_FAILED_REDIRECT_URL | :x: | İstifadəçilərin **uğursuz** ödənişdən sonra yönələcəyi url | `-` |

## .env template

```text
EPOINT_PUBLIC_KEY=
EPOINT_PRIVATE_KEY=
EPOINT_INTERFACE_LANG=
EPOINT_SUCCESS_REDIRECT_URL=
EPOINT_FAILED_REDIRECT_URL=
```
1 change: 1 addition & 0 deletions docs/az/partial.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
EPoint:
- Ümumi məlumat: "integrations/epoint/about.md"
- Mühit dəyişənləri: "integrations/epoint/env.md"
- API Referansı:
- API Klient: "integrations/epoint/api-reference/client.md"
- Schemas:
Expand Down
60 changes: 18 additions & 42 deletions duties.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,32 @@ def setup(ctx: context.Context) -> None:


@duty
def format(ctx: context.Context):
def format(ctx: context.Context, *files): # pylint: disable=redefined-builtin
"""Format the files."""
ctx.run('ruff check --fix-only --exit-zero', title='Auto-fixing code')
ctx.run('ruff format', title='Formatting code')

arg = ' '.join(files if files else SRC)

ctx.run(f'ruff check {arg} --fix-only --exit-zero', title='Auto-fixing code')
ctx.run(f'ruff format {arg}', title='Formatting code')


@duty
def lint(ctx: context.Context):
def lint(ctx: context.Context, *files):
"""Lint the files."""
ctx.run('ruff check', title='Linting with ruff check')
ctx.run('ruff format --check', title='Linting with ruff format')
ctx.run('pylint .', title='Linting with pylint')

arg = ' '.join(files if files else SRC)

ctx.run(f'ruff check {arg}', title='Linting with ruff check')
ctx.run(f'ruff format {arg} --check', title='Linting with ruff format')
ctx.run(f'pylint {arg}', title='Linting with pylint')


@duty
def type_check(ctx: context.Context):
def type_check(ctx: context.Context, *files):
"""Type check the files."""
ctx.run('mypy .', title='Type checking with mypy')
arg = ' '.join(files if files else SRC)

ctx.run(f'mypy {arg}', title='Type checking with mypy')


@duty
Expand Down Expand Up @@ -140,7 +148,7 @@ def secure(ctx: context.Context):


@duty(pre=['format', 'lint', 'test', 'docs'])
def all():
def all(): # pylint: disable=redefined-builtin
"""Run all main tasks: format, lint, test, docs."""


Expand All @@ -158,35 +166,3 @@ def clean(ctx: context.Context): # pylint: disable=unused-argument
shutil.rmtree(dirpath, ignore_errors=True)

print('Done.') # noqa: T201


@duty
def new_integration(ctx: context.Context, name: str):
# pylint: disable=all

"""Create files for new integration."""
os.makedirs(f'src/integrify/{name}/schemas', exist_ok=True)
os.makedirs(f'tests/{name}', exist_ok=True)

for lang in DOCS_LANGS:
os.makedirs(f'docs/{lang}/docs/integrations/{name}', exist_ok=True)

# Create files in src/integrify/${name}
open(f'src/integrify/{name}/__init__.py', 'a').close()
open(f'src/integrify/{name}/client.py', 'a').close()
open(f'src/integrify/{name}/handlers.py', 'a').close()
open(f'src/integrify/{name}/env.py', 'a').close()

# Create files in src/integrify/${name}/schemas
open(f'src/integrify/{name}/schemas/__init__.py', 'a').close()
open(f'src/integrify/{name}/schemas/request.py', 'a').close()
open(f'src/integrify/{name}/schemas/response.py', 'a').close()

# Create files in tests/${name}
open(f'tests/{name}/__init__.py', 'a').close()
open(f'tests/{name}/conftest.py', 'a').close()
open(f'tests/{name}/mocks.py', 'a').close()

# Create files in docs/${lang}/docs/${name}
open(f'docs/{lang}/docs/integrations/{name}/about.md', 'a').close()
open(f'docs/{lang}/docs/integrations/{name}/api-reference.md', 'a').close()
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ build-backend = "hatchling.build"
[project]
name = "integrify-epoint"
version = "1.0.0"
description = "Integrify API inteqrasiyalarını rahatlaşdıran sorğular kitabaxanasıdır."
description = "Integrify API inteqrasiyalarını rahatlaşdıran sorğular kitabaxanasıdır. Bu kitabxana Epoint inteqrasiyası üçün nəzərdə tutulmuşdur."
authors = [{ name = "mmzeynalli", email = "miradil.zeynalli@gmail.com" }]
requires-python = "~=3.9"
requires-python = ">=3.9"
readme = "README.md"
license = "GPL-3.0-or-later"
classifiers = [
Expand Down Expand Up @@ -39,7 +39,7 @@ dependencies = ["integrify-core>=1.0.3,<2"]

[project.urls]
Homepage = "https://integrify.mmzeynalli.dev/integrations/epoint/about"
Repository = "https://github.com/ntegrify-SDK/integrify-epoint-python"
Repository = "https://github.com/Integrify-SDK/integrify-epoint-python"
Documentation = "https://integrify.mmzeynalli.dev/integrations/epoint/about"

[dependency-groups]
Expand Down
5 changes: 3 additions & 2 deletions src/integrify/epoint/schemas/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ class BaseResponseSchema(MinimalResponseSchema):

class BaseWithCodeSchema(BaseResponseSchema):
code: Optional[str] = None
"""Bankın cavab kodu. 3 rəqəmli koddan, xəta/uğur mesajına çevrilir."""
"""Bankın 3 rəqəmli cavab kodu."""

@field_validator('code', mode='before')
@classmethod
def code_to_msg(cls, v: Optional[str] = None) -> Optional[str]: # pylint: disable=missing-function-docstring
def code_to_msg(cls, v: Optional[str] = None) -> Optional[str]:
"""3 rəqəmli koddan, xəta/uğur mesajına çevrilir."""
return Code[v] if v else None


Expand Down
Loading