paytechuz 0.1.0__tar.gz → 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of paytechuz might be problematic. Click here for more details.

Files changed (44) hide show
  1. {paytechuz-0.1.0 → paytechuz-0.1.1}/MANIFEST.in +15 -0
  2. {paytechuz-0.1.0/paytechuz.egg-info → paytechuz-0.1.1}/PKG-INFO +2 -2
  3. paytechuz-0.1.1/core/payme/errors.py +25 -0
  4. paytechuz-0.1.1/paytechuz/__init__.py +62 -0
  5. {paytechuz-0.1.0 → paytechuz-0.1.1/paytechuz.egg-info}/PKG-INFO +2 -2
  6. {paytechuz-0.1.0 → paytechuz-0.1.1}/paytechuz.egg-info/SOURCES.txt +2 -3
  7. {paytechuz-0.1.0 → paytechuz-0.1.1}/paytechuz.egg-info/top_level.txt +1 -1
  8. {paytechuz-0.1.0 → paytechuz-0.1.1}/setup.py +14 -4
  9. paytechuz-0.1.0/integrations/django/migrations/0001_initial.py +0 -51
  10. paytechuz-0.1.0/integrations/django/migrations/__init__.py +0 -3
  11. paytechuz-0.1.0/tests/__init__.py +0 -1
  12. {paytechuz-0.1.0 → paytechuz-0.1.1}/README.md +0 -0
  13. {paytechuz-0.1.0 → paytechuz-0.1.1}/core/__init__.py +0 -0
  14. {paytechuz-0.1.0 → paytechuz-0.1.1}/core/base.py +0 -0
  15. {paytechuz-0.1.0 → paytechuz-0.1.1}/core/constants.py +0 -0
  16. {paytechuz-0.1.0 → paytechuz-0.1.1}/core/exceptions.py +0 -0
  17. {paytechuz-0.1.0 → paytechuz-0.1.1}/core/http.py +0 -0
  18. {paytechuz-0.1.0 → paytechuz-0.1.1}/core/utils.py +0 -0
  19. {paytechuz-0.1.0 → paytechuz-0.1.1}/gateways/__init__.py +0 -0
  20. {paytechuz-0.1.0 → paytechuz-0.1.1}/gateways/click/__init__.py +0 -0
  21. {paytechuz-0.1.0 → paytechuz-0.1.1}/gateways/click/client.py +0 -0
  22. {paytechuz-0.1.0 → paytechuz-0.1.1}/gateways/click/merchant.py +0 -0
  23. {paytechuz-0.1.0 → paytechuz-0.1.1}/gateways/click/webhook.py +0 -0
  24. {paytechuz-0.1.0 → paytechuz-0.1.1}/gateways/payme/__init__.py +0 -0
  25. {paytechuz-0.1.0 → paytechuz-0.1.1}/gateways/payme/cards.py +0 -0
  26. {paytechuz-0.1.0 → paytechuz-0.1.1}/gateways/payme/client.py +0 -0
  27. {paytechuz-0.1.0 → paytechuz-0.1.1}/gateways/payme/receipts.py +0 -0
  28. {paytechuz-0.1.0 → paytechuz-0.1.1}/gateways/payme/webhook.py +0 -0
  29. {paytechuz-0.1.0 → paytechuz-0.1.1}/integrations/__init__.py +0 -0
  30. {paytechuz-0.1.0 → paytechuz-0.1.1}/integrations/django/__init__.py +0 -0
  31. {paytechuz-0.1.0 → paytechuz-0.1.1}/integrations/django/admin.py +0 -0
  32. {paytechuz-0.1.0 → paytechuz-0.1.1}/integrations/django/apps.py +0 -0
  33. {paytechuz-0.1.0 → paytechuz-0.1.1}/integrations/django/models.py +0 -0
  34. {paytechuz-0.1.0 → paytechuz-0.1.1}/integrations/django/signals.py +0 -0
  35. {paytechuz-0.1.0 → paytechuz-0.1.1}/integrations/django/views.py +0 -0
  36. {paytechuz-0.1.0 → paytechuz-0.1.1}/integrations/django/webhooks.py +0 -0
  37. {paytechuz-0.1.0 → paytechuz-0.1.1}/integrations/fastapi/__init__.py +0 -0
  38. {paytechuz-0.1.0 → paytechuz-0.1.1}/integrations/fastapi/models.py +0 -0
  39. {paytechuz-0.1.0 → paytechuz-0.1.1}/integrations/fastapi/routes.py +0 -0
  40. {paytechuz-0.1.0 → paytechuz-0.1.1}/integrations/fastapi/schemas.py +0 -0
  41. {paytechuz-0.1.0 → paytechuz-0.1.1}/paytechuz.egg-info/dependency_links.txt +0 -0
  42. {paytechuz-0.1.0 → paytechuz-0.1.1}/paytechuz.egg-info/requires.txt +0 -0
  43. {paytechuz-0.1.0 → paytechuz-0.1.1}/setup.cfg +0 -0
  44. {paytechuz-0.1.0 → paytechuz-0.1.1}/tests/test_gateway.py +0 -0
