Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Blocking non ajax requests to API. Django. DRF
I have a decorator which allows only ajax requests to endpoints. AJAX_ONLY = os.getenv('AJAX_ONLY', 'False') == 'True' def only_ajax(): def wrapper(func): def decorator(request, *args, **kwargs): if not request.is_ajax() and AJAX_ONLY: return HttpResponseForbidden() return func(request, *args, **kwargs) return decorator return wrapper Then I use it as a method_decorator in controllers: @method_decorator(only_ajax(), name='dispatch') class SomeEndpoint(APIView): ... And it works perfectly good on localhost returning 403. But on the live servers it simply suggests user to log in displaying default DRF browsable api page afterwards. What am I missing? Thanks. -
'MovieViewSet' should either include a `serializer_class` attribute, or override the `get_serializer_class()` method
I am trying to build a project from a Youtube tutorial but I keep getting this error: AssertionError: 'MovieViewSet' should either include a `serializer_class` attribute, or override the `get_serializer_class()` method. Here is the views.py file class MovieViewSet(viewsets.ModelViewSet): queryset = Movie.objects.all() serializer_class = MovieSerializer def list(self, request, *args, **kwargs): movies = Movie.objects.all() serializer = MovieSerializer(movies, many=True) return Response(serializer.data) Also this is the serializer.py file: class MovieSerializer(serializers.ModelSerializer): class Meta: model = Movie fields = ('id', 'title', 'desc', 'year') What am I doing wrong? Because to me it looks like I am using serializers_class ... Thank you in advance! -
Query database in django based on specific foreignKey
please I'm having issue query database to get all the registered students under specific teacher Model.py class UserProfileInfo(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) bio = models.CharField(max_length=500, blank= True) teacher = 'teacher' admin = 'admin' user_types = [ (teacher, 'teacher'), (admin, 'admin'), ] user_type = models.CharField(max_length=10, choices=user_types, default=admin) def __str__(self): return self.user.username Student model.py class Student(models.Model): userprofile = models.ForeignKey(UserProfileInfo, on_delete=models.CASCADE, related_name='myuser') first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) profile_pic = models.ImageField(upload_to=student_image, verbose_name="ProfilePicture", blank=True) guardian_email = models.EmailField() guardian_phone = models.IntegerField() def __str__(self): return self.first_name I have registered some students on each teacher in the database. But whenever I queried the database to list all the students under specific a teacher, I got the list of the students in the database instead Here the views.py class StudentListView(ListView): template_name = 'data/student_lis.html' queryset = Student.objects.all().order_by("first_name") model= Student Student_list .html {% for instance in object_list %} <li><a href="{{ instance.get_absolute_url }} ">{{ forloop.counter }} - {{ instance.first_name }} {{ instance.last_name }}</a></li> {% endfor %} Thanks you all -
How to add a default filter inside Django FilterSet?
The Problem: I am trying to add an initial filter that gives a base queryset for other filters to further filter on. Things I've Tried: I tried overriding the qs property method, but overriding the qs made other filters unfunctional. I also tried to override the __init__ method but it was not called in my custom filter class. -
Realtime updates from Realtime Firebase database of HTML page with Ajax
I need to get live updates(lat and lng of the point) from Firebase realtime database for my django web project. I found this question on stackoverflow here: Realtime Update between Firebase and HTML Table. So I did the same in my code with replacing config of my firebase. But it did not work, cause I get such error: [Error][1] What can be the problem? [1]: https://i.stack.imgur.com/EtE3y.png HTML code: <html> <head> </head> <body > <table style="width:100%;width:100%;" id="ex-table"> <tr id="tr"> <th>Latitude/th> <th>Longitude</th> </table> <script src="https://www.gstatic.com/firebasejs/4.1.3/firebase.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> // Initialize Firebase var config = { apiKey: "AIzaSyCEXETuWBXNzA0dTd0uSMOWmJjYORARn5Q", authDomain: "tracker-14.firebaseapp.com", databaseURL: "https://tracker-14-default-rtdb.europe-west1.firebaseio.com", projectId: "tracker-14", storageBucket: "tracker-14.appspot.com", messagingSenderId: "374752080087" }; firebase.initializeApp(config); var database = firebase.database(); database.ref().once('value', function(snapshot){ if(snapshot.exists()){ var content = ''; snapshot.forEach(function(data){ var val = data.val(); content +='<tr>'; content += '<td>' + val.lat + '</td>'; content += '<td>' + val.lng + '</td>'; content += '</tr>'; }); $('#ex-table').append(content); } }); </script> </body> </html> -
python django migrate エラー [closed]
django を始めたばかりでつまずいてしまいました。 ModuleNotFoundError: No module named 'widget_tewaks'と エラーが出ていたので pip3 install django-widgets-improved を実行 sttingsの確認(widget_tewaksを入れ忘れていないか)を行ったが記述されていた。 対処法がわかる方はアドバイスをお願いいたします。 (myvenv) (base) inoMacBook-Air:django irikunin$ python3 manage.py makemigrations Traceback (most recent call last): File "manage.py", line 21, in <module> main() File "manage.py", line 17, in main execute_from_command_line(sys.argv) File "/Users/irikunin/Desktop/django/myvenv/lib/python3.8/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line utility.execute() File "/Users/irikunin/Desktop/django/myvenv/lib/python3.8/site-packages/django/core/management/__init__.py", line 357, in execute django.setup() File "/Users/irikunin/Desktop/django/myvenv/lib/python3.8/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/Users/irikunin/Desktop/django/myvenv/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate app_config = AppConfig.create(entry) File "/Users/irikunin/Desktop/django/myvenv/lib/python3.8/site-packages/django/apps/config.py", line 90, in create module = import_module(entry) File "/opt/anaconda3/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked ModuleNotFoundError: No module named 'widget_tewaks' -
How to set read_only dynamically in django rest framework?
I am trying to check if the user id not equal to 1 then he should not be able to update few fields. I tried something similar to the following code but it did not work because of the following issues self.user.id don't actually return the user I need to get the authenticated user in different why? the def function maybe should have a different name like update? also the general way maybe wrong? class ForAdmins(serializers.ModelSerializer)): class Meta: model = User fields = '__all__' class ForUsers(serializers.ModelSerializer)): class Meta: read_only_fields = ['email','is_role_veryfied','is_email_veryfied'] model = User fields = '__all__' class UsersSerializer(QueryFieldsMixin, serializers.ModelSerializer): def customize_read_only(self, instance, validated_data): if (self.user.id==1): return ForAdmins else: return ForUsers class Meta: # read_only_fields = ['username'] model = User fields = '__all__' -
How to add poll code to the django-cms url.py file?
I am new to Django-cms but I couldn't add the poll url code to the url.py file. I follow every step in the Django-cms documentation but I still couldn't succeed can anyone help me with it. This the documentation of the Django-cms: integrating_applications Install the application from its GitHub repository using pip: pip install git+http://git@github.com/divio/django-polls.git#egg=polls Let’s add this application to our project. Add 'polls' to the end of INSTALLED_APPS in your project’s settings.py (see the note on The INSTALLED_APPS setting about ordering ). Add the poll URL configuration to urlpatterns in the project’s urls.py: urlpatterns += i18n_patterns( re_path(r'^admin/', include(admin.site.urls)), re_path(r'^polls/', include('polls.urls')), re_path(r'^', include('cms.urls')), ) Note that it must be included before the line for the django CMS URLs. django CMS’s URL pattern needs to be last, because it “swallows up” anything that hasn’t already been matched by a previous pattern. I had added the "polls" in the setting into the installation app code. But--- My question is where or how will put this code to the urls.py file. -- my urls.py file looks like this: from cms.sitemaps import CMSSitemap from django.conf import settings from django.conf.urls.i18n import i18n_patterns from django.conf.urls.static import static from django.contrib import admin from django.contrib.sitemaps.views import sitemap from … -
Error "Reverse for 'login' not found" when creating url path in Django
I'm new to Django, and today when I tried to publish my Django application to Heroku, I always encountered an error Reverse for 'login' not found. 'login' is not a valid view function or pattern name. I know where I'm wrong. The problem came in urls.py, so here is my code: urlpatterns = [ path('', include('users.urls', 'login')), path('admin/', admin.site.urls), path('jet/', include('jet.urls', 'jet')), path('citizens/', include('citizens.urls', namespace='citizens')), path('users/', include('users.urls', namespace='users')), #path('accounts/', include('django.contrib.auth.urls')), ] Here is my urls.py inside users: from django.urls import path from . import views app_name = 'users' urlpatterns = [ path("", views.index, name="index"), path("login", views.login_view, name="login"), path("logout", views.logout_view, name="logout"), ] In my project, the login page stay at URL "127.0.0.1:8000/users/login". It means when you typed only "127.0.0.1:8000/users", the page will notice an error: Reverse for 'login' not found. 'login' is not a valid view function or pattern name. I want my path will directly go to users/login, but I don't know how to do it. I have tried path('', include('users.urls', 'login')), or path('', include('users.urls/login', namespace='user')), or path('', include('users.urls.login', namespace='user')), but nothing works. Thank you. -
Function calls in Django model class using data from other model class
I have two model classes and I need to write some logic that uses both. Not sure where I should be adding this logic, and how to implement. This is a highly simplified version; class Yacth(models.Model): name = models.CharField(max_length=50) adjuster = models.IntegerField(default=1) class Result(models.Model): yacht = models.ForeignKey(Yacht, on_delete=models.CASCADE) result = models.DecimalField(null=TRUE) adjusted_result = # I want to populate this field with adjusted result def result_adjusted(self): a = self.result b= self.yacht.adjuster # can I call values from another class like this? adjusted_result = (a * b) return adjusted_result I need the result to be multiplied by the adjuster as shown in the simple draft method (result_adjusted) above. How can I implement this so that the adjusted result in the model class is populated with the method return? Thank you -
Custom Form ValidationErrors render differently than those rendered by Django
Referring to the image below, I have a hard time figuring out from resources and Django's source code on why the ValidationError we raise our own (from our own cleaning/validation) are rendered differently from ValidationErrors rendered by the form (Django) itself. Field ValidationErrors raised by Django are rendered in a 'floating bubble' while ValidationErrors I raised are rendered as red text. The method I used to raise ValidationErrors are as per Django's documentation here, while how I render the form in the template is simply by calling {{form}} as provided by Django's Template engine - albeit by also using crispy but I've verified that it has no effect here other than styling the error message to be red in colour instead of a plain, bold black text under the field. Ideally, I would like to know how or what I should do in order to make all ValidationError (Django's default and my own) display uniformly to prevent inconsistent design across fields in a form. Preferably, as red text. Any help I can get are much appreciated! Image of the errors in the form ValidationError Forms class AbstractUserForm(forms.ModelForm): mail = forms.EmailField() mobile = forms.CharField( widget=forms.NumberInput, required=True ) class Meta: model = … -
Stripe Payouts Django
I have already implemented payouts in my django project using PayPal but now I want to switch to stripe Payouts. Stripe documentation is now helping me in programmatical terms. -
Editing data via post request in join table model in Django
I have created model with many to many relationship and I have join table when I keep additional variable for it: class BorderStatus(models.Model): STATUS_CHOICES = [("OP", "OPEN"), ("SEMI", "CAUTION"), ("CLOSED", "CLOSED")] origin_country = models.ForeignKey(OriginCountry, on_delete=models.CASCADE, default="0") destination = models.ForeignKey(Country, on_delete=models.CASCADE, default="0") status = models.CharField(max_length=6, choices=STATUS_CHOICES, default="CLOSED") extra = 1 class Meta: unique_together = [("destination", "origin_country")] verbose_name_plural = "Border Statuses" def __str__(self): return ( f"{self.origin_country.origin_country.name} -> {self.destination.name}" f" ({self.status})" ) Other models: # Create your models here. class Country(models.Model): name = models.CharField(max_length=100, unique=True, verbose_name='Country') class Meta: verbose_name_plural = "Countries" def __str__(self): return self.name class OriginCountry(models.Model): origin_country = models.ForeignKey( Country, related_name="origins", on_delete=models.CASCADE ) destinations = models.ManyToManyField( Country, related_name="destinations", through="BorderStatus" ) class Meta: verbose_name_plural = "Origin Countries" def __str__(self): return self.origin_country.name Im trying to send post request based on the origin_country and destination so that I can change status of the given combination: Here is my serializer for the endpoint: class BorderStatusEditorSerializer(serializers.ModelSerializer): """Create serializer for editing single connection based on origin and destination name- to change status""" origin_country = serializers.StringRelatedField(read_only=True) destination = serializers.StringRelatedField(read_only=True) class Meta: model = BorderStatus fields = ('origin_country', 'destination', 'status') And my endpoint: class BorderStatusViewSet(viewsets.ModelViewSet): queryset = BorderStatus.objects.all() serializer_class = BorderStatusEditorSerializer filter_backends = (DjangoFilterBackend,) filter_fields=('origin_country','destination') so when I send request … -
field Error message showing different from intended
Hello im trying to make my form show validation errors but its keeps showing 'this field is required' instead of 'this email has already been registered' etc. any suggestions will help thanks. my form: class NewCustomer(UserCreationForm): class Meta: model = Customer fields = ('Email_Address','Phone_number','first_name','last_name') #tried the cleaned data option below but it didnt work def clean(self): cleaned_data = super().clean() Email_Address = cleaned_data.get("Email_Address") Phone_number = cleaned_data.get("Phone_number") first_name = cleaned_data.get("first_name") last_name = cleaned_data.get("last_name") My views: class SignUpView(CreateView): form_class = NewCustomer success_url = reverse_lazy('store:user_login') template_name = 'store/signup.html' -
I resized the field, but now instead of tag names I see a list with dictionaries
I resized the field, but now instead of tag names I see a list with dictionaries. How i can fix it? formfield_overrides = { TaggableManager: {'widget': AdminTextareaWidget(attrs={'rows': 4, 'cols': 40})}, } -
Making a search field without using a Django model
I want to search by id in the search field in the django project I created using mongodb. But I want to do this without using a model. I want it to search from mongo. can you help me. Here my code views.py search_query=request.GET.get(’search’ ‘ ’) if search_query: app=app.objects.filter(owner_id__icontains=search_query) else: app=app.objects.all() base.html <form type="get" action="." style="margin: 0"> <input id="search_box" type="text" name="q" placeholder="Search..." > <button id="search_submit" type="submit" >Submit</button> </form> -
How to controll versioning in Django Rest Framework (DRF)
I want to know what is the best practices for controlling the Version for Mobile App APIs. Requirement If I change something in my database previous version of the app should not be affected. Currently I'm doing like... path('v1/auth/', include('authentication.urls')), path('v2/auth/', include('authentication.urls2')), # Example path('v1/api/', include('contentstudio.urls')), -
Accessing fields in a sqlalchemy query by field name
I have a script that is suddenly not working anymore. I upgraded sqlalchemy and pg8000 with just minor upgrades at the same time so I'm not entirely sure which one is the culprit exactly. I have a query to an external Postgres database and upserting the result set back into a Heroku database which is also Postgres. I can connect to the external database and query it, but Python is returning an error when it tries to access a specific field by field name. However, I can access the fields by location: for row in db.query(DATABASE_QUERY): print(type(row)) # <class 'records.Record'> print(row) # <Record {"item_id": 12345, "item_name": "7.Subject.Class", "active": true, "is_deleted": false} print(row[0]) # 12345 print(row.item_name) # print(row['item_name']) # Error thrown Error is thrown on the last line, using either syntax. The full stack trace is: Traceback (most recent call last): File "app_dir/manage.py", line 14, in <module> execute_from_command_line(sys.argv) File "C:\Users\user\Documents\Github\django-app\venv-dev\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line utility.execute() File "C:\Users\user\Documents\Github\django-app\venv-dev\lib\site-packages\django\core\management\__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Users\user\Documents\Github\django-app\venv-dev\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv self.execute(*args, **cmd_options) File "C:\Users\user\Documents\Github\django-app\venv-dev\lib\site-packages\django\core\management\base.py", line 364, in execute output = self.handle(*args, **options) File "C:\Users\user\Documents\Github\django-app\app_dir\apps\etl\management\commands\load.py", line 118, in handle step.load(period=period) File "C:\Users\user\Documents\Github\django-app\app_dir\apps\etl\models\job.py", line 89, in load match_status = self.domain_source.load(*args, **kwargs) File "C:\Users\user\Documents\Github\django-app\app_dir\apps\etl\models\domain.py", line 90, … -
Django project docker after unexpected shutdown: Is the server running on host "db" (172.19.0.3) and accepting TCP/IP connections on port 5432?
I am using popOs20 Battery was running low and unexpected shutdown occurred. The same project with docker successfully gets built on other device. I have tried: docker system prune docker volume prune killing all processes of swap and ram and then restarting changing docker network and some other things I do not even remember anymore. Any ideas what can I do ? Project is using postgresql13 full error: Exception in thread django-main-thread: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 220, in ensure_connection self.connect() File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 197, in connect self.connection = self.get_new_connection(conn_params) File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 185, in get_new_connection connection = Database.connect(**conn_params) File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 127, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) psycopg2.OperationalError: could not connect to server: Connection timed out Is the server running on host "db" (172.19.0.3) and accepting TCP/IP connections on port 5432? The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/local/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.9/site-packages/django/utils/autoreload.py", line 53, in wrapper fn(*args, **kwargs) File "/usr/local/lib/python3.9/site-packages/django/core/management/commands/runserver.py", line 120, in inner_run … -
How to use UserCreationForm in Django?
I have followed this tutorial to test out the User authentication and Signals in Django. I don't know what I should do with this part (found from the first post of this tutorial): from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User class RegisterForm(UserCreationForm): birthdate = forms.DateField() discord_id = forms.CharField(max_length=100, help_text='Discord ID') zoom_id = forms.CharField(max_length=100, help_text='Zoom ID') text = forms.TextField(null=True, blank=True) class Meta: model = User fields = ["username", "password1", "password2", "birthdate", "email", "discord_id", "zoom_id"] With those imports I get an error NameError: name 'forms' is not defined and if I add an import from django import forms I get errors like AttributeError: module 'django.forms' has no attribute 'TextField'. Sohuld I add all the fields from my Model into this RegisterForm -class I want to include to the registration process? What do I do to the fields that are textFields in my Model? -
How can I create a Saleor plugin that is a Django app?
I'm trying to add a Saleor plugin that is also a Django app. The reason is that I want to be able to use Django migrations for it. I've created regular Saleor plugins before, which work fine. I'm not very familiar with Django apps yet, but the documentation makes sense to me. What I'm utterly confused about is the combination of the two concepts. Which directory does it go into? Does it go into the saleor/plugins directory like all other regular Saleor plugins? Or directly into the saleor directory, like all other Django apps? The only somewhat related answer I could find suggests using manage.py startapp, which creates the plugin in the root directory, next to the saleor directory, adding to my confusion. How to install the Django app as a Saleor plugin? The official documentation instructs to use a setup.py and suggests that: If your plugin is a Django app, the package name (the part before the equal sign) will be added to Django's INSTALLED_APPS so you can take advantage of Django's features such as ORM integration and database migrations. However, none of the built-in Saleor plugins or Django apps are using this setup.py mechanism, and I cannot find … -
ModuleNotFoundError: No module named 'ffi'
After building success heroku git push heroku main.when I executed that gunicorn --bind 0.0.0.0:8000 app:app i get this error.I searched in google but didnot found answer.With procfile data as web: gunicorn tictactoe.wsgi .tictactoe my project name. Traceback (most recent call last): File "c:\users\anves\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\anves\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\anves\AppData\Local\Programs\Python\Python39\Scripts\gunicorn.exe\__main__.py", line 4, in <module> File "c:\users\anves\appdata\local\programs\python\python39\lib\site-packages\gunicorn\app\wsgiapp.py", line 9, in <module> from gunicorn.app.base import Application File "c:\users\anves\appdata\local\programs\python\python39\lib\site-packages\gunicorn\app\base.py", line 11, in <module> from gunicorn import util File "c:\users\anves\appdata\local\programs\python\python39\lib\site-packages\gunicorn\util.py", line 8, in <module> import fcntl File "c:\users\anves\appdata\local\programs\python\python39\lib\site-packages\fcntl.py", line 1, in <module> import ffi ModuleNotFoundError: No module named 'ffi' -
TypeError: get_object() takes 1 positional argument but 2 were given [18/May/2021 18:27:12] "GET /api/Oxyegn/ HTTP/1.1" 500 94676
What i am trying to do is i am giving Choice Field and i am trying to get all post when i pass that choice field to url as parameter for eg: Oxygen, Plasma etc They are in my choice field which user has to choose during posting post. I want to get json format which we get whenever we do request to api and i want that information based to choice filed i have given but getting error. Rest Api View class PostRestApi(APIView): def get_object(self, **kwargs): try: return Post.objects.get(help_type=kwargs.get('help_type')) except Post.DoesNotExist: raise Http404 def get(self, request, **kwargs): posts = self.get_object(kwargs.get('help_type')) serializer = PostSerializer(posts) return Response(serializer.data) > SERIALIZERS CLASS class PostSerializer(serializers.Serializer): title = serializers.CharField(max_length = 100) content = serializers.CharField() date = serializers.DateTimeField(default=timezone.now) help_type = serializers.CharField() My Post Model CHOICES = ( ("1", "Plasma"), ("2", "Oxygen"), ("3", "Bed"), ("4", "Emergency") ) class Post(models.Model): title = models.CharField(max_length = 100) content = models.TextField() date = models.DateTimeField(default=timezone.now) author = models.ForeignKey(User, on_delete=models.CASCADE) help_type = models.CharField(max_length=300, choices = CHOICES, null=True) url path('api/<str:help_type>/', PostRestApi.as_view(), name='post-api') -
DRF Viewset test method
I have added a method to my viewset as follows: class CustomImageViewSet(viewsets.ModelViewSet): queryset = CustomImage.objects.all() serializer_class = CustomImageSerializer lookup_field = 'id' @action(detail=True, methods=['get'], url_path='sepia/') def sepia(self, request, id): # do something data = image_to_string(image) return HttpResponse(data, content_type="image/png", status=status.HTTP_200_OK) Since it is not a default or overridden request method, I am not sure how can I proceed writing a test for it. Any suggestions? -
JSONField Django
how can i store a dictionary in JSONField of django model ? class order(models.Model): payment_collection_webhook_request_parameters = models.JSONField() dictionary to be stored in payment_collection_webhook_request_parameters is: postData = { "orderId" : payment_gateway_order_identifier, "orderAmount" : amount, "referenceId" : reference_identifier, "txStatus" : settlement_status, "paymentMode" : payment_mode_code, "txMsg" : transaction_message, "signature" : signature, "txTime" : datetime }