paymentsgate 1.4.9__py3-none-any.whl → 1.5.1__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.
paymentsgate/enums.py CHANGED
@@ -1,14 +1,11 @@
1
- from enum import Enum
1
+ from enum import StrEnum
2
2
 
3
3
 
4
- class StrEnum(str, Enum):
5
- def __str__(self) -> str:
6
- return self.value
7
-
8
4
  class AuthenticationRealms(StrEnum):
9
5
  production = "production"
10
6
  sandbox = "sandbox"
11
7
 
8
+
12
9
  class ApiPaths(StrEnum):
13
10
  token_issue = "/auth/token"
14
11
  token_refresh = "/auth/token/refresh"
@@ -16,6 +13,7 @@ class ApiPaths(StrEnum):
16
13
  token_validate = "/auth/token/validate"
17
14
  invoices_payin = "/deals/payin"
18
15
  invoices_payout = "/deals/payout"
16
+ invoices_payout_tlv = "/deals/tlv"
19
17
  invoices_info = "/deals/:id"
20
18
  invoices_credentials = "/deals/:id/credentials"
21
19
  assets_list = "/wallet"
@@ -25,6 +23,8 @@ class ApiPaths(StrEnum):
25
23
  appel_list = "/support/list"
26
24
  appel_stat = "/support/statistic"
27
25
  fx_quote = "/fx/calculatenew"
26
+ fx_quote_tlv = "/fx/tlv"
27
+
28
28
 
29
29
  class Currencies(StrEnum):
30
30
  USDT = "USDT"
@@ -56,15 +56,18 @@ class Currencies(StrEnum):
56
56
  NGN = "NGN"
57
57
  AMD = "AMD"
58
58
 
59
+
59
60
  class Languages(StrEnum):
60
- EN = "EN"
61
- IN = "IN"
62
- AE = "AE"
63
- TR = "TR"
64
- GE = "GE"
65
- RU = "RU"
66
- UZ = "UZ"
67
- AZ = "AZ"
61
+ EN = ("EN",)
62
+ AZ = ("AZ",)
63
+ UZ = ("UZ",)
64
+ GE = ("GE",)
65
+ TR = ("TR",)
66
+ AE = ("AE",)
67
+ RU = ("RU",)
68
+ IN = ("IN",)
69
+ AR = ("AR",)
70
+ KG = "KG"
68
71
 
69
72
 
70
73
  class Statuses(StrEnum):
@@ -78,8 +81,8 @@ class Statuses(StrEnum):
78
81
 
79
82
 
80
83
  class CurrencyTypes(StrEnum):
81
- fiat = "fiat"
82
- crypto = "crypto"
84
+ fiat = "FIAT"
85
+ crypto = "CRYPTO"
83
86
 
84
87
 
85
88
  class InvoiceTypes(StrEnum):
@@ -118,31 +121,62 @@ class InvoiceTypes(StrEnum):
118
121
  vodafonecash = "vodafonecash"
119
122
  razn = "razn"
120
123
  rtjs = "rtjs"
124
+ sberpay = ("sberpay",)
125
+ tpay = ("tpay",)
126
+ opay = ("opay",)
127
+ moniepoint = ("moniepoint",)
128
+ palmpay = ("palmpay",)
129
+ wave = ("wave",)
130
+ orangemoney = ("orangemoney",)
131
+ moovmoney = ("moovmoney",)
132
+ rtjscard = ("rtjscard",)
133
+ ruzs = ("ruzs",)
134
+ amobile = ("amobile",)
135
+ payid = ("payid",)
136
+ baridi = ("baridi",)
137
+ multiwidget = ("multiwidget",)
138
+ attijari = ("attijari",)
139
+ cih = ("cih",)
140
+ cashplus = ("cashplus",)
141
+ elqr = ("elqr",)
142
+ odengi = "odengi"
143
+
144
+
145
+ class EELQRBankALias(StrEnum):
146
+ bakai = ("bakai",)
147
+ mbank = ("mbank",)
148
+ optima = ("optima",)
149
+ kicb = ("kicb",)
150
+ odengi = ("odengi",)
151
+ demir = ("demir",)
152
+ megapay = ("megapay",)
121
153
 
122
154
 
123
155
  class CredentialsTypes(StrEnum):
124
- iban = "iban"
125
- phone = "phone"
126
- card = "card"
127
- fps = "fps"
128
- account = "account"
156
+ iban = ("iban",)
157
+ phone = ("phone",)
158
+ card = ("card",)
159
+ fps = ("fps",)
160
+ qr = ("qr",)
161
+ account = ("account",)
129
162
  custom = "custom"
130
163
 
131
164
 
132
165
  class RiskScoreLevels(StrEnum):
133
166
  unclassified = "unclassified"
