· 5 years ago · Dec 31, 2019, 06:02 AM
1import os
2
3# from django.conf.global_settings import MEDIA_ROOT
4from django.urls import reverse_lazy
5import environ
6
7# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
8BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
9
10# env = environ.Env(
11#     DEBUG=(bool, False),
12#     EMAIL_USE_TLS=(bool, True),
13#     NOCAPTCHA=(bool, True),
14#     FORGET_PASSWORD_RECIPIENTS_EMAIL_LIST=(list),
15#     ALLOWED_HOSTS=(list),
16# )
17
18envfile_path = os.path.join(BASE_DIR, '.env')
19environ.Env.read_env(envfile_path)
20
21# CORS CONFIG #
22CORS_ORIGIN_ALLOW_ALL = True
23CORS_ALLOW_METHODS = (
24    'POST'
25)
26
27SECRET_KEY = '&yukxygfht@gz2^o$pc*9-u=(l0-m80%3+&=j3e81@y$e8jsxi'
28DEBUG = True
29ALLOWED_HOSTS = ['192.168.1.188', '127.0.0.1', 'localhost', '13.229.84.216', '*']
30
31DJANGO_APPS = [
32    'django_db_prefix',
33    'django.contrib.admin',
34    'django.contrib.auth',
35    'django.contrib.sites',
36    'django.contrib.contenttypes',
37    'django.contrib.sessions',
38    'django.contrib.messages',
39    'django.contrib.staticfiles',
40
41]
42THIRD_PARTY_APPS = [
43    'allauth',
44    'allauth.account',
45    'django_user_agents',
46    'captcha',
47    'django_extensions',
48    'rest_framework',
49    'corsheaders'
50]
51LOCAL_APPS = [
52    'support_reports',
53    'ticket_supports'
54]
55
56INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
57
58MIDDLEWARE = [
59    'django.middleware.security.SecurityMiddleware',
60    'django.contrib.sessions.middleware.SessionMiddleware',
61    'django.middleware.common.CommonMiddleware',
62    'django.middleware.csrf.CsrfViewMiddleware',
63    'django.contrib.auth.middleware.AuthenticationMiddleware',
64    'django.contrib.messages.middleware.MessageMiddleware',
65    'django.middleware.clickjacking.XFrameOptionsMiddleware',
66    'django_user_agents.middleware.UserAgentMiddleware',
67    'corsheaders.middleware.CorsMiddleware'
68]
69
70ROOT_URLCONF = 'jbl_customer_support.urls'
71
72TEMPLATES = [
73    {
74        'BACKEND': 'django.template.backends.django.DjangoTemplates',
75        'DIRS': ['templates'],
76        'APP_DIRS': True,
77        'OPTIONS': {
78            'context_processors': [
79                'django.template.context_processors.debug',
80                'django.template.context_processors.request',
81                'django.contrib.auth.context_processors.auth',
82                'django.contrib.messages.context_processors.messages',
83                'jbl_customer_support.context_processors.get_user_data',
84            ],
85        },
86    },
87]
88
89SITE_ID = 1
90ACCOUNT_LOGOUT_ON_GET = True
91
92# TODO: Get provider name, username, password and base api from staging server
93
94PROVIDER_NAME = 'Jamuna Bank'
95
96# USERNAME_PASSWORD = {"username": 'jbl_support', "password": 'KNyigwigulcaho2'}  # Production
97USERNAME_PASSWORD = {"username": 'jbl_support', "password": 'jbl%%$$##&&@@123??'} # Staging
98# USERNAME_PASSWORD = {"username": 'jbl_support', "password": 'jbl_support1234'} # Dev
99
100# BASE_API_URL='https://backend.paywithconnect.com'  # Production
101BASE_API_URL = 'https://staging-backend.paywithconnect.com'  # Staging
102# BASE_API_URL = 'http://192.144.80.181'
103# V1 APIS
104USER_TOKEN_URL_V1 = BASE_API_URL + '/api-service-auth/'
105CIRCUIT_USER_DATA_URL_V1 = BASE_API_URL + '/api/v1/users/circuit-user/'
106CIRCUIT_USER_MEMBER_LIST_V1 = BASE_API_URL + '/api/v1/family_wallet/member-list/'
107CIRCUIT_USER_ACCOUNT_LIST_V1 = BASE_API_URL + '/api/v1/account/account-list/'
108CIRCUIT_USER_INSTRUCTIONS_LIST_V1 = BASE_API_URL + '/api/v1/family/instruction-list-by-connect-id/'
109CIRCUIT_USER_DEVICE_LIST_V1 = BASE_API_URL + '/api/v1/devices/device-list-by-connect-id/'
110CIRCUIT_USER_LOCKED_UNLOCKED_V1 = BASE_API_URL + '/api/v1/users/circuit-user-locked-unlocked/'
111CIRCUIT_USER_BANK_ACCOUNT_TRANSFER_V1 = BASE_API_URL + '/api/v1/family/transfer-history-identifier/'
112CIRCUIT_USER_TOP_UP_TRANSFER_V1 = BASE_API_URL + '/api/v1/top_up/requests/top-up-history-account/'
113CIRCUIT_USER_DAILY_TOP_UP_TRANSFER_V1 = BASE_API_URL + '/api/v1/top_up/requests/top-up-history-daily/'
114CIRCUIT_USER_MONEY_TRANSFER_CONNECT_ID_V1 = BASE_API_URL + '/api/v1/family/transfer-history-connect-id/'
115CIRCUIT_USER_INSTRUCTIONS_ACTIVATED_DEACTIVATED_V1 = BASE_API_URL + '/api/v1/family/instruction-active-deactivate/'
116CIRCUIT_USER_DEVICE_STATUS_CHANGE_V1 = BASE_API_URL + '/api/v1/devices/device-status-change/'
117
118PENDING_USER_LIST_V1 = BASE_API_URL + '/api/v1/users/pending-user-list/'
119
120CIRCUIT_USERS_TRANSFER_DATA_V1 = BASE_API_URL + '/api/v1/family/transactions-reports/'
121CIRCUIT_USERS_PASSWORD_RESET_V1 = BASE_API_URL + '/api/v1/users/password-reset-circuit-user/'
122
123# V2 APIs
124# For DPDC
125# Staging
126# DPDC_BASE_API_URL = 'https://staging-dpdc-titas.paywithconnect.com/dpdc'
127# DPDC_KEY_NAME = 'dpdc-key'
128# DPDC_SECRET_KEY_NAME = 'dpdc-secret'
129# DPDC_KEY = 'dpdc_payment_history_staging'
130# DPDC_SECRET = 'fb616ced-921e-400d-bd78-58244e7db4b5.dpdc_payment_history_staging.eafb2910-8561-4746-8c50-fab5d6df5133'
131# Production
132DPDC_BASE_API_URL="https://dpdc.paywithconnect.com"
133DPDC_KEY_NAME="dpdc-support-key"
134DPDC_SECRET_KEY_NAME="dpdc-support-secret"
135DPDC_KEY="dpdc_support_production"
136DPDC_SECRET="b235e9f2-403b-493d-91d5-ef85381d70e2.dpdc_support_production.2f1e765b-cc74-4117-8f25-ad6a889916a2"
137CIRCUIT_USER_DPDC_ACCOUNT_LIST = DPDC_BASE_API_URL + '/api/v2/dpdc/account/list/'
138CIRCUIT_USER_DPDC_BILL_PAYMENT_AGAINST_BANK_ACCOUNT = DPDC_BASE_API_URL + '/api/v2/dpdc/payment/history/bank/'
139CIRCUIT_USER_DPDC_BILL_PAYMENT_AGAINST_DPDC_ACCOUNT = DPDC_BASE_API_URL + '/api/v2/dpdc/payment/history/account/'
140DPDC_PAYMENTS_OF_A_DAY = DPDC_BASE_API_URL + '/api/v2/dpdc/daily/report/'
141
142# For Titas
143# TITAS_BASE_API_URL = env('TITAS_BASE_URL')
144# TITAS_USERNAME_PASSWORD = (env('TITAS_USERNAME'), env('TITAS_PASSWORD'))
145# CIRCUIT_USER_TITAS_BILL_PAYMENT_AGAINST_BANK_ACCOUNT = TITAS_BASE_API_URL + "/v2/bill-pay-history-by-bank-account/"
146# CIRCUIT_USER_TITAS_BILL_PAYMENT_AGAINST_TITAS_ACCOUNT = TITAS_BASE_API_URL + '/v2/bill-pay-history-by-titas-account/'
147# CIRCUIT_USER_TITAS_ACCOUNT_LIST = TITAS_BASE_API_URL + '/v2/account-list/'
148# Others
149REJECTING_PENDING_USER_V2 = BASE_API_URL + '/api/v2/home/nid-verification/'
150NON_VERIFIED_USER_LIST_V2 = BASE_API_URL + '/api/v2/users/nid-unverified/active/users/'
151PENDING_USER_IMAGE_V2 = BASE_API_URL + '/api/v2/uploaded_images/list/'
152PENDING_USER_BANK_STATEMENT_V2 = BASE_API_URL + '/api/v2/account/statement/'
153SYNC_KYC_DATA_V2 = BASE_API_URL + '/api/v2/users/detail-fetch/'
154CIRCUIT_USER_DATA_URL_V2 = BASE_API_URL + '/api/v2/users/circuit-user/'
155CIRCUIT_USERS_PASSWORD_RESET_V2 = BASE_API_URL + '/api/v2/users/password-reset-circuit-user/'
156CIRCUIT_USER_UNBLOCK_V2 = BASE_API_URL + '/api/v2/users/unblocked/'
157CIRCUIT_USER_UNBLOCK_CREDIT_CARD_BILL_PAYMENT_FEATURE_V2 = BASE_API_URL + '/api/v2/jbl/credit-card/stl/account/unblock/'
158CIRCUIT_USER_REMOVE_A_CREDIT_CARD_V2 = BASE_API_URL + '/api/v2/jbl/credit-card/stl/account/remove/'
159CIRCUIT_USER_MEMBER_LIST_V2 = BASE_API_URL + '/api/v2/family_wallet/member-list/'
160CIRCUIT_USER_DEVICE_STATUS_CHANGE_V2 = BASE_API_URL + '/api/v2/devices/device-status-change/'
161ACTIVE_USER_LIST_V2 = BASE_API_URL + '/api/v2/users/user-list/'
162CIRCUIT_USER_CREDIT_CARD_BILL_PAYMENT_AGAINST_BANK_ACCOUNT = BASE_API_URL + \
163                                                             '/api/v2/jbl/credit-card/stl/payment/history/bank/'
164CIRCUIT_USER_CREDIT_CARD_LIST = BASE_API_URL + '/api/v2/jbl/credit-card/stl/account/list/'
165CIRCUIT_USER_CREDIT_CARD_BILL_PAYMENT_AGAINST_SPECIFIC_CREDIT_CARD = BASE_API_URL + '/api/v2/jbl/credit-card/stl/' \
166                                                                                    'payment/history/account/'
167CIRCUIT_USER_CREDIT_CARD_BILL_PAYMENT_FEATURE_STATUS = BASE_API_URL + '/api/v2/jbl/credit-card/stl/account/status/'
168CREDIT_CARD_BILL_PAYMENT_OF_A_DAY = BASE_API_URL + '/api/v2/jbl/credit-card/payment/history/'
169GET_CURRENCY_CONVERSION_RATE = BASE_API_URL + '/api/v2/jbl/credit-card/currency/rate/today/'
170UPDATE_CURRENCY_CONVERSION_RATE = BASE_API_URL + '/api/v2/jbl/credit-card/currency/rate/update/'
171CIRCUIT_USER_BENEFICIARIES_LIST_V2 = BASE_API_URL + '/api/v2/beftn/member-list'
172CIRCUIT_USER_BEFTN_HISTORY_AGAINST_SPECIFIC_BANK_ACCOUNT = BASE_API_URL + '/api/v2/beftn/payment-history/bank'
173CIRCUIT_USER_BEFTN_HISTORY_AGAINST_SPECIFIC_BENEFICIARY = BASE_API_URL + '/api/v2/beftn/payment-history/user'
174BEFTN_TRANSACTION_OF_A_DAY = BASE_API_URL + '/api/v2/beftn/payment-history/report/support/'
175BEFTN_SETTLEMENT_OF_A_DAY = BASE_API_URL + '/api/v2/beftn/payment-history/settlement-report/support/'
176
177# Merchants
178VENDOR_NAME_USED_AT_MERCHANT_PAYMENT_SERVICE = 'support_settlement'  # It will be same all the time
179MERCHANT_PAYMENT_SERVICE_KEY = \
180    '711b9985224e34a1fd142da349f675a9c4b00a458d03006f3624565269711ad8.1e04f031279749239b0c29ff4ffaec33'
181MERCHANT_PAYMENT_CREDENTIALS = {'email': 'settlement_support@circlefintech.com',
182                                'password': 'settlementsupport%%$$1234'}
183MERCHANT_PAYMENT_API_URL = 'https://sandbox-merchant.paywithconnect.com'
184MERCHANT_PAYMENT_TOKEN = MERCHANT_PAYMENT_API_URL + '/api/v1/service/login/'
185MERCHANT_PAYMENT_OF_A_DAY = MERCHANT_PAYMENT_API_URL + '/api/v1/billing/report/single-date/'
186CIRCUIT_USER_MERCHANT_PAYMENT_HISTORY = MERCHANT_PAYMENT_API_URL + '/api/v1/billing/report/'
187
188# bKash
189# BKASH_BASE_API_URL = 'https://staging-dpdc-titas.paywithconnect.com'
190BKASH_BASE_API_URL = 'http://192.168.220.208'
191# BKASH_KEY = 'bkash_payment_history'
192BKASH_KEY = 'bkash_prod_payment_history'
193# BKASH_SECRET_KEY = 'de745a42-fe71-4e3c-a000-e6e044e9d98a.bkash_payment_history.0448e3f9-0a25-414d-b49e-560047dbe818'
194BKASH_SECRET_KEY = 'de705a42-f071-4e3c-a000-g6x044f9d98a.bkash_prod_payment_history.0448e3f9-0a25-414d-b49e-505547dbe818'
195BKASH_TRANSACTION_OF_A_DAY = BKASH_BASE_API_URL + '/bkash/api/v1/send/money/history/'
196BKASH_TRANSACTION_HISTORY_AGAINST_SPECIFIC_BANK_ACCOUNT = BKASH_BASE_API_URL + '/bkash/api/v1/send/money/history/bank'
197BKASH_TRANSACTION_HISTORY_AGAINST_SPECIFIC_CONNECT_ID = BKASH_BASE_API_URL + '/bkash/api/v1/send/money/history/account'
198BKASH_ACCOUNT_LIST_FOR_CONNECT_ID = BKASH_BASE_API_URL + '/bkash/api/v1/account/list/'
199
200
201SPP_SERVICE_USERNAME_PASSWORD = {"username": "settlement", "password": "settlement123456"}
202SPP_SERVICE_USERNAME = "settlement"
203SPP_SERVICE_BASE_API_URL = "http://59.152.62.52"
204SPP_SERVICE_USER_TOKEN_URL = SPP_SERVICE_BASE_API_URL + '/api/v1/service/login/'
205OK_WALLET_TRANSACTION_OF_A_DAY = SPP_SERVICE_BASE_API_URL + '/api/v1/ok-wallet/support/ok-txn-report/'
206OK_WALLET_TRANSACTION_HISTORY_AGAINST_SPECIFIC_BANK_ACCOUNT = SPP_SERVICE_BASE_API_URL + \
207    '/api/v1/ok-wallet/support/ok-txn-report/history/bank-account/'
208OK_WALLET_TRANSACTION_HISTORY_AGAINST_SPECIFIC_OK_ACCOUNT = SPP_SERVICE_BASE_API_URL + \
209    '/api/v1/ok-wallet/support/ok-txn-report/history/ok-account/'
210OK_WALLET_MEMBER_LIST = BASE_API_URL + '/api/v2/channel/ok_wallet/member/list/'  # Member list is provided by Core
211DMONEY_TRANSACTION_OF_A_DAY = SPP_SERVICE_BASE_API_URL + '/api/v1/dmoney/support/dmoney-txn-report/'
212DMONEY_TRANSACTION_HISTORY_AGAINST_SPECIFIC_BANK_ACCOUNT = SPP_SERVICE_BASE_API_URL + \
213    '/api/v1/dmoney/support/dmoney-txn-report/history/bank-account/'
214DMONEY_TRANSACTION_HISTORY_AGAINST_SPECIFIC_DMONEY_ACCOUNT = SPP_SERVICE_BASE_API_URL + \
215    '/api/v1/dmoney/support/dmoney-txn-report/history/dmoney-account/'
216DMONEY_MEMBER_LIST = BASE_API_URL + '/api/v2/channel/dmoney/member/list/'  # Member list is provided by Core
217
218
219WSGI_APPLICATION = 'jbl_customer_support.wsgi.application'
220
221# Database
222# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
223
224DATABASES = {
225    'default': {
226        'ENGINE': 'django.db.backends.postgresql',
227        'NAME': 'jbl_support',
228        'USER': 'postgres',
229        'PASSWORD': 'postgres',
230        'HOST': 'localhost',
231        'PORT': '5432',
232    }
233}
234
235
236# Password validation
237# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
238
239AUTH_PASSWORD_VALIDATORS = [
240    {
241        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
242    },
243    {
244        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
245    },
246    {
247        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
248    },
249    {
250        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
251    },
252]
253
254# Internationalization
255# https://docs.djangoproject.com/en/1.11/topics/i18n/
256
257LANGUAGE_CODE = 'en-us'
258
259TIME_ZONE = 'Asia/Dhaka'
260
261USE_I18N = True
262
263USE_L10N = True
264
265USE_TZ = False
266
267# Static files (CSS, JavaScript, Images)
268# https://docs.djangoproject.com/en/1.11/howto/static-files/
269
270STATIC_URL = '/static/'
271
272STATICFILES_DIRS = (
273    os.path.join(BASE_DIR, 'static'),
274)
275STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
276
277MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
278MEDIA_URL = '/media/'
279
280LOGIN_URL = '/login/'
281LOGIN_REDIRECT_URL = '/'
282LOGOUT_REDIRECT_URL = '/'
283AUTHENTICATION_BACKENDS = {
284    "django.contrib.auth.backends.ModelBackend",
285    "allauth.account.auth_backends.AuthenticationBackend",
286}
287
288# Forget password notification to circle support team
289NOTIFICATION_ENDPOINT = 'https://staging-notification.paywithconnect.com/api/v1/notifications/send/'
290
291# RECAPTCHA_PUBLIC_KEY = env('RECAPTCHA_PUBLIC_KEY')
292# RECAPTCHA_PRIVATE_KEY = env('RECAPTCHA_PRIVATE_KEY')
293# NOCAPTCHA = env('NOCAPTCHA')
294
295ZENDESK_URL = 'https://circlefintechhelp.zendesk.com/api/v2/tickets.json'
296TICKET_UPDATE ='https://circlefintechhelp.zendesk.com/api/v2/tickets/'
297ZENDESK_USERNAME_PASSWORD = ('apps@circlefintech.com', 'Circle321!@#')
298
299
300DB_PREFIX = 'jblsupport_'
301
302
303FORGET_PASSWORD_EMAIL_SUBJECT = 'Forget Password Request from JBL'
304FORGET_PASSWORD_BODY = 'Hello please change password for {}'
305# FORGET_PASSWORD_RECIPIENTS_EMAIL_LIST = env('FORGET_PASSWORD_RECIPIENTS_EMAIL_LIST')