payme-pkg 2.6.5__py3-none-any.whl → 2.6.7__py3-none-any.whl
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 payme-pkg might be problematic. Click here for more details.
- core/__init__.py +0 -0
- core/asgi.py +16 -0
- core/settings.py +133 -0
- core/urls.py +25 -0
- core/wsgi.py +16 -0
- my_app/__init__.py +0 -0
- my_app/admin.py +3 -0
- my_app/apps.py +6 -0
- my_app/migrations/__init__.py +0 -0
- my_app/models.py +3 -0
- my_app/tests.py +3 -0
- my_app/views.py +16 -0
- payme/models.py +21 -14
- {payme_pkg-2.6.5.dist-info → payme_pkg-2.6.7.dist-info}/METADATA +4 -4
- {payme_pkg-2.6.5.dist-info → payme_pkg-2.6.7.dist-info}/RECORD +18 -6
- {payme_pkg-2.6.5.dist-info → payme_pkg-2.6.7.dist-info}/WHEEL +1 -1
- payme_pkg-2.6.7.dist-info/top_level.txt +3 -0
- payme_pkg-2.6.5.dist-info/top_level.txt +0 -1
- {payme_pkg-2.6.5.dist-info → payme_pkg-2.6.7.dist-info}/LICENSE.txt +0 -0
core/__init__.py
ADDED
|
File without changes
|
core/asgi.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ASGI config for core project.
|
|
3
|
+
|
|
4
|
+
It exposes the ASGI callable as a module-level variable named ``application``.
|
|
5
|
+
|
|
6
|
+
For more information on this file, see
|
|
7
|
+
https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import os
|
|
11
|
+
|
|
12
|
+
from django.core.asgi import get_asgi_application
|
|
13
|
+
|
|
14
|
+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
|
|
15
|
+
|
|
16
|
+
application = get_asgi_application()
|
core/settings.py
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Django settings for core project.
|
|
3
|
+
|
|
4
|
+
Generated by 'django-admin startproject' using Django 4.1.
|
|
5
|
+
|
|
6
|
+
For more information on this file, see
|
|
7
|
+
https://docs.djangoproject.com/en/4.1/topics/settings/
|
|
8
|
+
|
|
9
|
+
For the full list of settings and their values, see
|
|
10
|
+
https://docs.djangoproject.com/en/4.1/ref/settings/
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
|
16
|
+
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# Quick-start development settings - unsuitable for production
|
|
20
|
+
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
|
|
21
|
+
|
|
22
|
+
# SECURITY WARNING: keep the secret key used in production secret!
|
|
23
|
+
SECRET_KEY = 'django-insecure-kc)e&w47x5n@)dgep=ffbkr1th2xjpx4n-8=heu6%%z4p4r8u&'
|
|
24
|
+
|
|
25
|
+
# SECURITY WARNING: don't run with debug turned on in production!
|
|
26
|
+
DEBUG = True
|
|
27
|
+
|
|
28
|
+
ALLOWED_HOSTS = ['*']
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# Application definition
|
|
32
|
+
|
|
33
|
+
INSTALLED_APPS = [
|
|
34
|
+
'django.contrib.admin',
|
|
35
|
+
'django.contrib.auth',
|
|
36
|
+
'django.contrib.contenttypes',
|
|
37
|
+
'django.contrib.sessions',
|
|
38
|
+
'django.contrib.messages',
|
|
39
|
+
'django.contrib.staticfiles',
|
|
40
|
+
'payme',
|
|
41
|
+
'my_app'
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
MIDDLEWARE = [
|
|
45
|
+
'django.middleware.security.SecurityMiddleware',
|
|
46
|
+
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
47
|
+
'django.middleware.common.CommonMiddleware',
|
|
48
|
+
'django.middleware.csrf.CsrfViewMiddleware',
|
|
49
|
+
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
50
|
+
'django.contrib.messages.middleware.MessageMiddleware',
|
|
51
|
+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
ROOT_URLCONF = 'core.urls'
|
|
55
|
+
|
|
56
|
+
TEMPLATES = [
|
|
57
|
+
{
|
|
58
|
+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
59
|
+
'DIRS': [],
|
|
60
|
+
'APP_DIRS': True,
|
|
61
|
+
'OPTIONS': {
|
|
62
|
+
'context_processors': [
|
|
63
|
+
'django.template.context_processors.debug',
|
|
64
|
+
'django.template.context_processors.request',
|
|
65
|
+
'django.contrib.auth.context_processors.auth',
|
|
66
|
+
'django.contrib.messages.context_processors.messages',
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
WSGI_APPLICATION = 'core.wsgi.application'
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
# Database
|
|
76
|
+
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
|
|
77
|
+
|
|
78
|
+
DATABASES = {
|
|
79
|
+
'default': {
|
|
80
|
+
'ENGINE': 'django.db.backends.sqlite3',
|
|
81
|
+
'NAME': BASE_DIR / 'db.sqlite3',
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# Password validation
|
|
87
|
+
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
|
|
88
|
+
|
|
89
|
+
AUTH_PASSWORD_VALIDATORS = [
|
|
90
|
+
{
|
|
91
|
+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
|
101
|
+
},
|
|
102
|
+
]
|
|
103
|
+
|
|
104
|
+
PAYME: dict = {
|
|
105
|
+
'PAYME_ID': '64245b936420371977b5c755',
|
|
106
|
+
'PAYME_KEY': 'yHI3RA1RN&H5f0Svcrx@vq9muNsmHUo49dTv',
|
|
107
|
+
'PAYME_URL': 'https://checkout.test.paycom.uz',
|
|
108
|
+
'PAYME_CALL_BACK_URL': 'https://internal-monitor-greatly.ngrok-free.app/payment/merchant', # merchant api callback url
|
|
109
|
+
'PAYME_MIN_AMOUNT': 1, # integer field
|
|
110
|
+
'PAYME_ACCOUNT': 'order_id',
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
# Internationalization
|
|
114
|
+
# https://docs.djangoproject.com/en/4.1/topics/i18n/
|
|
115
|
+
|
|
116
|
+
LANGUAGE_CODE = 'en-us'
|
|
117
|
+
|
|
118
|
+
TIME_ZONE = 'UTC'
|
|
119
|
+
|
|
120
|
+
USE_I18N = True
|
|
121
|
+
|
|
122
|
+
USE_TZ = True
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
# Static files (CSS, JavaScript, Images)
|
|
126
|
+
# https://docs.djangoproject.com/en/4.1/howto/static-files/
|
|
127
|
+
|
|
128
|
+
STATIC_URL = 'static/'
|
|
129
|
+
|
|
130
|
+
# Default primary key field type
|
|
131
|
+
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
|
|
132
|
+
|
|
133
|
+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
core/urls.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""core URL Configuration
|
|
2
|
+
|
|
3
|
+
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
4
|
+
https://docs.djangoproject.com/en/4.1/topics/http/urls/
|
|
5
|
+
Examples:
|
|
6
|
+
Function views
|
|
7
|
+
1. Add an import: from my_app import views
|
|
8
|
+
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
|
9
|
+
Class-based views
|
|
10
|
+
1. Add an import: from other_app.views import Home
|
|
11
|
+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
|
12
|
+
Including another URLconf
|
|
13
|
+
1. Import the include() function: from django.urls import include, path
|
|
14
|
+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
|
15
|
+
"""
|
|
16
|
+
from django.contrib import admin
|
|
17
|
+
from django.urls import path
|
|
18
|
+
|
|
19
|
+
from my_app.views import PaymeCallBackAPIView
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
urlpatterns = [
|
|
23
|
+
path('admin/', admin.site.urls),
|
|
24
|
+
path("payments/merchant/", PaymeCallBackAPIView.as_view()),
|
|
25
|
+
]
|
core/wsgi.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
WSGI config for core project.
|
|
3
|
+
|
|
4
|
+
It exposes the WSGI callable as a module-level variable named ``application``.
|
|
5
|
+
|
|
6
|
+
For more information on this file, see
|
|
7
|
+
https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import os
|
|
11
|
+
|
|
12
|
+
from django.core.wsgi import get_wsgi_application
|
|
13
|
+
|
|
14
|
+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
|
|
15
|
+
|
|
16
|
+
application = get_wsgi_application()
|
my_app/__init__.py
ADDED
|
File without changes
|
my_app/admin.py
ADDED
my_app/apps.py
ADDED
|
File without changes
|
my_app/models.py
ADDED
my_app/tests.py
ADDED
my_app/views.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Create your views here.
|
|
2
|
+
from payme.views import MerchantAPIView
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class PaymeCallBackAPIView(MerchantAPIView):
|
|
6
|
+
"""
|
|
7
|
+
the cancel transition.
|
|
8
|
+
"""
|
|
9
|
+
def create_transaction(self, order_id, action) -> None:
|
|
10
|
+
print(f"create_transaction for order_id: {order_id}, response: {action}") # noqa
|
|
11
|
+
|
|
12
|
+
def perform_transaction(self, order_id, action) -> None:
|
|
13
|
+
print(f"perform_transaction for order_id: {order_id}, response: {action}") # noqa
|
|
14
|
+
|
|
15
|
+
def cancel_transaction(self, order_id, action) -> None:
|
|
16
|
+
print(f"cancel_transaction for order_id: {order_id}, response: {action}") # noqa
|
payme/models.py
CHANGED
|
@@ -2,6 +2,7 @@ from django.db import models
|
|
|
2
2
|
from django.conf import settings
|
|
3
3
|
from django.utils.module_loading import import_string
|
|
4
4
|
from django.core.exceptions import FieldError
|
|
5
|
+
from django.utils.translation import gettext_lazy as _
|
|
5
6
|
|
|
6
7
|
from payme.utils.logging import logger
|
|
7
8
|
|
|
@@ -12,21 +13,25 @@ class MerchantTransactionsModel(models.Model):
|
|
|
12
13
|
That's used for managing transactions in database.
|
|
13
14
|
"""
|
|
14
15
|
_id = models.CharField(max_length=255, null=True, blank=False)
|
|
15
|
-
transaction_id = models.CharField(max_length=255, null=True, blank=False)
|
|
16
|
-
order_id = models.BigIntegerField(null=True, blank=True)
|
|
17
|
-
amount = models.FloatField(null=True, blank=True)
|
|
18
|
-
time = models.BigIntegerField(null=True, blank=True)
|
|
19
|
-
perform_time = models.BigIntegerField(null=True, default=0)
|
|
20
|
-
cancel_time = models.BigIntegerField(null=True, default=0)
|
|
21
|
-
state = models.IntegerField(null=True, default=1)
|
|
22
|
-
reason = models.CharField(max_length=255, null=True, blank=True)
|
|
23
|
-
created_at_ms = models.CharField(max_length=255, null=True, blank=True)
|
|
24
|
-
created_at = models.DateTimeField(auto_now_add=True)
|
|
25
|
-
updated_at = models.DateTimeField(auto_now=True)
|
|
16
|
+
transaction_id = models.CharField(max_length=255, null=True, blank=False, verbose_name=_("Transaction ID"))
|
|
17
|
+
order_id = models.BigIntegerField(null=True, blank=True, verbose_name=_("Order ID"))
|
|
18
|
+
amount = models.FloatField(null=True, blank=True, verbose_name=_("Amount"))
|
|
19
|
+
time = models.BigIntegerField(null=True, blank=True, verbose_name=_("Time"))
|
|
20
|
+
perform_time = models.BigIntegerField(null=True, default=0, verbose_name=_("Perform Time"))
|
|
21
|
+
cancel_time = models.BigIntegerField(null=True, default=0, verbose_name=_("Cancel Time"))
|
|
22
|
+
state = models.IntegerField(null=True, default=1, verbose_name=_("State"))
|
|
23
|
+
reason = models.CharField(max_length=255, null=True, blank=True, verbose_name=_("Reason"))
|
|
24
|
+
created_at_ms = models.CharField(max_length=255, null=True, blank=True, verbose_name=_("Created At MS"))
|
|
25
|
+
created_at = models.DateTimeField(auto_now_add=True, verbose_name=_("Created At"))
|
|
26
|
+
updated_at = models.DateTimeField(auto_now=True, verbose_name=_("Updated At"))
|
|
26
27
|
|
|
27
28
|
def __str__(self):
|
|
28
29
|
return str(self._id)
|
|
29
30
|
|
|
31
|
+
class Meta:
|
|
32
|
+
verbose_name = _("Merchant Transaction")
|
|
33
|
+
verbose_name_plural = _("Merchant Transactions")
|
|
34
|
+
|
|
30
35
|
|
|
31
36
|
try:
|
|
32
37
|
CUSTOM_ORDER = import_string(settings.ORDER_MODEL)
|
|
@@ -49,9 +54,9 @@ except (ImportError, AttributeError):
|
|
|
49
54
|
Order class \
|
|
50
55
|
That's used for managing order process
|
|
51
56
|
"""
|
|
52
|
-
amount = models.IntegerField(null=True, blank=True)
|
|
53
|
-
created_at = models.DateTimeField(auto_now_add=True)
|
|
54
|
-
updated_at = models.DateTimeField(auto_now=True)
|
|
57
|
+
amount = models.IntegerField(null=True, blank=True, verbose_name=_("Amount"))
|
|
58
|
+
created_at = models.DateTimeField(auto_now_add=True, verbose_name=_("Created At"))
|
|
59
|
+
updated_at = models.DateTimeField(auto_now=True, verbose_name=_("Updated At"))
|
|
55
60
|
|
|
56
61
|
def __str__(self):
|
|
57
62
|
return f"ORDER ID: {self.pk} - AMOUNT: {self.amount}"
|
|
@@ -59,3 +64,5 @@ except (ImportError, AttributeError):
|
|
|
59
64
|
class Meta:
|
|
60
65
|
# pylint: disable=missing-class-docstring
|
|
61
66
|
managed = False
|
|
67
|
+
verbose_name = _("Order")
|
|
68
|
+
verbose_name_plural = _("Orders")
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: payme-pkg
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.7
|
|
4
4
|
Home-page: https://github.com/Muhammadali-Akbarov/payme-pkg
|
|
5
5
|
Author: Muhammadali Akbarov
|
|
6
6
|
Author-email: muhammadali17abc@gmail.com
|
|
7
7
|
License: MIT
|
|
8
8
|
Keywords: paymeuz paycomuz payme-merchant merchant-api subscribe-api payme-pkg payme-api
|
|
9
9
|
License-File: LICENSE.txt
|
|
10
|
-
Requires-Dist: requests ==2.*
|
|
11
|
-
Requires-Dist:
|
|
12
|
-
Requires-Dist:
|
|
10
|
+
Requires-Dist: requests (==2.*)
|
|
11
|
+
Requires-Dist: djangorestframework (==3.*)
|
|
12
|
+
Requires-Dist: dataclasses (==0.*) ; python_version < "3.7"
|
|
13
13
|
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
core/asgi.py,sha256=aYBcmL9ZIJl-k2KlHQcFzaQIcZjvjRwyIm--GS9_L7g,385
|
|
3
|
+
core/settings.py,sha256=W6gs8ixOHijinNTszPd7uTMQi_Y4emBMKQK3N0Y84JA,3614
|
|
4
|
+
core/urls.py,sha256=J3rpTR5ONotcf6Zi8aNJDDWCJ2ujlh-f9l30rczdJi4,858
|
|
5
|
+
core/wsgi.py,sha256=3DHSJFkQKrahriFL2FI-hjg6ApBbiaDzA_8jIOPRhdI,385
|
|
6
|
+
my_app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
my_app/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
|
|
8
|
+
my_app/apps.py,sha256=kV6-feXWDL_p3CD3QYih-yYk9WKQFfe_tfGH9QX5P10,143
|
|
9
|
+
my_app/models.py,sha256=Vjc0p2XbAPgE6HyTF6vll98A4eDhA5AvaQqsc4kQ9AQ,57
|
|
10
|
+
my_app/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
|
|
11
|
+
my_app/views.py,sha256=1ikQkSo_GbUc8TghNptl5D_-xhjA-hgzCLTpgFrZzX8,608
|
|
12
|
+
my_app/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1
13
|
payme/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
14
|
payme/admin.py,sha256=Wj-Iz6r3V0qRJ1fSithR6tNb8IfbPKF6m-x9dk_Ddxc,289
|
|
3
15
|
payme/apps.py,sha256=7b92Ava_YcKd1XYRZg9iopgAgh_85D23pqDYFaHfwvs,264
|
|
4
|
-
payme/models.py,sha256=
|
|
16
|
+
payme/models.py,sha256=POUQp4s1wsCsXRKAYB7uP2yODqBudE9d0dagMsChTpg,2877
|
|
5
17
|
payme/serializers.py,sha256=4auC-VJgM9jnF03PqOofDlAd7LkBmrquIxnUdZEcKfk,2783
|
|
6
18
|
payme/urls.py,sha256=Yn4w_CQN9q2bi0MbyKMQfvQPMO0ZSSCCp-WgymZYVv4,139
|
|
7
19
|
payme/views.py,sha256=qhJ1CQISJWQO22yGFPoYx2Uz87u-W8GOGFq2PdpYDQI,5424
|
|
@@ -29,8 +41,8 @@ payme/utils/logging.py,sha256=jp4YbMxxLPqtbpKDNvi-tAyvp3cgg_PjH-6X6ePUc2E,186
|
|
|
29
41
|
payme/utils/make_aware_datetime.py,sha256=S0qmf7SgFvSS3tV7Zv4snTwMemvkf07EbOM-10e6xwE,546
|
|
30
42
|
payme/utils/support.py,sha256=UE6bgkvVDbhoMolYPaTnadb_-i-Hc_AIDQTZ-vddA3A,209
|
|
31
43
|
payme/utils/to_json.py,sha256=XqRHRuIq4W2NXdXftAQ-pvFBvZyTDZ-ajUrJAqCooUE,237
|
|
32
|
-
payme_pkg-2.6.
|
|
33
|
-
payme_pkg-2.6.
|
|
34
|
-
payme_pkg-2.6.
|
|
35
|
-
payme_pkg-2.6.
|
|
36
|
-
payme_pkg-2.6.
|
|
44
|
+
payme_pkg-2.6.7.dist-info/LICENSE.txt,sha256=75dBVYmbzWUhwtaB1MSZfj-M-PGaMmeT9UVPli2-ZJ0,1086
|
|
45
|
+
payme_pkg-2.6.7.dist-info/METADATA,sha256=8WeCxhywx_V9ToHgS8m2FHAbkHRhuhlMqryVKrtuVkw,446
|
|
46
|
+
payme_pkg-2.6.7.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
|
|
47
|
+
payme_pkg-2.6.7.dist-info/top_level.txt,sha256=D0GInMfFt19S63Vvv4HMFRO-_YULuWk7A3vo7_lO5_M,18
|
|
48
|
+
payme_pkg-2.6.7.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
payme
|
|
File without changes
|