134
- hr = "hr" # highest risk
135
- ftd = "ftd" # high risk
136
- trusted = "trusted" # low risk
167
+ hr = "hr" # highest risk
168
+ ftd = "ftd" # high risk
169
+ trusted = "trusted" # low risk
137
170
 
138
171
 
139
172
  class CancellationReason(StrEnum):
140
- NO_MONEY = "NO_MONEY"
141
- CREDENTIALS_INVALID = "CREDENTIALS_INVALID"
142
- EXPIRED = "EXPIRED"
143
- PRECHARGE_GAP_UPPER_LIMIT = "PRECHARGE_GAP_UPPER_LIMIT"
144
- CROSS_BANK_TFF_LESS_THAN_3K = "CROSS_BANK_TFF_LESS_THAN_3K"
145
- CROSS_BANK_UNSUPPORTED = "CROSS_BANK_UNSUPPORTED"
173
+ NO_MONEY = ("NO_MONEY",)
174
+ CREDENTIALS_INVALID = ("CREDENTIALS_INVALID",)
175
+ EXPIRED = ("EXPIRED",)
176
+ PRECHARGE_GAP_UPPER_LIMIT = ("PRECHARGE_GAP_UPPER_LIMIT",)
177
+ CROSS_BANK_TFF_LESS_THAN_3K = ("CROSS_BANK_TFF_LESS_THAN_3K",)
178
+ CROSS_BANK_UNSUPPORTED = ("CROSS_BANK_UNSUPPORTED",)
179
+ ACCOUNT_NUMBER_BLACKLISTED = "ACCOUNT_NUMBER_BLACKLISTED"
146
180
 
147
181
 
148
182
  class FeesStrategy(StrEnum):
@@ -151,8 +185,10 @@ class FeesStrategy(StrEnum):
151
185
 
152
186
 
153
187
  class InvoiceDirection(StrEnum):
154
- F2C = "F2C"
155
- C2F = "C2F"
188
+ F2C = ("F2C",)
189
+ C2F = ("C2F",)
190
+ FIAT_IN = ("FIAT_IN",)
191
+ FIAT_OUT = "FIAT_OUT"
156
192
 
157
193
 
158
194
  class TTLUnits(StrEnum):
@@ -1,4 +1,3 @@
1
-
2
1
  from paymentsgate.transport import Response
3
2
 
4
3
 
@@ -12,27 +11,45 @@ class APIError(PaymentsgateError):
12
11
  code: int
13
12
  data: object | None
14
13
  details: object | None
15
-
16
- def __init__(self, error: str, message: str, data: object | None, details: object | None, status: int) -> None:
14
+
15
+ def __init__(
16
+ self,
17
+ error: str,
18
+ message: str,
19
+ data: object | None,
20
+ details: object | None,
21
+ status: int,
22
+ ) -> None:
17
23
  super().__init__(f"[{error}] {message} (status: {status})")
18
24
  self.error = error
19
25
  self.message = message
20
26
  self.data = data
21
- self.code = status;
22
- self.details = details;
23
-
24
- if (details is not None):
25
- print('Error details:', self.details)
26
- if (data is not None):
27
+ self.code = status
28
+ self.details = details
29
+ if details is not None:
30
+ print("Error details:", self.details)
31
+ if data is not None:
27
32
  print(self.data)
28
33
  # print(f"{self.error}: {self.message} code: {self.code} details: {self.details}")
29
-
30
34
 
31
35
 
32
36
  class APIResponseError(APIError):
33
37
  def __init__(self, response: Response) -> None:
34
- super().__init__(response.json.get('error'), response.json.get('message'), response.json.get('data'), response.json.get('details'), response.status_code)
38
+ super().__init__(
39
+ response.json_body.get("error"),
40
+ response.json_body.get("message"),
41
+ response.json_body.get("data"),
42
+ response.json_body.get("details"),
43
+ response.status_code,
44
+ )
45
+
35
46
 
36
47
  class APIAuthenticationError(APIError):
37
48
  def __init__(self, response: Response) -> None:
38
- super().__init__(response.json.get('error'), response.json.get('message'), response.json.get('data'), response.json.get('details'), response.status_code)
49
+ super().__init__(
50
+ response.json_body.get("error"),
51
+ response.json_body.get("message"),
52
+ response.json_body.get("data"),
53
+ response.json_body.get("details"),
54
+ response.status_code,
55
+ )
paymentsgate/logger.py CHANGED
@@ -5,4 +5,3 @@ from paymentsgate.transport import Request, Response
5
5
  def Logger(self, request: Request, response: Response):
6
6
  logging.debug(f"HTTP Request: {request}")
7
7
  logging.debug(f"HTTP Response: {response}")
8
-
@@ -0,0 +1,3 @@
1
+ # def QuoteResponseMapper(self, request: , response: Response):
2
+ # logging.debug(f"HTTP Request: {request}")
3
+ # logging.debug(f"HTTP Response: {response}")