You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason is the PAYME_ID and PAYME_KEY variables are both None. So Payme Subscribe API returned Access Denied error and the package had tried to raise the exception with payme.exceptions.general.AccessDeniedError class.
The error occurred in the payme.classes.http.HttpClient.handle_payme_error method. There the package tries to get the exception class by error code:
defhandle_payme_error(self, error: dict):
""" Handle Paycom-specific errors from the JSON-RPC error response. Parameters ---------- error : dict The error dictionary from Paycom's response, typically containing error details such as code, message, and data. Returns ------- None Raises an exception based on the error code received from Paycom's response. """error_code=error.get("code", "Unknown code")
error_message=error.get("message", "Unknown error")
error_data=error.get("data", "")
exception_class=exc.errors_map.get(error_code, exc.BaseError)
raiseexception_class(message=error_message, data=error_data)
The main problem is the handle_payme_error method tries to get exception class and pass message and data arguments. But there are no such arguments in the __init__ methods of some classes (AccessDeniedError, InvalidParamsError, CardNotFoundError, etc.).
The text was updated successfully, but these errors were encountered:
Here's my code snippet that gave me the error
The reason is the
PAYME_ID
andPAYME_KEY
variables are bothNone
. So Payme Subscribe API returned Access Denied error and the package had tried to raise the exception withpayme.exceptions.general.AccessDeniedError
class.The error occurred in the
payme.classes.http.HttpClient.handle_payme_error
method. There the package tries to get the exception class by error code:The main problem is the
handle_payme_error
method tries to get exception class and passmessage
anddata
arguments. But there are no such arguments in the__init__
methods of some classes (AccessDeniedError
,InvalidParamsError
,CardNotFoundError
, etc.).The text was updated successfully, but these errors were encountered: