payme-pkg 3.0.14b0__tar.gz → 3.0.16__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 payme-pkg might be problematic. Click here for more details.

Files changed (34) hide show
  1. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/PKG-INFO +30 -1
  2. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/README.md +29 -0
  3. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/classes/client.py +2 -1
  4. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/classes/initializer.py +26 -1
  5. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/exceptions/general.py +9 -0
  6. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme_pkg.egg-info/PKG-INFO +30 -1
  7. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/setup.py +1 -1
  8. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/LICENSE.txt +0 -0
  9. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/__init__.py +0 -0
  10. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/admin.py +0 -0
  11. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/apps.py +0 -0
  12. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/classes/__init__.py +0 -0
  13. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/classes/cards.py +0 -0
  14. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/classes/http.py +0 -0
  15. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/classes/receipts.py +0 -0
  16. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/const.py +0 -0
  17. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/exceptions/__init__.py +0 -0
  18. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/exceptions/webhook.py +0 -0
  19. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/migrations/__init__.py +0 -0
  20. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/models.py +0 -0
  21. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/types/__init__.py +0 -0
  22. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/types/request/__init__.py +0 -0
  23. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/types/response/__init__.py +0 -0
  24. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/types/response/cards.py +0 -0
  25. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/types/response/receipts.py +0 -0
  26. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/types/response/webhook.py +0 -0
  27. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/urls.py +0 -0
  28. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/util.py +0 -0
  29. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme/views.py +0 -0
  30. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme_pkg.egg-info/SOURCES.txt +0 -0
  31. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme_pkg.egg-info/dependency_links.txt +0 -0
  32. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme_pkg.egg-info/requires.txt +0 -0
  33. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/payme_pkg.egg-info/top_level.txt +0 -0
  34. {payme_pkg-3.0.14b0 → payme_pkg-3.0.16}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: payme-pkg
3
- Version: 3.0.14b0
3
+ Version: 3.0.16
4
4
  Home-page: https://github.com/Muhammadali-Akbarov/payme-pkg
5
5
  Author: Muhammadali Akbarov
6
6
  Author-email: muhammadali17abc@gmail.com
@@ -147,3 +147,32 @@ print(pay_link)
147
147
  ```
148
148
  https://checkout.paycom.uz/bT15b3VyLXBheW1lLWlkO2FjLmlkPTEyMzQ1NjthPTUwMDAwMDtjPWh0dHBzOi8vZXhhbXBsZS5jb20=
149
149
  ```
150
+
151
+
152
+ ## Generate Fallback Link
153
+
154
+
155
+ Example to generate fallback link:
156
+
157
+ - Input
158
+
159
+ The ID in the fallback is different from the merchant ID. You can get the ID from the Payme team.
160
+ ```python
161
+ from payme import Payme
162
+
163
+ payme = Payme(payme_id="your-payme-id", fallback_id="your-fallback-id")
164
+
165
+ form_fields = {
166
+ "driver_id": 12345,
167
+ "amount": 1000
168
+ }
169
+
170
+ fallback_link = payme.initializer.generate_fallback_link(form_fields) # form field is optional
171
+ print(fallback_link)
172
+ ```
173
+
174
+ - Output
175
+
176
+ ```
177
+ https://payme.uz/fallback/merchant/?id=examplelinkgenerated&driver_id=12345&amount=1000
178
+ ```
@@ -133,3 +133,32 @@ print(pay_link)
133
133
  ```
134
134
  https://checkout.paycom.uz/bT15b3VyLXBheW1lLWlkO2FjLmlkPTEyMzQ1NjthPTUwMDAwMDtjPWh0dHBzOi8vZXhhbXBsZS5jb20=
135
135
  ```
136
+
137
+
138
+ ## Generate Fallback Link
139
+
140
+
141
+ Example to generate fallback link:
142
+
143
+ - Input
144
+
145
+ The ID in the fallback is different from the merchant ID. You can get the ID from the Payme team.
146
+ ```python
147
+ from payme import Payme
148
+
149
+ payme = Payme(payme_id="your-payme-id", fallback_id="your-fallback-id")
150
+
151
+ form_fields = {
152
+ "driver_id": 12345,
153
+ "amount": 1000
154
+ }
155
+
156
+ fallback_link = payme.initializer.generate_fallback_link(form_fields) # form field is optional
157
+ print(fallback_link)
158
+ ```
159
+
160
+ - Output
161
+
162
+ ```
163
+ https://payme.uz/fallback/merchant/?id=examplelinkgenerated&driver_id=12345&amount=1000
164
+ ```
@@ -14,6 +14,7 @@ class Payme:
14
14
  def __init__(
15
15
  self,
16
16
  payme_id: str,
17
+ fallback_id: Union[str, None] = None,
17
18
  payme_key: Union[str, None] = None,
18
19
  is_test_mode: bool = False
19
20
  ):
