├── myweb ├── __init__.py ├── __pycache__ │ ├── urls.cpython-311.pyc │ ├── wsgi.cpython-311.pyc │ ├── models.cpython-311.pyc │ ├── views.cpython-311.pyc │ ├── __init__.cpython-311.pyc │ └── settings.cpython-311.pyc ├── asgi.py ├── wsgi.py ├── urls.py └── settings.py ├── easypay ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-311.pyc │ │ ├── 0001_initial.cpython-311.pyc │ │ └── 0002_alter_payments_ammount.cpython-311.pyc │ ├── 0002_alter_payments_ammount.py │ └── 0001_initial.py ├── tests.py ├── static │ └── easypay │ │ └── sucess.png ├── __pycache__ │ ├── admin.cpython-311.pyc │ ├── apps.cpython-311.pyc │ ├── urls.cpython-311.pyc │ ├── views.cpython-311.pyc │ ├── models.cpython-311.pyc │ └── __init__.cpython-311.pyc ├── admin.py ├── apps.py ├── models.py ├── urls.py └── views.py ├── requirements.txt ├── templates ├── data.html ├── pay_sucess.html ├── pin.html └── index.html ├── program.py ├── vercel.json ├── manage.py └── vercel.txt /myweb/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /easypay/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /easypay/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /easypay/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/requirements.txt -------------------------------------------------------------------------------- /easypay/static/easypay/sucess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/easypay/static/easypay/sucess.png -------------------------------------------------------------------------------- /myweb/__pycache__/urls.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/myweb/__pycache__/urls.cpython-311.pyc -------------------------------------------------------------------------------- /myweb/__pycache__/wsgi.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/myweb/__pycache__/wsgi.cpython-311.pyc -------------------------------------------------------------------------------- /easypay/__pycache__/admin.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/easypay/__pycache__/admin.cpython-311.pyc -------------------------------------------------------------------------------- /easypay/__pycache__/apps.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/easypay/__pycache__/apps.cpython-311.pyc -------------------------------------------------------------------------------- /easypay/__pycache__/urls.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/easypay/__pycache__/urls.cpython-311.pyc -------------------------------------------------------------------------------- /easypay/__pycache__/views.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/easypay/__pycache__/views.cpython-311.pyc -------------------------------------------------------------------------------- /myweb/__pycache__/models.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/myweb/__pycache__/models.cpython-311.pyc -------------------------------------------------------------------------------- /myweb/__pycache__/views.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/myweb/__pycache__/views.cpython-311.pyc -------------------------------------------------------------------------------- /easypay/__pycache__/models.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/easypay/__pycache__/models.cpython-311.pyc -------------------------------------------------------------------------------- /myweb/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/myweb/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /myweb/__pycache__/settings.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/myweb/__pycache__/settings.cpython-311.pyc -------------------------------------------------------------------------------- /easypay/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/easypay/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /easypay/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | from .models import payments 5 | admin.site.register(payments) -------------------------------------------------------------------------------- /easypay/migrations/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/easypay/migrations/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /easypay/migrations/__pycache__/0001_initial.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/easypay/migrations/__pycache__/0001_initial.cpython-311.pyc -------------------------------------------------------------------------------- /easypay/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class EasypayConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'easypay' 7 | -------------------------------------------------------------------------------- /easypay/migrations/__pycache__/0002_alter_payments_ammount.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deekshith-poojary/EasyPay/HEAD/easypay/migrations/__pycache__/0002_alter_payments_ammount.cpython-311.pyc -------------------------------------------------------------------------------- /easypay/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | class payments(models.Model): 5 | payment_id=models.AutoField(primary_key=True) 6 | username=models.CharField(max_length=20) 7 | ammount=models.IntegerField() 8 | -------------------------------------------------------------------------------- /templates/data.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | getdata 7 | 8 | 9 |
{{name}}
10 |
{{amount}}
11 | 12 | -------------------------------------------------------------------------------- /program.py: -------------------------------------------------------------------------------- 1 | def btd(n): 2 | if (n>1): 3 | btd(n//2) 4 | print(n%2) 5 | btd(8) 6 | 7 | def dtb(b): 8 | d=0 9 | i=0 10 | while(b!=0): 11 | dec=b%10 12 | d=d+dec*pow(2,i) 13 | b=b//10 14 | i+=1 15 | print(b,dec,d,i) 16 | #print(d) 17 | dtb(1000) 18 | b=1000 19 | b=b//10 20 | -------------------------------------------------------------------------------- /easypay/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.urls import path 3 | from . import views 4 | 5 | urlpatterns = [ 6 | path('', views.index, name='index'), 7 | path('details', views.details, name='details'), 8 | path('payment', views.payment, name='payment'), 9 | path('getdata', views.getdata, name='getdata'), 10 | ] -------------------------------------------------------------------------------- /myweb/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for myweb 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', 'myweb.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /myweb/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for myweb 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', 'myweb.settings') 15 | 16 | application = get_wsgi_application() 17 | app=application 18 | -------------------------------------------------------------------------------- /easypay/migrations/0002_alter_payments_ammount.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.1.7 on 2023-06-17 07:27 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('easypay', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='payments', 15 | name='ammount', 16 | field=models.IntegerField(), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /easypay/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.1.7 on 2023-06-17 07:26 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='payments', 16 | fields=[ 17 | ('payment_id', models.AutoField(primary_key=True, serialize=False)), 18 | ('username', models.CharField(max_length=20)), 19 | ('ammount', models.IntegerField(max_length=10)), 20 | ], 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "builds": [ 4 | { 5 | "src": "myweb/wsgi.py", 6 | "use": "@vercel/python", 7 | "config": { "maxLambdaSize": "15mb", "runtime": "python3.9" } 8 | }, 9 | { 10 | "src": "build_files.sh", 11 | "use": "@vercel/static-build", 12 | "config": { 13 | "distDir": "staticfiles_build" 14 | } 15 | } 16 | ], 17 | "routes": [ 18 | { 19 | "src": "/static/(.*)", 20 | "dest": "/static/$1" 21 | }, 22 | { 23 | "src": "/(.*)", 24 | "dest": "myweb/wsgi.py" 25 | } 26 | ] 27 | } 28 | 29 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myweb.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /myweb/urls.py: -------------------------------------------------------------------------------- 1 | """myweb 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,include 18 | from django.conf import settings 19 | from django.conf.urls.static import static 20 | 21 | urlpatterns = [ 22 | path('admin/', admin.site.urls), 23 | path('', include('easypay.urls')), 24 | ] 25 | urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT) 26 | urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) 27 | -------------------------------------------------------------------------------- /templates/pay_sucess.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Payment Successful 7 | 44 | 45 | 46 | {% load static %} 47 | Success Icon 48 |

Payment Successful

49 |

Thank you for your payment. Your transaction was successful.

50 | Back to Easypay 51 | 52 | 53 | -------------------------------------------------------------------------------- /vercel.txt: -------------------------------------------------------------------------------- 1 | vercel.json 2 | 3 | { 4 | "version": 2, 5 | "builds": [ 6 | { 7 | "src": "myweb/wsgi.py", 8 | "use": "@vercel/python", 9 | "config": { "maxLambdaSize": "15mb", "runtime": "python3.9" } 10 | }, 11 | { 12 | "src": "build_files.sh", 13 | "use": "@vercel/static-build", 14 | "config": { 15 | "distDir": "staticfiles_build" 16 | } 17 | } 18 | ], 19 | "routes": [ 20 | { 21 | "src": "/static/(.*)", 22 | "dest": "/static/$1" 23 | }, 24 | { 25 | "src": "/(.*)", 26 | "dest": "myweb/wsgi.py" 27 | } 28 | ] 29 | } 30 | 31 | build_files.sh 32 | 33 | pip install -r requirements.txt 34 | python3.9 manage.py collectstatic 35 | 36 | 37 | settings.py 38 | 39 | ALLOWED_HOSTS = ['.vercel.app','now.sh','127.0.0.1','localhost'] 40 | 41 | DATABASES = { 42 | 'default': { 43 | 'ENGINE': 'django.db.backends.postgresql', 44 | 'NAME': 'railway', 45 | 'USER': 'postgres', 46 | 'PASSWORD': '', 47 | 'HOST': '', 48 | 'PORT': '', 49 | } 50 | } 51 | 52 | STATICFILES_DIRS = os.path.join(BASE_DIR, 'static'), 53 | STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles_build', 'static') 54 | 55 | urls.py 56 | 57 | urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT) 58 | urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) 59 | -------------------------------------------------------------------------------- /easypay/views.py: -------------------------------------------------------------------------------- 1 | from django.http import HttpResponse 2 | from django.shortcuts import render 3 | from .models import payments 4 | import requests 5 | import time 6 | mc_url="https://api.thingspeak.com/update?api_key=8R3CO2HRXMICK3VK&field1=" 7 | name="" 8 | amount=0 9 | 10 | def index(request): 11 | return render(request,'index.html') 12 | 13 | def details(request): 14 | if request.method=='POST': 15 | name=request.POST.get('username') 16 | amount=request.POST.get('amount') 17 | insertdb=payments(username=name,ammount=amount) 18 | insertdb.save() 19 | params={'name':name , 'amount':amount} 20 | ''' 21 | for i in r_list: 22 | if name==i: 23 | return HttpResponse("SUCH WORDS ARE NOT ALLOWED ") 24 | ''' 25 | return render(request,'pin.html',params) 26 | 27 | def payment(request): 28 | if request.method=='POST': 29 | name=payments.objects.last().username 30 | amount=payments.objects.last().ammount 31 | requests.get(mc_url+name+"&field2="+str(amount)) 32 | time.sleep(3) 33 | return render(request,'pay_sucess.html') 34 | else: 35 | return HttpResponse("something went wrong ") 36 | 37 | 38 | def getdata(request): 39 | name=payments.objects.last().username 40 | amount=payments.objects.last().ammount 41 | param={"name":name , "amount":amount} 42 | return render(request,'data.html',param) 43 | -------------------------------------------------------------------------------- /templates/pin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | UPI PIN Entry 8 | 60 | 61 | 62 |
63 |
64 |

NOTE: This is a dummy website created by our team to demostrate the payment process for our project. You can enter any value in the given field.

65 |
66 |

Enter UPI PIN

67 |
68 | 69 | 70 | 71 | 72 |
73 |
74 | {% csrf_token %} 75 | 76 |
77 |
78 | 79 | 80 | -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | my payment 8 | 111 | 112 | 113 |
114 |
115 |

Easy Payment

116 |
117 | 118 | 123 | 124 |
125 |

Welcome to our website!

126 |
127 |

Payment

128 |
129 | {% csrf_token %} 130 | 131 | 132 | 133 |
134 |
135 |
136 |

NOTE: This is a dummy website created by our team to demostrate the payment process for our project

137 |
138 |
139 | 142 |
143 | 144 | 145 | -------------------------------------------------------------------------------- /myweb/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for myweb project. 3 | 4 | Generated by 'django-admin startproject' using Django 4.1.7. 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 | import os 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-t8srpt%nf74inop%soavkk3@0poy8_u=gs4!q%msa8$ns5lwqt' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = False 27 | 28 | ALLOWED_HOSTS = ['.vercel.app','now.sh','127.0.0.1','localhost'] 29 | 30 | # Application definition 31 | 32 | INSTALLED_APPS = [ 33 | 'easypay.apps.EasypayConfig', 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 | ] 41 | 42 | MIDDLEWARE = [ 43 | 'django.middleware.security.SecurityMiddleware', 44 | 'django.contrib.sessions.middleware.SessionMiddleware', 45 | 'django.middleware.common.CommonMiddleware', 46 | 'django.middleware.csrf.CsrfViewMiddleware', 47 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 48 | 'django.contrib.messages.middleware.MessageMiddleware', 49 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 50 | ] 51 | 52 | ROOT_URLCONF = 'myweb.urls' 53 | 54 | TEMPLATES = [ 55 | { 56 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 57 | 'DIRS': ['templates','static'], 58 | 'APP_DIRS': True, 59 | 'OPTIONS': { 60 | 'context_processors': [ 61 | 'django.template.context_processors.debug', 62 | 'django.template.context_processors.request', 63 | 'django.contrib.auth.context_processors.auth', 64 | 'django.contrib.messages.context_processors.messages', 65 | ], 66 | }, 67 | }, 68 | ] 69 | 70 | WSGI_APPLICATION = 'myweb.wsgi.application' 71 | 72 | 73 | # Database 74 | # https://docs.djangoproject.com/en/4.1/ref/settings/#databases 75 | 76 | DATABASES = { 77 | 'default': { 78 | 'ENGINE': 'django.db.backends.postgresql', 79 | 'NAME': 'railway', 80 | 'USER': 'postgres', 81 | 'PASSWORD': 'GzCkMixulXwWnIPYlkex', 82 | 'HOST': 'containers-us-west-92.railway.app', 83 | 'PORT': '5526', 84 | } 85 | } 86 | 87 | 88 | 89 | # Password validation 90 | # https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators 91 | 92 | AUTH_PASSWORD_VALIDATORS = [ 93 | { 94 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 95 | }, 96 | { 97 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 98 | }, 99 | { 100 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 101 | }, 102 | { 103 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 104 | }, 105 | ] 106 | 107 | 108 | # Internationalization 109 | # https://docs.djangoproject.com/en/4.1/topics/i18n/ 110 | 111 | LANGUAGE_CODE = 'en-us' 112 | 113 | TIME_ZONE = 'UTC' 114 | 115 | USE_I18N = True 116 | 117 | USE_TZ = True 118 | 119 | 120 | # Static files (CSS, JavaScript, Images) 121 | # https://docs.djangoproject.com/en/4.1/howto/static-files/ 122 | 123 | STATIC_URL = 'static/' 124 | 125 | # Default primary key field type 126 | # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field 127 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' 128 | STATICFILES_DIRS = os.path.join(BASE_DIR, 'static'), 129 | STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles_build', 'static') 130 | --------------------------------------------------------------------------------