-
Notifications
You must be signed in to change notification settings - Fork 78
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
feat: add prefills for variable payments #6899
Conversation
FRM-1514 Add soft pre-fill to payment amount
Description Problem Currently our variable payment amount fields are not-prefillable and hence agencies are not able to send specific payment amount links to individuals. Example: NP library fines. Solution Make variable payment field soft-prefillable:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, I think we can consider getting the InlineMessage (Highlighted fields below have been pre-filled according to the form link you clicked. You may edit these fields if necessary, except non-editable fields with a lock icon.
) to show up for the prefilled payment field too (L150 onwards)
frontend/src/features/public-form/components/FormFields/FormFields.tsx
Outdated
Show resolved
Hide resolved
I feel that this might bring too much attention to the variable prefills. This change is currently meant to be for NP's usecase where they want the respondents to simply pay the stated amount. @amitogp wdyt? |
Agree with @KenLSM, we should not focus much on the variable nature of prefill field. @KenLSM is there a link I can QA to see the current behavior? |
Update, QA has been done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Problem
Agencies requires a way to programmatically preset the variable payments field. They don't require a hard-prefill nor a verified prefill (i.e., savvy respondents would be able to change the prefills by updating the URL)
Closes FRM-1514
Solution
Expose
PAYMENT_VARIABLE_INPUT_AMOUNT_FIELD_ID
as thefieldId
for prefills.Read and populate variable payments field if prefill exists.
Validation of values is not performed until the payer interacts with the field -- similar to how soft-prefill works currently.
There's no toggle required for prefills (no need for field_id)
Breaking Changes
Tests
Regression
Ensure that prefill works on non-payment forms
Prefills happy flow
?payment_variable_input_amount_field_id=<amount_in_cents>
to the end of the urlPrefills happy flow with other prefillable fields
&payment_variable_input_amount_field_id=<amount_in_cents>
to the end of the url (note that we're trying to have two prefills on the URL. 1 for Short Text, another for Variable Payments`Prefills invalid data flow
?payment_variable_input_amount_field_id=THIS_IS_NOT_A_NUMBER
to the end of the url