@@ -25,5 +26,5 @@ class Payme:
25
26
  url = Networks.TEST_NET.value
26
27
 
27
28
  self.cards = Cards(url=url, payme_id=payme_id)
28
- self.initializer = Initializer(payme_id=payme_id)
29
+ self.initializer = Initializer(payme_id=payme_id, fallback_id=fallback_id)
29
30
  self.receipts = Receipts(url=url, payme_id=payme_id, payme_key=payme_key) # noqa
@@ -13,8 +13,10 @@ class Initializer:
13
13
  The Payme ID associated with your account
14
14
  """
15
15
 
16
- def __init__(self, payme_id: str = None):
16
+ def __init__(self, payme_id: str = None, fallback_id: str = None):
17
17
  self.payme_id = payme_id
18
+ self.fallback_id = fallback_id
19
+
18
20
 
19
21
  def generate_pay_link(
20
22
  self,
@@ -55,3 +57,26 @@ class Initializer:
55
57
  )
56
58
  params = base64.b64encode(params.encode("utf-8")).decode("utf-8")
57
59
  return f"https://checkout.paycom.uz/{params}"
60
+
61
+ def generate_fallback_link(self, form_fields: dict = None):
62
+ """
63
+ Generate a fallback URL for the Payme checkout.
64
+
65
+ Parameters
66
+ ----------
67
+ fields : dict, optional
68
+ Additional query parameters to be appended to the fallback URL.
69
+
70
+ Returns
71
+ -------
72
+ str
73
+ A fallback URL formatted as a URL, ready to be used in the payment
74
+ process.
75
+ """
76
+ result = f"https://payme.uz/fallback/merchant/?id={self.fallback_id}"
77
+
78
+ if form_fields is not None:
79
+ for key, value in form_fields.items():
80
+ result += f"&{key}={value}"
81
+
82
+ return result
@@ -146,6 +146,14 @@ class InsufficientFundsError(CardError):
146
146
  super().__init__(-31303, self.message, data)
147
147
 
148
148
 
149
+ class InsufficientFundsErrorV2(CardError):
150
+ """Insufficient funds on the card."""
151
+ message = "Insufficient funds on the card."
152
+
153
+ def __init__(self, data=None):
154
+ super().__init__(-31630, self.message, data)
155
+
156
+
149
157
  class InvalidCardNumberError(CardError):
150
158
  """Invalid card number provided."""
151
159
  message = "Invalid card number."
@@ -254,6 +262,7 @@ errors_map = {
254
262
  -31301: SmsNotConnectedError,
255
263
  -31302: BalanceError,
256
264
  -31303: InsufficientFundsError,
265
+ -31630: InsufficientFundsErrorV2,
257
266
  -31300: InvalidCardNumberError,
258
267
  -31002: ProcessingServerError,
259
268
  -31110: OtpSendError,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: payme-pkg
3
- Version: 3.0.14b0
3
+ Version: 3.0.16
4
4
  Home-page: https://github.com/Muhammadali-Akbarov/payme-pkg
5
5
  Author: Muhammadali Akbarov
6
6
  Author-email: muhammadali17abc@gmail.com
@@ -147,3 +147,32 @@ print(pay_link)
147
147
  ```
148
148
  https://checkout.paycom.uz/bT15b3VyLXBheW1lLWlkO2FjLmlkPTEyMzQ1NjthPTUwMDAwMDtjPWh0dHBzOi8vZXhhbXBsZS5jb20=
149
149
  ```
150
+
151
+
152
+ ## Generate Fallback Link
153
+
154
+
155
+ Example to generate fallback link:
156
+
157
+ - Input
158
+
159
+ The ID in the fallback is different from the merchant ID. You can get the ID from the Payme team.
160
+ ```python
161
+ from payme import Payme
162
+
163
+ payme = Payme(payme_id="your-payme-id", fallback_id="your-fallback-id")
164
+
165
+ form_fields = {
166
+ "driver_id": 12345,
167
+ "amount": 1000
168
+ }
169
+
170
+ fallback_link = payme.initializer.generate_fallback_link(form_fields) # form field is optional
171
+ print(fallback_link)
172
+ ```
173
+
174
+ - Output
175
+
176
+ ```
177
+ https://payme.uz/fallback/merchant/?id=examplelinkgenerated&driver_id=12345&amount=1000
178
+ ```
@@ -7,7 +7,7 @@ long_description = (here / "README.md").read_text(encoding="utf-8")
7
7
 
8
8
  setup(
9
9
  name='payme-pkg',
10
- version='3.0.14b',
10
+ version='3.0.16',
11
11
  license='MIT',
12
12
  author="Muhammadali Akbarov",
13
13
  author_email='muhammadali17abc@gmail.com',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes