django-chelseru 1.1.0__py3-none-any.whl → 1.1.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-chelseru
3
- Version: 1.1.0
3
+ Version: 1.1.2
4
4
  Summary: Authentication system, online and real-time chat, SMS system for Iranian SMS services.
5
5
  Home-page: https://pipdjango.chelseru.com
6
6
  Author: Sobhan Bahman Rashnu
@@ -1,4 +1,4 @@
1
- django_chelseru-1.1.0.dist-info/licenses/LICENSE,sha256=VupU5KV4NteHaNQb-WH31G_WZWezxXoomjiCIAHoQJo,1089
1
+ django_chelseru-1.1.2.dist-info/licenses/LICENSE,sha256=VupU5KV4NteHaNQb-WH31G_WZWezxXoomjiCIAHoQJo,1089
2
2
  drfchelseru/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  drfchelseru/admin.py,sha256=8glh59ggY-7ud76dIDfAXQwkBPq9Q80MF_qUC9ZOi0w,986
4
4
  drfchelseru/apps.py,sha256=hOTTzFGLXiTPZeN8p_LLcSECLtsR2Q0SUo8zJzgM-qQ,211
@@ -7,13 +7,13 @@ drfchelseru/middlewares.py,sha256=2GT9wTkqfQIUQyVkecul2V4hssvhkKjYpHErvVmvY14,38
7
7
  drfchelseru/models.py,sha256=U_QqE2JdOGPP37rfB3-M4NcWysVc88xWDjWS9qo6fWI,9707
8
8
  drfchelseru/routing.py,sha256=shAlgzcIwVuVPlvKeWBLCqr6PuBTHyIrWNgHEfnqrxg,165
9
9
  drfchelseru/serializers.py,sha256=I3kS2NhzIprY8-WWhjQPShAom6R7epg7do7RnDkpnys,1421
10
- drfchelseru/services.py,sha256=zegZoUzusc8MUmcNFvt5uWbdzxfc5GD2LG0C2fQwR6g,17496
10
+ drfchelseru/services.py,sha256=p7qgxy2iOajx0muU8GUvnejOlJ8bN5Jb3GntlPttqIc,17496
11
11
  drfchelseru/settings.py,sha256=dcVmT1AdmIxeFs55R3hlCjEWYeUmYxUfEc21xi9RYag,11334
12
12
  drfchelseru/signals.py,sha256=nmFv208GW9nir9PAB0a1050OMh4I9em0n60O6Mgfwec,2554
13
13
  drfchelseru/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
14
14
  drfchelseru/urls.py,sha256=zV4PJpJoxTMoYPLSQftdh-KDRG-WFgLBmJYQBlXnNMU,895
15
15
  drfchelseru/validators.py,sha256=jAJASfG4kPcqrGxxIcoR8VjS4L4n_EzZuxJtQ1g9qmo,480
16
- drfchelseru/views.py,sha256=U70GULWChKYo2aQqBUArUbS30slYbMNRDuEKP3hgvBU,15658
16
+ drfchelseru/views.py,sha256=a0iYolE6K_UailxfcjO9egzc2Ze9NQiBRJdtRWujxjg,16303
17
17
  drfchelseru/migrations/0001_initial.py,sha256=LfkWAeQuPXNW3_igM-w_pyKafCeHQF3aReYgMXfMzEE,1034
18
18
  drfchelseru/migrations/0002_otpcode_session_user.py,sha256=c3oyBTQo2kjsKr5r_XQrqaq-66F7pui-4H4mEyAXgJk,3126
19
19
  drfchelseru/migrations/0003_rename_mobile_otpcode_mobile_number.py,sha256=eiD7t6etg6nOeT7BhJrSfEcR1yTPePXtATgtyu30520,377
@@ -31,7 +31,7 @@ drfchelseru/migrations/0014_payment_gateway_title_payment_gateway_url.py,sha256=
31
31
  drfchelseru/migrations/0015_payment_message.py,sha256=7aysohtF5ajAGFB88IRIy4nRagSi6GOIkQb9sTZp91o,436
