If a user has already paid for an event, we do not want them to pay again.
Currently, every payment creates an entry in the Google Spreadsheet. This leads to many duplicate entries.
Solution:
To fix Issue 1, modifications to the EnrollmentForm.php controller and Verification_Model have been made.
Function has_user_paid_event has been made, similar to has_user_paid (for the membership).
Function is_email_on_sheet has been modified to include two new parameters, sheetId and sheetName with MEMBERSHIP_SPREADSHEETID and MEMBERSHIP_SHEETNAME constants as defaults respectively.
This calls is_email_on_sheet with additional parameters regarding to the spreadsheet being accessed. This call will access the Event Registration System spreadsheet.
The validate() function in EnrollmentForm.php will now check has_user_paid_event. The error messages being displayed are in enrollmentForm.js
To fix Issue 2, Gsheet_Interface_Model.php and EnrollmentForm.php is also added.
Added a function in Gsheet_Interface_Model.php called update_payment_method that updates the column F (the payment method) to the selected payment method.
Added a check in EnrollmentForm.php for duplicated entries. If so, update_payment_method is called.
Risk area:
Make sure there are no empty lines in the Google Sheet, for example:
For some reason, this breaks the functionality. However, this should not be a problem unless someone deletes a line manually.
Reviewed by:
Lucas, Raymond, Anubhav, Daniel, Victor
Issue: Two issues:
Solution: To fix Issue 1, modifications to the
EnrollmentForm.php
controller andVerification_Model
have been made. Functionhas_user_paid_event
has been made, similar tohas_user_paid
(for the membership). Functionis_email_on_sheet
has been modified to include two new parameters,sheetId
andsheetName
withMEMBERSHIP_SPREADSHEETID
andMEMBERSHIP_SHEETNAME
constants as defaults respectively. This callsis_email_on_sheet
with additional parameters regarding to the spreadsheet being accessed. This call will access the Event Registration System spreadsheet. Thevalidate()
function inEnrollmentForm.php
will now checkhas_user_paid_event
. The error messages being displayed are inenrollmentForm.js
To fix Issue 2,
Gsheet_Interface_Model.php
andEnrollmentForm.php
is also added. Added a function inGsheet_Interface_Model.php
calledupdate_payment_method
that updates the column F (the payment method) to the selected payment method. Added a check inEnrollmentForm.php
for duplicated entries. If so,update_payment_method
is called.Risk area: Make sure there are no empty lines in the Google Sheet, for example: For some reason, this breaks the functionality. However, this should not be a problem unless someone deletes a line manually.
Reviewed by: Lucas, Raymond, Anubhav, Daniel, Victor