0001-lingo-allow-passing-extra-basket-item-info-42992.patch
combo/apps/lingo/migrations/0040_auto_20200608_1222.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# Generated by Django 1.11.18 on 2020-06-08 10:22 |
|
3 |
from __future__ import unicode_literals |
|
4 | ||
5 |
from django.db import migrations, models |
|
6 | ||
7 | ||
8 |
class Migration(migrations.Migration): |
|
9 | ||
10 |
dependencies = [ |
|
11 |
('lingo', '0039_transaction_transaction_date'), |
|
12 |
] |
|
13 | ||
14 |
operations = [ |
|
15 |
migrations.AddField( |
|
16 |
model_name='basketitem', |
|
17 |
name='email', |
|
18 |
field=models.EmailField(max_length=254, null=True), |
|
19 |
), |
|
20 |
migrations.AddField( |
|
21 |
model_name='basketitem', |
|
22 |
name='reference_id', |
|
23 |
field=models.CharField(default='', max_length=200), |
|
24 |
preserve_default=False, |
|
25 |
), |
|
26 |
] |
combo/apps/lingo/models.py | ||
---|---|---|
85 | 85 |
online_payment=data.get('online_payment'), |
86 | 86 |
paid=data.get('paid'), |
87 | 87 |
payment_date=data.get('payment_date'), |
88 |
no_online_payment_reason=data.get('no_online_payment_reason')) |
|
88 |
no_online_payment_reason=data.get('no_online_payment_reason'), |
|
89 |
reference_id=data.get('reference_id')) |
|
89 | 90 | |
90 | 91 | |
91 | 92 |
@python_2_unicode_compatible |
... | ... | |
366 | 367 |
payment_date = models.DateTimeField(null=True) |
367 | 368 |
notification_date = models.DateTimeField(null=True) |
368 | 369 |
capture_date = models.DateField(null=True) |
370 |
email = models.EmailField(null=True) |
|
371 |
reference_id = models.CharField(max_length=200) |
|
369 | 372 | |
370 | 373 |
class Meta: |
371 | 374 |
ordering = ['regie', 'extra_fee', 'subject'] |
... | ... | |
422 | 425 | |
423 | 426 |
def __init__(self, id, regie, creation_date, payment_limit_date, |
424 | 427 |
total_amount, amount, amount_paid, display_id, subject, has_pdf, |
425 |
online_payment, paid, payment_date, no_online_payment_reason): |
|
428 |
online_payment, paid, payment_date, no_online_payment_reason, |
|
429 |
reference_id): |
|
426 | 430 |
self.id = id |
427 | 431 |
self.regie = regie |
428 | 432 |
self.creation_date = dateparse.parse_date(creation_date) |
... | ... | |
437 | 441 |
self.online_payment = online_payment |
438 | 442 |
self.paid = paid |
439 | 443 |
self.no_online_payment_reason = no_online_payment_reason |
444 |
self.reference_id = reference_id |
|
440 | 445 |
if payment_date: |
441 | 446 |
self.payment_date = parser.parse(payment_date) |
442 | 447 |
combo/apps/lingo/views.py | ||
---|---|---|
184 | 184 |
user = User.objects.get(email=request.GET.get('email')) |
185 | 185 |
else: |
186 | 186 |
user = None |
187 |
item.email = request_body.get('email_address') or '' |
|
187 | 188 |
except User.DoesNotExist: |
188 | 189 |
return BadRequestJsonResponse('unknown user') |
189 | 190 | |
... | ... | |
212 | 213 | |
213 | 214 |
item.subject = request_body['display_name'] |
214 | 215 |
item.source_url = request_body.get('url') or '' |
216 |
item.reference_id = request_body.get('reference_id') or '' |
|
215 | 217 | |
216 | 218 |
if 'capture_date' in request_body: |
217 | 219 |
try: |
218 |
- |