-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from rebkwok/stripe
Stripe
- Loading branch information
Showing
124 changed files
with
6,040 additions
and
622 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
[run] | ||
omit=venv/*,booking/management/commands/upload_data.py,booking/management/commands/update_categories.py,../*migrations*,../*tests*,../*wsgi*,../*__init__*,timetable/management/commands/create_pip_hire_sessions.py,manage.py | ||
omit=venv/*,\ | ||
booking/management/commands/upload_data.py,\ | ||
booking/management/commands/update_categories.py,\ | ||
booking/management/commands/check_credits.py,\ | ||
booking/management/commands/reactivate_blocks.py,\ | ||
../*migrations*,../*tests*,../*wsgi*,../*__init__*,\ | ||
timetable/management/commands/create_pip_hire_sessions.py,manage.py | ||
relative_files = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from datetime import timedelta, datetime | ||
from datetime import timezone as dt_timezone | ||
|
||
from django.conf import settings | ||
from django.contrib.auth.models import User | ||
|
||
from django.utils import timezone | ||
|
@@ -38,35 +39,43 @@ | |
|
||
future_EV = Recipe(Event, | ||
date=future, | ||
event_type=foreign_key(event_type_OE)) | ||
event_type=foreign_key(event_type_OE), | ||
paypal_email=settings.DEFAULT_PAYPAL_EMAIL) | ||
|
||
future_WS = Recipe(Event, | ||
date=future, | ||
event_type=foreign_key(event_type_WS)) | ||
event_type=foreign_key(event_type_WS), | ||
paypal_email=settings.DEFAULT_PAYPAL_EMAIL) | ||
|
||
future_PC = Recipe(Event, | ||
date=future, | ||
event_type=foreign_key(event_type_PC)) | ||
event_type=foreign_key(event_type_PC), | ||
paypal_email=settings.DEFAULT_PAYPAL_EMAIL) | ||
future_PP = Recipe(Event, | ||
date=future, | ||
event_type=foreign_key(event_type_PP)) | ||
event_type=foreign_key(event_type_PP), | ||
paypal_email=settings.DEFAULT_PAYPAL_EMAIL) | ||
future_CL = Recipe(Event, | ||
date=future, | ||
event_type=foreign_key(event_type_OC)) | ||
event_type=foreign_key(event_type_OC), | ||
paypal_email=settings.DEFAULT_PAYPAL_EMAIL) | ||
future_RH = Recipe(Event, | ||
date=future, | ||
event_type=foreign_key(event_type_RH)) | ||
event_type=foreign_key(event_type_RH), | ||
paypal_email=settings.DEFAULT_PAYPAL_EMAIL) | ||
future_OT = Recipe(Event, | ||
date=future, | ||
event_type=foreign_key(event_type_OT)) | ||
event_type=foreign_key(event_type_OT), | ||
paypal_email=settings.DEFAULT_PAYPAL_EMAIL) | ||
|
||
# past event | ||
past_event = Recipe(Event, | ||
date=past, | ||
event_type=foreign_key(event_type_WS), | ||
advance_payment_required=True, | ||
cost=10, | ||
payment_due_date=past-timedelta(10) | ||
payment_due_date=past-timedelta(10), | ||
paypal_email=settings.DEFAULT_PAYPAL_EMAIL | ||
) | ||
|
||
# past_class | ||
|
@@ -75,7 +84,8 @@ | |
event_type=foreign_key(event_type_PC), | ||
advance_payment_required=True, | ||
cost=10, | ||
payment_due_date=past-timedelta(10) | ||
payment_due_date=past-timedelta(10), | ||
paypal_email=settings.DEFAULT_PAYPAL_EMAIL | ||
) | ||
|
||
blocktype = Recipe(BlockType, active=True, duration=4) | ||
|
@@ -107,37 +117,48 @@ | |
block_type=foreign_key(blocktype10), | ||
start_date=datetime(2015, 1, 1, tzinfo=dt_timezone.utc)) | ||
|
||
booking = Recipe(Booking, user__email=seq("[email protected]")) | ||
booking_with_user = Recipe(Booking, user=foreign_key(user)) | ||
booking = Recipe( | ||
Booking, user__email=seq("[email protected]"), | ||
event__paypal_email=settings.DEFAULT_PAYPAL_EMAIL | ||
) | ||
booking_with_user = Recipe( | ||
Booking, user=foreign_key(user), | ||
event__paypal_email=settings.DEFAULT_PAYPAL_EMAIL | ||
) | ||
|
||
past_booking = Recipe(Booking, | ||
event=foreign_key(past_event), | ||
user=foreign_key(user) | ||
) | ||
past_booking = Recipe( | ||
Booking, | ||
event=foreign_key(past_event), | ||
user=foreign_key(user), | ||
event__paypal_email=settings.DEFAULT_PAYPAL_EMAIL | ||
) | ||
|
||
fb_app = Recipe(SocialApp, | ||
provider='facebook') | ||
|
||
mon_session = Recipe( | ||
Session, event_type=foreign_key(event_type_PC), day=Session.MON, | ||
payment_time_allowed=None | ||
payment_time_allowed=None, paypal_email=settings.DEFAULT_PAYPAL_EMAIL | ||
) | ||
tue_session = Recipe( | ||
Session, event_type=foreign_key(event_type_PC), day=Session.TUE, | ||
payment_time_allowed=None | ||
payment_time_allowed=None, paypal_email=settings.DEFAULT_PAYPAL_EMAIL | ||
) | ||
wed_session = Recipe( | ||
Session, event_type=foreign_key(event_type_PC), day=Session.WED, | ||
payment_time_allowed=None | ||
payment_time_allowed=None, paypal_email=settings.DEFAULT_PAYPAL_EMAIL | ||
) | ||
|
||
waiting_list_user = Recipe(WaitingListUser, user=foreign_key(user)) | ||
|
||
ticketed_event_max10 = Recipe( | ||
TicketedEvent, max_tickets=10, ticket_cost=10, date=future | ||
TicketedEvent, max_tickets=10, ticket_cost=10, date=future, | ||
paypal_email=settings.DEFAULT_PAYPAL_EMAIL | ||
) | ||
ticketed_event_past_max10 = Recipe( | ||
TicketedEvent, max_tickets=10, ticket_cost=10, date=past, | ||
paypal_email=settings.DEFAULT_PAYPAL_EMAIL | ||
) | ||
ticketed_event_past_max10 = Recipe(TicketedEvent, max_tickets=10, | ||
ticket_cost=10, date=past) | ||
ticket_booking = Recipe(TicketBooking, user=foreign_key(user)) | ||
|
||
online_disclaimer = Recipe( | ||
|
@@ -148,8 +169,11 @@ | |
) | ||
|
||
event_gift_voucher = Recipe( | ||
EventVoucher, code="abc1234", activated=False, discount=100, max_per_user=1, max_vouchers=1 | ||
EventVoucher, code="abc1234", activated=False, discount=100, max_per_user=1, max_vouchers=1, | ||
is_gift_voucher=True | ||
) | ||
block_gift_voucher = Recipe( | ||
BlockVoucher, code="def1234", activated=False, discount=100, max_per_user=1, max_vouchers=1 | ||
) | ||
BlockVoucher, | ||
code="def1234", activated=False, discount=100, max_per_user=1, max_vouchers=1, | ||
is_gift_voucher=True | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
booking/migrations/0084_basevoucher_checkout_time_basevoucher_invoice_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Generated by Django 4.1.1 on 2023-09-07 08:39 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('stripe_payments', '0001_initial'), | ||
('booking', '0083_filtercategory_filtercategory_unique_lower_category_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='basevoucher', | ||
name='checkout_time', | ||
field=models.DateTimeField(blank=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='basevoucher', | ||
name='invoice', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='vouchers', to='stripe_payments.invoice'), | ||
), | ||
migrations.AddField( | ||
model_name='block', | ||
name='checkout_time', | ||
field=models.DateTimeField(blank=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='block', | ||
name='invoice', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='blocks', to='stripe_payments.invoice'), | ||
), | ||
migrations.AddField( | ||
model_name='booking', | ||
name='checkout_time', | ||
field=models.DateTimeField(blank=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='booking', | ||
name='invoice', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='bookings', to='stripe_payments.invoice'), | ||
), | ||
migrations.AddField( | ||
model_name='ticketbooking', | ||
name='checkout_time', | ||
field=models.DateTimeField(blank=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='ticketbooking', | ||
name='invoice', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ticket_bookings', to='stripe_payments.invoice'), | ||
), | ||
] |
28 changes: 28 additions & 0 deletions
28
booking/migrations/0085_alter_blocktype_paypal_email_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated by Django 4.1.1 on 2023-09-07 08:42 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('booking', '0084_basevoucher_checkout_time_basevoucher_invoice_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='blocktype', | ||
name='paypal_email', | ||
field=models.EmailField(default='[email protected]', help_text='Email for the paypal account to be used for payment. Check this carefully!', max_length=254), | ||
), | ||
migrations.AlterField( | ||
model_name='event', | ||
name='paypal_email', | ||
field=models.EmailField(default='[email protected]', help_text='Email for the paypal account to be used for payment. Check this carefully!', max_length=254), | ||
), | ||
migrations.AlterField( | ||
model_name='ticketedevent', | ||
name='paypal_email', | ||
field=models.EmailField(default='[email protected]', help_text='Email for the paypal account to be used for payment. Check this carefully!', max_length=254), | ||
), | ||
] |
23 changes: 23 additions & 0 deletions
23
booking/migrations/0086_block_voucher_code_booking_voucher_code.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 4.1.1 on 2023-09-10 15:22 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('booking', '0085_alter_blocktype_paypal_email_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='block', | ||
name='voucher_code', | ||
field=models.CharField(blank=True, max_length=255, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='booking', | ||
name='voucher_code', | ||
field=models.CharField(blank=True, max_length=255, null=True), | ||
), | ||
] |
Oops, something went wrong.