32
32
  drfchelseru/migrations/0016_payment_card_hash_payment_card_pan_and_more.py,sha256=bRGD0ZMJWW3R_c3mFAHsTMC8am2Xymh-48XRPVKmgvc,887
33
33
  drfchelseru/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
- django_chelseru-1.1.0.dist-info/METADATA,sha256=7Ojd9dovaki8_IwsuMiMWK7qPIRgh-foI9ekMOE8k4A,10944
35
- django_chelseru-1.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
- django_chelseru-1.1.0.dist-info/top_level.txt,sha256=fsaO1F03W3j4AYi0TfDGv5Cjb_Qrh6RSkwkWqfqaMns,12
37
- django_chelseru-1.1.0.dist-info/RECORD,,
34
+ django_chelseru-1.1.2.dist-info/METADATA,sha256=terB9mh9DB4HM6JEDK6ffwXQkG5zqXmonSZTM5AOjyc,10944
35
+ django_chelseru-1.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
+ django_chelseru-1.1.2.dist-info/top_level.txt,sha256=fsaO1F03W3j4AYi0TfDGv5Cjb_Qrh6RSkwkWqfqaMns,12
37
+ django_chelseru-1.1.2.dist-info/RECORD,,
drfchelseru/services.py CHANGED
@@ -393,7 +393,7 @@ def create_payment(amount, description, merchant_id=None, callback_url=None, ord
393
393
  response = {
394
394
  'currency': currency,
395
395
  'gateway_title': GATEWAY_ZARINPAL,
396
- 'gateway_url': f'https://payment.zarinpal.com/pg/StartPay/{_response['data'].get('authority')}',
396
+ 'gateway_url': f"https://payment.zarinpal.com/pg/StartPay/{_response['data'].get('authority')}",
397
397
  'callback_url': callback_url,
398
398
  'authority': _response['data'].get('authority'),
399
399
  'status_code': _response['data'].get('code'),
drfchelseru/views.py CHANGED
@@ -282,23 +282,38 @@ class PaymentCreate(APIView):
282
282
  '''
283
283
 
284
284
  try:
285
- assert 'order_id' in self.request.data, 'order_id is required.'
285
+ # assert 'order_id' in self.request.data, 'order_id is required.'
286
286
  assert 'amount' in self.request.data, 'amount is required.'
287
- assert 'description' in self.request.data, 'description is required.'
287
+ # assert 'description' in self.request.data, 'description is required.'
288
288
 
289
289
  data = {
290
- 'order_id': self.request.data['order_id'],
290
+ # 'order_id': self.request.data['order_id'],
291
291
  'amount': self.request.data['amount'],
292
- 'description': self.request.data['description'],
292
+ 'description': 'django-chelseru: new order',
293
+ 'mobile': '',
294
+ 'email': '',
293
295
  }
294
296
 
295
- obj = self.model.objects.create(user=request.user, order_id=data['order_id'],
296
- amount=data['amount'], description=data['description'])
297
+ if self.request.user.mobile_drf_chelseru.mobile:
298
+ data['mobile'] = self.request.user.mobile_drf_chelseru.mobile
299
+
300
+ if self.request.user.email:
301
+ data['email'] = self.request.user.email
302
+
303
+ obj = self.model.objects.create(user=request.user, amount=data['amount'], description=data['description'], mobile=data['mobile'], email=data['email'])
297
304
 
298
305
  if 'callback_url' in request.data:
299
306
  data['callback_url'] = request.data['callback_url']
300
307
  obj.callback_url = data['callback_url']
301
308
 
309
+ if 'order_id' in self.request.data:
310
+ data['order_id'] = self.request.data['order_id']
311
+ obj.order_id = data['order_id']
312
+
313
+ if 'description' in self.request.data:
314
+ data['description'] = self.request.data['description']
315
+ obj.description = data['description']
316
+
302
317
  if 'mobile' in self.request.data:
303
318
  data['mobile'] = self.request.data['mobile']
304
319
  obj.mobile = data['mobile']