cal-itp / benefits

Transit benefits enrollment, minus the paperwork.
https://docs.calitp.org/benefits
GNU Affero General Public License v3.0
27 stars 9 forks source link

Handle errors during in-person enrollment #2345

Closed angela-tran closed 1 month ago

angela-tran commented 2 months ago

A system error is when something goes wrong on the transit processor's side, which translates to us getting back a 500 error.

A server error is when we probably did something to make the API request fail, which translates to us getting back a 400 error or some other Exception.

A re-enrollment error is simply when the user is trying to re-enroll a card and are not yet in the window for re-enrolling it.

Lastly, if all systems are working but for some reason the transit processor system said that verification of the card failed, ~we ask the user to retry~ this is a user enrollment error.

~This ticket requires a refactor to benefits.enrollment.views.token to extract logic for calling the API out to the enrollment module.~ was done as a part of #2244

Acceptance Criteria

The in_person/enrollment/system_error.html template is implemented and shown for:

The in_person/enrollment/server_error.html template is implemented and shown for:

The in_person/enrollment/reenrollment_error.html template is implemented and shown when:

The in_person/enrollment/retry.html template is implemented and shown when:

Additional context

#2066 has more history / context on distinguishing out enrollment errors.

angela-tran commented 1 month ago

@indexing - it looks like we are missing a Miro mock-up for the "server error" case.

angela-tran commented 1 month ago

Getting back to this now!

angela-tran commented 1 month ago

Hey @indexing -- thanks for adding the server error mockup to Miro!

~I just realized we have one more error screen that's missing. I think this is really the last one.~

~As described above in this issue's description, the rider-facing app shows a "retry" error screen if Littlepay was not able to verify the rider's contactless payment card. There's a screenshot of it in https://github.com/cal-itp/benefits/issues/1755 (except it's missing the retry button), which I'll embed here too:~

~I actually can't find this screen in Figma even though it seems like it did exist in Figma at one point (see @thekaveman linking to it in https://github.com/cal-itp/benefits/issues/1903). And it definitely is still in the app.~

~Ironically enough, this retry page was the one that we used to try out writing use cases: https://github.com/cal-itp/benefits/issues/1762~

~Would you be able to add a mockup for this in Miro? Let me know if you have any questions on it. Thanks!~

I was mislead by the code and template name being retry/retry.html... this page is the "user enrollment error" page! I have all that I need for this ticket in Miro.

indexing commented 1 month ago

@angela-tran Yes! Ah...naming. I was thinking the "user enrollment error" view replaced the one in the screenshot. Thanks for the confirmation.