Bug 8639 - Verify required fields on payment configuration forms
Verify required fields on payment configuration forms
Status: RESOLVED FIXED
Product: OMP
Classification: Unclassified
Component: User Interface
1.1.1
All All
: P3 normal
Assigned To: PKP Support
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-22 08:22 PDT by Alec Smecher
Modified: 2014-04-03 10:49 PDT (History)
1 user (show)

See Also:
Version Reported In:
Also Affects:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alec Smecher 2014-03-22 08:22:23 PDT
Payment configuration fields that are marked required (*) may not be checked by the code. Some of these are required for the plugin to be considered "configured", leading to frustrating situations like this:
http://pkp.sfu.ca/support/forum/viewtopic.php?f=40&t=10529#p45418

Ensure that the form checks for required fields.
Comment 1 Jason Nugent 2014-04-02 08:25:55 PDT
Looking at this.  Right  now, we have our PaymentMethodForm which handles form requests for all payment methods. Right now, that's just manual and paypal.  The problem is that the form does not know what the required fields are for each type of payment plugin, and so does not set any validation checks in the constructor. The SettingsTabHandler calls saveFormData() and then the form's validate method, but the checks need to be added.

Two options:

1.  Can the form submission requests be handled by the plugin itself, like regular plugin settings, when the form is submitted?  This would encapsulate things within the plugin, and keep us from having to add validation checks after we know what plugin has been chosen on the payment method tab.

2.  The DistributionSettingsTabHandler, the subclass for SettingsTabHandler can check to see what plugin was chosen and the required fields can be passed into the PaymentMethodForm's constructor.  Then the checks can be added so the validate() call will work.
Comment 2 Alec Smecher 2014-04-02 08:51:41 PDT
No strong preference, Jason. IIRC some of the quirks of the current implementation stem from an attempt to keep it close to backward compatible with the OJS 2.x payment plugin structure. Now that we've diverged so much in other areas, it's probably more important to have a good, clean structure going forward than it is to maintain backwards compatibility.
Comment 3 Jason Nugent 2014-04-03 10:47:02 PDT
provide validation for payment forms
https://github.com/pkp/pkp-lib/commit/ca71de0f0107284866a5064333139d5449fd1435
Comment 4 Jason Nugent 2014-04-03 10:49:02 PDT
provide validation for payment forms
https://github.com/pkp/pkp-lib/commit/9889762dfb94c10c8a618dd0507de6730098451c