-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ticketing integrate cybersource -> ticketing (#652)
* Add check on event deletion * add cybersource package * Capture context generation + local dev setup instructions (#645) * capture context view * fix populate * move capture context generation to checkout view * Optimize Django ops in cart validation * Use Q objects in cart validation * switch out nginx for local-ssl-proxy --------- Co-authored-by: aviupadhyayula <aupadhy@gmail.com> * fix target origin url * Closes #632 (#648) * This commit resolves #632: - Add logic to interact with the CyberSource API to validate transaction data and also confirm the payment. - Add appropriate error handling for API invocation failures causing transaction failure. - Store the transaction data in a new model `TicketTransactionRecord` for bookkeeping purposes. Each ticket is also associated with an instance of this class. - On transaction success, assign the ticket to the user, remove holds and from cart, and send out confirmation email. * Address PR comments, query opt, and others - More judicious use of `select_for_update`: only lock when updating holder/owner. - Better prefetching/bulk updating throughout the query logic - Return HTTP status codes - Refactor as per PR comments * Validate the transient token's signature - I tested the workflow from `initiate_checkout` to `complete_checkout` and was able to get it working. - Ironed out a few bugs - Add the `reconciliation_id` as a field on the transaction record; could be useful to generate reports. We'll need to figure out what else to store to interact with their reporting API. * Make reconciliation_id nullable to support free tickets * Address nit, refactor ticket count logic to SQL * merge migrations... * pipenv lock again * Pin uwsgi...2.0.25 breaks CI --------- Co-authored-by: aviupadhyayula <aupadhy@gmail.com> Co-authored-by: Rohan Moniz <60864468+rm03@users.noreply.github.com>
- Loading branch information
1 parent
20d250d
commit 428dd7e
Showing
17 changed files
with
633 additions
and
194 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 |
---|---|---|
|
@@ -23,8 +23,9 @@ htmlcov/ | |
# Test database | ||
db.sqlite3 | ||
|
||
# Mac | ||
# Misc | ||
.DS_Store | ||
*.pem | ||
|
||
# React | ||
node_modules/ | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 5.0.3 on 2024-04-03 04:32 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("clubs", "0096_merge_20240304_1450"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="ticket", | ||
name="price", | ||
field=models.DecimalField(decimal_places=2, default=0, max_digits=5), | ||
preserve_default=False, | ||
), | ||
] |
56 changes: 56 additions & 0 deletions
56
backend/clubs/migrations/0098_tickettransactionrecord_ticket_transaction_record.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,56 @@ | ||
# Generated by Django 5.0.3 on 2024-04-14 20:25 | ||
|
||
import django.db.models.deletion | ||
import phonenumber_field.modelfields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("clubs", "0097_ticket_price"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="TicketTransactionRecord", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"reconciliation_id", | ||
models.CharField(blank=True, max_length=100, null=True), | ||
), | ||
("total_amount", models.DecimalField(decimal_places=2, max_digits=5)), | ||
( | ||
"buyer_phone", | ||
phonenumber_field.modelfields.PhoneNumberField( | ||
blank=True, max_length=128, null=True, region=None | ||
), | ||
), | ||
("buyer_first_name", models.CharField(max_length=100)), | ||
("buyer_last_name", models.CharField(max_length=100)), | ||
( | ||
"buyer_email", | ||
models.EmailField(blank=True, max_length=254, null=True), | ||
), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name="ticket", | ||
name="transaction_record", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="tickets", | ||
to="clubs.tickettransactionrecord", | ||
), | ||
), | ||
] |
Oops, something went wrong.