-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Payment review #67
Payment review #67
Commits on Oct 26, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 814ce48 - Browse repository at this point
Copy the full SHA 814ce48View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a16881 - Browse repository at this point
Copy the full SHA 4a16881View commit details -
Configuration menu - View commit details
-
Copy full SHA for c72c47d - Browse repository at this point
Copy the full SHA c72c47dView commit details -
Configuration menu - View commit details
-
Copy full SHA for c94c670 - Browse repository at this point
Copy the full SHA c94c670View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9d46cd6 - Browse repository at this point
Copy the full SHA 9d46cd6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5df59dc - Browse repository at this point
Copy the full SHA 5df59dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for f39c06d - Browse repository at this point
Copy the full SHA f39c06dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 57859cb - Browse repository at this point
Copy the full SHA 57859cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d5ec99 - Browse repository at this point
Copy the full SHA 0d5ec99View commit details -
Configuration menu - View commit details
-
Copy full SHA for e529063 - Browse repository at this point
Copy the full SHA e529063View commit details -
Configuration menu - View commit details
-
Copy full SHA for a76b5cf - Browse repository at this point
Copy the full SHA a76b5cfView commit details -
- logging debug capability - payment /pay route - handles helloasso intent UNSTABLE, far from working as indented
Configuration menu - View commit details
-
Copy full SHA for 5f1623b - Browse repository at this point
Copy the full SHA 5f1623bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 369bdd6 - Browse repository at this point
Copy the full SHA 369bdd6View commit details -
Fixing typo in tokens.py, correct amount computation, add ordering in
transaction and remove pagination
Configuration menu - View commit details
-
Copy full SHA for 08b5869 - Browse repository at this point
Copy the full SHA 08b5869View commit details -
⬆️ Add admin models for payment, centralize amount
- Centralize amount calculation in a function of the `Transaction` model - Add admin entries for Transaction and Product, and tweak the Transaction form so that it can compute the amount itself on save. NOTE: currently, if you save and keep editing, the amount will not change. See #69
Configuration menu - View commit details
-
Copy full SHA for 6b1adce - Browse repository at this point
Copy the full SHA 6b1adceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2bdb165 - Browse repository at this point
Copy the full SHA 2bdb165View commit details -
Configuration menu - View commit details
-
Copy full SHA for b7b7e0b - Browse repository at this point
Copy the full SHA b7b7e0bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0cbdc3b - Browse repository at this point
Copy the full SHA 0cbdc3bView commit details -
Configuration menu - View commit details
-
Copy full SHA for c0b51a4 - Browse repository at this point
Copy the full SHA c0b51a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 39e0731 - Browse repository at this point
Copy the full SHA 39e0731View commit details -
Modify product M2M to use a through field
Use a M2M through table that also stores the amount of each product used in a transaction, sorting out the issue of not being able to have duplicate entries for a product in a Transaction.
Configuration menu - View commit details
-
Copy full SHA for eac5b84 - Browse repository at this point
Copy the full SHA eac5b84View commit details -
Implement basic handling of payment return
Implement the basic logic that verifies that a payment succeeded or failed on the main return path provided by HelloAsso.
Configuration menu - View commit details
-
Copy full SHA for dcd79a5 - Browse repository at this point
Copy the full SHA dcd79a5View commit details -
💰 Formatting of payment models file
Change the ordering of headers and fix a typo in payment models (typo is in the payment status for a transaction)
Configuration menu - View commit details
-
Copy full SHA for 9c6df4d - Browse repository at this point
Copy the full SHA 9c6df4dView commit details -
💸 Introduct more product fields
Introduce: - Product category, that allows the system to know what category the product belongs to - Associated tournament, a potential foreign key to a tournament when the product is a tournament registration - Allow a product to be a null key in a ProductCount pair, and set it to null when it is deleted
Configuration menu - View commit details
-
Copy full SHA for 696c5cb - Browse repository at this point
Copy the full SHA 696c5cbView commit details -
💶 Introduce the product category hook system
This commit introduces the product category hook system, which allows applications to create a class derived from an interface that implements callbacks for payment success and failure handling. A module can simply inherit the `PaymentHooks` class in one of its classes, and register it with the `PaymentCallbackSystem` class. An example is provided with the tournament class, which now implements a way to validate a pending registration with a payment.
Configuration menu - View commit details
-
Copy full SHA for 2170196 - Browse repository at this point
Copy the full SHA 2170196View commit details -
🫰 Show new fields in the admin view of a product
Show all fields introduced earlier in the product admin page
Configuration menu - View commit details
-
Copy full SHA for 2c540c8 - Browse repository at this point
Copy the full SHA 2c540c8View commit details -
🪙 Execute product callback hooks on payment
In the payment API, when a payment is initiated, call the preparation hooks of a payment hook class. In the return view, call the accept hooks.
Configuration menu - View commit details
-
Copy full SHA for 2c31f3d - Browse repository at this point
Copy the full SHA 2c31f3dView commit details -
📒 Several tournament models modifications
Models in the tournament field are modified thusly: - The whole file is formatted - A team is now always attached to a tournament, including when it is not validated. A boolean is added in `Team` to know if it has been validated - Both player and manager registrations now have a foreign key to their ticket, which is null until the payment of their ticket has succeeded - Admin view updated - Tests updated
Configuration menu - View commit details
-
Copy full SHA for 35e0e9a - Browse repository at this point
Copy the full SHA 35e0e9aView commit details -
🔄 Move payment callbacks in Transaction
Move payment callbacks in the transaction model, such that all of the iteration work is abstracted away from views. Also add the "id" field of a product to be shown in the admin view.
Configuration menu - View commit details
-
Copy full SHA for 0b724a3 - Browse repository at this point
Copy the full SHA 0b724a3View commit details -
🌐 Use HELLOASSO_HOSTNAME to compute CSRF URL
Use the environment variable given to us as `HELLOASSO_HOSTNAME` to compute the hostname used for helloasso in our CSRF trusted origins.
Configuration menu - View commit details
-
Copy full SHA for 03e83b4 - Browse repository at this point
Copy the full SHA 03e83b4View commit details -
📜 Set root logger level based on DEBUG status
If the environment variable indicating debug is set, the root logger is set to "DEBUG" levels of verbosity. Otherwise, it's set to "INFO".
Configuration menu - View commit details
-
Copy full SHA for 2ea997c - Browse repository at this point
Copy the full SHA 2ea997cView commit details -
🎟️ Refactor and document the HA OAuth2 token class
Refactor and document the helloasso oauth2 token retrieval class, renaming it in the process from Tokens to Token (singular).
Configuration menu - View commit details
-
Copy full SHA for 8929620 - Browse repository at this point
Copy the full SHA 8929620View commit details -
FIX: default to localhost for helloasso hostname
Otherwise the CI cannot work
Configuration menu - View commit details
-
Copy full SHA for 6bf2727 - Browse repository at this point
Copy the full SHA 6bf2727View commit details -
This commit makes the final connection between Tournament object and Product object by creating on save() the Products associated to the Tournament
Configuration menu - View commit details
-
Copy full SHA for 6d7781c - Browse repository at this point
Copy the full SHA 6d7781cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 42e2a16 - Browse repository at this point
Copy the full SHA 42e2a16View commit details -
Use the is_announced field (#81)
* Use the is_announced field If this field is set to false, the /tournament/tournament/<id>/full returns only the requested id. This allows the creation of tournaments before the announcement date. * adding is_announced in the list display
Configuration menu - View commit details
-
Copy full SHA for bbc7eb5 - Browse repository at this point
Copy the full SHA bbc7eb5View commit details -
🎟️ Link a ticket with a tournament
Add a `tournament` field to a Ticket that lets us know what tournament it is linked to.
Configuration menu - View commit details
-
Copy full SHA for 6e51076 - Browse repository at this point
Copy the full SHA 6e51076View commit details -
💰 Add cashprizes to the Tournament fields
Use an ArrayField, which is Postgresql specific, to store a list of Decimal fields that have a minimal value of 0. Also adds tests, and is needed for #49.
Configuration menu - View commit details
-
Copy full SHA for 21972a7 - Browse repository at this point
Copy the full SHA 21972a7View commit details -
📅 Add product and tournament expiry/origin times
Add fields to a Product and a Tournament that reflect the starting moment at which they can be bought/you can register, and the time limit to do so. Also add foreign keys to a tournament to store the products it creates, so as to not created them multiple times. These products are updated whenever their Tournament gets changed, but not the other way back (that will be done later). The API also enforces time constraints, as well as whether or not a tournament is announced.
Configuration menu - View commit details
-
Copy full SHA for 803f01b - Browse repository at this point
Copy the full SHA 803f01bView commit details -
❌ Do not reuse args/kwargs in second save
Do not reuse the same args and kwargs used to create the first instance of a Tournament in a second call so as to not try and re-insert the same object with the same primary key a second time.
Configuration menu - View commit details
-
Copy full SHA for d8cd512 - Browse repository at this point
Copy the full SHA d8cd512View commit details -
🌍 Translate tiem check validation errors
Translate the strings used for validation errors introduced in the second to last commit, c357aaf.
Configuration menu - View commit details
-
Copy full SHA for c4f0331 - Browse repository at this point
Copy the full SHA c4f0331View commit details -
🏆 Add a method to compute the validity of a Team
Add a method that computes whether or not a team can be considered valid at any given point, based on quotas of people who paid. For now, the parameter `n` used is the number of people who joined the team. Very soon, it will be changed by the number of slots in a team (which is tournament dependent).
Configuration menu - View commit details
-
Copy full SHA for dee6811 - Browse repository at this point
Copy the full SHA dee6811View commit details -
🛑 Add django admin action to refund a transaction
Add a Django admin action that triggers a refund of a transaction. Consequently, add a hook to the payment callback class that performs post-refund actions. For tournament, this post-refund hook finds any registration paid linked to the tournament and user in question, destroys it, and cancels associated tickets.
Configuration menu - View commit details
-
Copy full SHA for ddd7423 - Browse repository at this point
Copy the full SHA ddd7423View commit details -
Configuration menu - View commit details
-
Copy full SHA for 644d6e8 - Browse repository at this point
Copy the full SHA 644d6e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 447e2b8 - Browse repository at this point
Copy the full SHA 447e2b8View commit details -
Improve Token class, add refresh on demand
- Actually use the singleton object - Implement an expiration date - Check the expiration date when we get the token, refreshing it if need be - Add timeout parameters to the request calls, and propagate/log on errors if need be - Refactor some code
Configuration menu - View commit details
-
Copy full SHA for 7c24b9e - Browse repository at this point
Copy the full SHA 7c24b9eView commit details -
Clean up HA vars: stop reading env all day long
Transform all HelloAsso variables into constants in the settings of the whole project. Also adds organization slug, and normalizes variable names.
Configuration menu - View commit details
-
Copy full SHA for 53a4f7e - Browse repository at this point
Copy the full SHA 53a4f7eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e0f90e - Browse repository at this point
Copy the full SHA 2e0f90eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 07a7ea2 - Browse repository at this point
Copy the full SHA 07a7ea2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2539fa3 - Browse repository at this point
Copy the full SHA 2539fa3View commit details -
Fix tests and data leak in event deref route
- Fix tests (I hate timezones) - Fix a leak of data that resulted in all tournament information being visible in the `event/<id>/tournaments/` dereferencement route, which did not take into account the `is_announced` key
Configuration menu - View commit details
-
Copy full SHA for 4c4ac80 - Browse repository at this point
Copy the full SHA 4c4ac80View commit details -
Configuration menu - View commit details
-
Copy full SHA for ba5ff57 - Browse repository at this point
Copy the full SHA ba5ff57View commit details -
Refactor tournament payment hooks, add prepare
- Fix ticket creation missing a mandatory key (tournament) - Fix bug where despite buying a player ticket, you could end up validating a manager one - Change fetch_registration method to determine your type of registration from your product, not from the fact that a registration is available - Introduct the preparation hook to detect if a single registration of the correct type is ready to be paid before payment is initiated
Configuration menu - View commit details
-
Copy full SHA for e58831e - Browse repository at this point
Copy the full SHA e58831eView commit details -
Payment admin: add Payment admin view
Similar to Transactions, Payments cannot be deleted or manipulated, only viewed.
Configuration menu - View commit details
-
Copy full SHA for 8b3de70 - Browse repository at this point
Copy the full SHA 8b3de70View commit details -
Introduct order_id into Transaction
Register the order_id (which is not the same as the intent id) into a Transaction, also displaying it in the admin view
Configuration menu - View commit details
-
Copy full SHA for 76c8bfb - Browse repository at this point
Copy the full SHA 76c8bfbView commit details -
Fix initial HA token retrieval using wrong grant
The grant_type used to retrieve an OAuth token is different whether or not you are using client credentials (first login), or refreshing a token (refreshes). Without this patch, initial obtention of tokens is impossible.
Configuration menu - View commit details
-
Copy full SHA for 419b296 - Browse repository at this point
Copy the full SHA 419b296View commit details -
Implement proper use of prepare_hook + redirect
Properly redirect the user… by not redirecting them. Redirects in Django only really work within the same domain, so instead we return the URL in a JSON reply, and will let the frontend do its magic. At the same time, we move the call to the prepare_hook after creation of the transaction object (for validation purposes), but before the intent creation on HelloAsso's side. If the hooks return `False`, then something is wrong, and we cannot proceed with payment, needing instead to delete the Transaction.
Configuration menu - View commit details
-
Copy full SHA for ad23c69 - Browse repository at this point
Copy the full SHA ad23c69View commit details -
Implement the notification system + refund
Implement the notification channel that receives and handles two kinds of messages: - Order: those messages give us the layout of payments (typically here for us only one of them) and order number associated with our transaction, which we can add and update into the database - Payment: those messages let us known the status of a payment, which can trigger validation or invalidation of a transaction (invalidation has not been tested yet, as notifications only come when a payment succeeds) Properly implement refunding by iterating over defined payments for a transaction and refunding them individually. Note that that part has not been entirely tested yet, because our credentials do not allow us to refund yet.
Configuration menu - View commit details
-
Copy full SHA for e0120a0 - Browse repository at this point
Copy the full SHA e0120a0View commit details -
Properly handle unknown transactions notified
Properly handle the fact that we could get notified about a transaction we do not know
Configuration menu - View commit details
-
Copy full SHA for 41645af - Browse repository at this point
Copy the full SHA 41645afView commit details -
Remove refund action, normalize state methods
- Remove the transaction refund admin action, mostly by commenting it out - Normalize state methods, so that if you want to change the state of an action, you do not have to run the hooks yourself or touch the transaction or verify states or anything (it also logs stuff) - Add Refunded as a supported Payment message type
Configuration menu - View commit details
-
Copy full SHA for 3de3597 - Browse repository at this point
Copy the full SHA 3de3597View commit details -
Configuration menu - View commit details
-
Copy full SHA for f777427 - Browse repository at this point
Copy the full SHA f777427View commit details
Commits on Oct 27, 2023
-
Fix typo in tourney serializer RO fields
We had `manager_price_onsite` in there twice.
Configuration menu - View commit details
-
Copy full SHA for 9a45e6e - Browse repository at this point
Copy the full SHA 9a45e6eView commit details