@@ -1,6 +1,19 @@
1
1
  include LICENSE
2
2
  include README.md
3
3
  include PYPI_UPLOAD.md
4
+
5
+ # Include all Python files
6
+ include core/*.py
7
+ include core/payme/*.py
8
+ include gateways/*.py
9
+ include gateways/payme/*.py
10
+ include gateways/click/*.py
11
+ include integrations/*.py
12
+ include integrations/django/*.py
13
+ include integrations/fastapi/*.py
14
+ include integrations/flask/*.py
15
+
16
+ # Include examples
4
17
  recursive-include examples *
5
18
  recursive-exclude examples *.pyc
6
19
  recursive-exclude examples __pycache__
@@ -8,6 +21,8 @@ recursive-exclude examples/shop_env *
8
21
  recursive-exclude examples/shop/media *
9
22
  recursive-exclude examples/shop/static/img *
10
23
  recursive-exclude examples/shop/db.sqlite3
24
+
25
+ # Exclude tests and cache files
11
26
  recursive-exclude tests *.pyc
12
27
  recursive-exclude tests __pycache__
13
28
  recursive-exclude * *.py[co]
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: paytechuz
3
- Version: 0.1.0
4
- Summary: Unified Python package for Uzbekistan payment gateways (Payme, Click)
3
+ Version: 0.1.1
4
+ Summary: Unified Python package for Uzbekistan payment gateways
5
5
  Home-page: https://github.com/Muhammadali-Akbarov/paytechuz
6
6
  Author: Muhammadali Akbarov
7
7
  Author-email: muhammadali17abc@gmail.com
@@ -0,0 +1,25 @@
1
+ """
2
+ Payme API error codes.
3
+ """
4
+
5
+ # System errors
6
+ SYSTEM_ERROR = -32400
7
+ INVALID_JSON_RPC = -32600
8
+ METHOD_NOT_FOUND = -32601
9
+ INVALID_PARAMS = -32602
10
+ INTERNAL_ERROR = -32603
11
+
12
+ # Authorization errors
13
+ AUTH_ERROR = -32504
14
+ AUTH_TOKEN_INVALID = -32504
15
+ AUTH_TOKEN_EXPIRED = -32504
16
+
17
+ # Business logic errors
18
+ INVALID_AMOUNT = -31001
19
+ INVALID_ACCOUNT = -31050
20
+ COULD_NOT_PERFORM = -31008
21
+ COULD_NOT_CANCEL = -31007
22
+ TRANSACTION_NOT_FOUND = -31003
23
+ TRANSACTION_ALREADY_EXISTS = -31060
24
+ TRANSACTION_ALREADY_CANCELLED = -31061
25
+ TRANSACTION_ALREADY_COMPLETED = -31062
@@ -0,0 +1,62 @@
1
+ """PayTechUZ - Unified payment library for Uzbekistan payment systems.
2
+
3
+ This library provides a unified interface for working with Payme and Click
4
+ payment systems in Uzbekistan. It supports Django, Flask, and FastAPI.
5
+ """
6
+
7
+ from typing import Any
8
+
9
+ # These imports will be resolved when the package is installed
10
+ try:
11
+ from gateways.payme.client import PaymeGateway
12
+ from gateways.click.client import ClickGateway
13
+ from core.constants import PaymentGateway
14
+ except ImportError:
15
+ # When installed as a package, these imports will be different
16
+ from ..gateways.payme.client import PaymeGateway
17
+ from ..gateways.click.client import ClickGateway
18
+ from ..core.constants import PaymentGateway
19
+
20
+ __version__ = '0.1.0'
21
+
22
+ # Import framework integrations - these imports are used to check availability
23
+ # of frameworks, not for direct usage
24
+ try:
25
+ import django # noqa: F401 - Used for availability check
26
+ HAS_DJANGO = True
27
+ except ImportError:
28
+ HAS_DJANGO = False
29
+
30
+ try:
31
+ import fastapi # noqa: F401 - Used for availability check
32
+ HAS_FASTAPI = True
33
+ except ImportError:
34
+ HAS_FASTAPI = False
35
+
36
+ try:
37
+ import flask # noqa: F401 - Used for availability check
38
+ HAS_FLASK = True
39
+ except ImportError:
40
+ HAS_FLASK = False
41
+
42
+
43
+ def create_gateway(gateway_type: str, **kwargs) -> Any:
44
+ """
45
+ Create a payment gateway instance.
46
+
47
+ Args:
48
+ gateway_type: Type of gateway ('payme' or 'click')
49
+ **kwargs: Gateway-specific configuration
50
+
51
+ Returns:
52
+ Payment gateway instance
53
+
54
+ Raises:
55
+ ValueError: If the gateway type is not supported
56
+ """
57
+ if gateway_type.lower() == PaymentGateway.PAYME.value:
58
+ return PaymeGateway(**kwargs)
59
+ if gateway_type.lower() == PaymentGateway.CLICK.value:
60
+ return ClickGateway(**kwargs)
61
+
62
+ raise ValueError(f"Unsupported gateway type: {gateway_type}")
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: paytechuz
3
- Version: 0.1.0
4
- Summary: Unified Python package for Uzbekistan payment gateways (Payme, Click)
3
+ Version: 0.1.1
4
+ Summary: Unified Python package for Uzbekistan payment gateways
5
5
  Home-page: https://github.com/Muhammadali-Akbarov/paytechuz
6
6
  Author: Muhammadali Akbarov
7
7
  Author-email: muhammadali17abc@gmail.com
@@ -7,6 +7,7 @@ core/constants.py
7
7
  core/exceptions.py
8
8
  core/http.py
9
9
  core/utils.py
10
+ core/payme/errors.py
10
11
  gateways/__init__.py
11
12
  gateways/click/__init__.py
12
13
  gateways/click/client.py
@@ -25,16 +26,14 @@ integrations/django/models.py
25
26
  integrations/django/signals.py
26
27
  integrations/django/views.py
27
28
  integrations/django/webhooks.py
28
- integrations/django/migrations/0001_initial.py
29
- integrations/django/migrations/__init__.py
30
29
  integrations/fastapi/__init__.py
31
30
  integrations/fastapi/models.py
32
31
  integrations/fastapi/routes.py
33
32
  integrations/fastapi/schemas.py
33
+ paytechuz/__init__.py
34
34
  paytechuz.egg-info/PKG-INFO
35
35
  paytechuz.egg-info/SOURCES.txt
36
36
  paytechuz.egg-info/dependency_links.txt
37
37
  paytechuz.egg-info/requires.txt
38
38
  paytechuz.egg-info/top_level.txt
39
- tests/__init__.py
40
39
  tests/test_gateway.py
@@ -1,4 +1,4 @@
1
1
  core
2
2
  gateways
3
3
  integrations
4
- tests
4
+ paytechuz
@@ -1,21 +1,31 @@
1
+ """Setup script for PayTechUZ package."""
2
+
1
3
  import pathlib
2
- from setuptools import setup, find_packages
4
+ from setuptools import setup
3
5
 
4
6
  here = pathlib.Path(__file__).parent.resolve()
5
7
  long_description = (here / "README.md").read_text(encoding="utf-8")
6
8
 
7
9
  setup(
8
10
  name='paytechuz',
9
- version='0.1.0',
11
+ version='0.1.1',
10
12
  license='MIT',
11
13
  author="Muhammadali Akbarov",
12
14
  author_email='muhammadali17abc@gmail.com',
13
- description="Unified Python package for Uzbekistan payment gateways (Payme, Click)",
15
+ description="Unified Python package for Uzbekistan payment gateways",
14
16
  long_description=long_description,
15
17
  long_description_content_type="text/markdown",
16
18
  url='https://github.com/Muhammadali-Akbarov/paytechuz',
17
19
 
18
- packages=find_packages(),
20
+ packages=['paytechuz'],
21
+ py_modules=['core', 'gateways', 'integrations'],
22
+ package_dir={
23
+ 'paytechuz': 'paytechuz',
24
+ },
25
+ include_package_data=True,
26
+ package_data={
27
+ '': ['*.py'],
28
+ },
19
29
  python_requires='>=3.6',
20
30
 
21
31
  install_requires=[
@@ -1,51 +0,0 @@
1
- """
2
- Initial migration for PaymentTransaction model.
3
- """
4
- from django.db import migrations, models
5
-
6
-
7
- class Migration(migrations.Migration):
8
- """
9
- Initial migration for PaymentTransaction model.
10
- """
11
- initial = True
12
-
13
- dependencies = []
14
-
15
- operations = [
16
- migrations.CreateModel(
17
- name='PaymentTransaction',
18
- fields=[
19
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
20
- ('gateway', models.CharField(choices=[('payme', 'Payme'), ('click', 'Click')], max_length=10)),
21
- ('transaction_id', models.CharField(max_length=255)),
22
- ('account_id', models.CharField(max_length=255)),
23
- ('amount', models.DecimalField(decimal_places=2, max_digits=15)),
24
- ('state', models.IntegerField(choices=[(0, 'Created'), (1, 'Initiating'), (2, 'Successfully'), (-2, 'Cancelled after successful performed'), (-1, 'Cancelled during initiation')], default=0)),
25
- ('reason', models.IntegerField(blank=True, null=True, help_text='Reason for cancellation')),
26
- ('extra_data', models.JSONField(blank=True, default=dict)),
27
- ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
28
- ('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
29
- ('performed_at', models.DateTimeField(blank=True, db_index=True, null=True)),
30
- ('cancelled_at', models.DateTimeField(blank=True, db_index=True, null=True)),
31
- ],
32
- options={
33
- 'verbose_name': 'Payment Transaction',
34
- 'verbose_name_plural': 'Payment Transactions',
35
- 'db_table': 'payments',
36
- 'ordering': ['-created_at'],
37
- },
38
- ),
39
- migrations.AddIndex(
40
- model_name='paymenttransaction',
41
- index=models.Index(fields=['account_id'], name='payments_account_d4c2a8_idx'),
42
- ),
43
- migrations.AddIndex(
44
- model_name='paymenttransaction',
45
- index=models.Index(fields=['state'], name='payments_state_e0ceac_idx'),
46
- ),
47
- migrations.AlterUniqueTogether(
48
- name='paymenttransaction',
49
- unique_together={('gateway', 'transaction_id')},
50
- ),
51
- ]
@@ -1,3 +0,0 @@
1
- """
2
- Django migrations for PayTechUZ.
3
- """
@@ -1 +0,0 @@
1
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes