diff --git a/app/services/idv/actions/cancel_update_ssn_action.rb b/app/services/idv/actions/cancel_update_ssn_action.rb new file mode 100644 index 00000000000..8548a15e920 --- /dev/null +++ b/app/services/idv/actions/cancel_update_ssn_action.rb @@ -0,0 +1,9 @@ +module Idv + module Actions + class CancelUpdateSsnAction < Idv::Steps::DocAuthBaseStep + def call + mark_step_complete(:ssn) if flow_session[:pii_from_doc][:ssn] + end + end + end +end diff --git a/app/services/idv/flows/doc_auth_flow.rb b/app/services/idv/flows/doc_auth_flow.rb index f41932cf7b7..91730d520c7 100644 --- a/app/services/idv/flows/doc_auth_flow.rb +++ b/app/services/idv/flows/doc_auth_flow.rb @@ -29,6 +29,7 @@ class DocAuthFlow < Flow::BaseFlow ACTIONS = { cancel_send_link: Idv::Actions::CancelSendLinkAction, cancel_link_sent: Idv::Actions::CancelLinkSentAction, + cancel_update_ssn: Idv::Actions::CancelUpdateSsnAction, reset: Idv::Actions::ResetAction, redo_ssn: Idv::Actions::RedoSsnAction, verify_document: Idv::Actions::VerifyDocumentAction, diff --git a/app/views/idv/doc_auth/_ssn_init.html.erb b/app/views/idv/doc_auth/_ssn_init.html.erb new file mode 100644 index 00000000000..110da425170 --- /dev/null +++ b/app/views/idv/doc_auth/_ssn_init.html.erb @@ -0,0 +1,48 @@ +<% title t('titles.doc_auth.verify') %> + +<%= render 'shared/alert', { + type: 'success', + class: 'margin-bottom-4' +} do %> + <%= t('doc_auth.headings.capture_complete') %> +<% end %> + +

+ <%= t('doc_auth.headings.ssn') %> +

+ +

+ <%= t('doc_auth.info.ssn') %> + <%= new_window_link_to(t('doc_auth.instructions.learn_more'), MarketingSite.security_and_privacy_practices_url) %> +

+ +<%= validated_form_for( + :doc_auth, + url: url_for, + method: :put, + html: { autocomplete: 'off', class: 'margin-top-2' } +) do |f| %> +
+
+ + <%= f.input( + :ssn, + as: :password, + label: t('idv.form.ssn_label_html'), + required: true, + pattern: '^\d{3}-?\d{2}-?\d{4}$', + maxlength: 11, + input_html: { aria: { invalid: false }, class: 'ssn ssn-toggle', value: '' } + ) %> +
+
+ +

<%= flow_session[:error_message] %>

+ +
+ +
+<% end %> +<%= render 'idv/doc_auth/start_over_or_cancel', step: 'ssn' %> diff --git a/app/views/idv/doc_auth/_ssn_update.html.erb b/app/views/idv/doc_auth/_ssn_update.html.erb new file mode 100644 index 00000000000..796f6d2fbd1 --- /dev/null +++ b/app/views/idv/doc_auth/_ssn_update.html.erb @@ -0,0 +1,42 @@ +<% title t('titles.doc_auth.verify') %> + +

+ <%= t('doc_auth.headings.ssn_update') %> +

+ +

+ <%= t('doc_auth.info.ssn') %> + <%= new_window_link_to(t('doc_auth.instructions.learn_more'), MarketingSite.security_and_privacy_practices_url) %> +

+ +<%= validated_form_for( + :doc_auth, + url: url_for, + method: :put, + html: { autocomplete: 'off', class: 'margin-top-2' } +) do |f| %> +
+
+ + <%= f.input( + :ssn, + as: :password, + label: t('idv.form.ssn_label_html'), + required: true, + pattern: '^\d{3}-?\d{2}-?\d{4}$', + maxlength: 11, + input_html: { aria: { invalid: false }, class: 'ssn ssn-toggle', value: '' } + ) %> +
+
+ +

<%= flow_session[:error_message] %>

+ +
+ +
+<% end %> +<%= render 'idv/doc_auth/back', action: 'cancel_update_ssn' %> + diff --git a/app/views/idv/doc_auth/ssn.html.erb b/app/views/idv/doc_auth/ssn.html.erb index a4fb7cb2e9b..66f6df76ca4 100644 --- a/app/views/idv/doc_auth/ssn.html.erb +++ b/app/views/idv/doc_auth/ssn.html.erb @@ -1,43 +1,5 @@ -<% title t('titles.doc_auth.verify') %> - -<%= render 'shared/alert', { - type: 'success', - class: 'margin-bottom-4' -} do %> - <%= t('doc_auth.headings.capture_complete') %> +<% if flow_session['pii_from_doc']['ssn'] %> + <%= render 'idv/doc_auth/ssn_update', flow_session: flow_session %> +<% else %> + <%= render 'idv/doc_auth/ssn_init', flow_session: flow_session %> <% end %> - -

- <%= t('doc_auth.headings.ssn') %> -

- -<%= validated_form_for( - :doc_auth, - url: url_for, - method: :put, - html: { autocomplete: 'off', class: 'margin-top-2' } -) do |f| %> -
-
- - <%= f.input( - :ssn, - as: :password, - label: t('idv.form.ssn_label_html'), - required: true, - pattern: '^\d{3}-?\d{2}-?\d{4}$', - maxlength: 11, - input_html: { aria: { invalid: false }, class: 'ssn ssn-toggle', value: '' } - ) %> -
-
- -

<%= flow_session[:error_message] %>

- -
- -
-<% end %> -<%= render 'idv/doc_auth/start_over_or_cancel', step: 'ssn' %> diff --git a/config/locales/doc_auth/en.yml b/config/locales/doc_auth/en.yml index 759e08460ba..cc252a0236c 100644 --- a/config/locales/doc_auth/en.yml +++ b/config/locales/doc_auth/en.yml @@ -115,7 +115,7 @@ en: state: State zip_code: Zip Code headings: - address: Mailing Address + address: Update your mailing address back: Back capture_complete: We have verified your state-issued ID document_capture: Add your state-issued ID @@ -131,7 +131,8 @@ en: review_issues: Check your images and try again secure_account: Secure your account selfie: Take a photo of yourself - ssn: Please enter your social security number. + ssn: Please enter your Social Security number. + ssn_update: Update your Social Security number take_picture: Take a photo with a phone text_message: We sent a message to your phone upload: How would you like to upload your state-issued ID? @@ -170,6 +171,10 @@ en: secure_account: After you verify, we’ll ask you to encrypt your account. Encryption means your data is protected and only you, the account holder, will be able to access or change your information. + ssn: We need your Social Security number to validate your name, date of birth + and address. Your Social Security number is encrypted. With your + consent, we share this information with the government agency you are + trying to access to verify your identity. tag: Recommended take_picture: Use the camera on your mobile phone and upload images of your ID. We only use the images to verify your identity. diff --git a/config/locales/doc_auth/es.yml b/config/locales/doc_auth/es.yml index a1ee22ae003..0e4a6d94afc 100644 --- a/config/locales/doc_auth/es.yml +++ b/config/locales/doc_auth/es.yml @@ -141,7 +141,7 @@ es: state: Estado zip_code: Código postal headings: - address: Dirección de envio + address: Actualice su dirección postal back: Parte Trasera capture_complete: Hemos verificado su identificación expedida por el estado document_capture: Añada su documento de identidad expedido por el estado @@ -157,7 +157,8 @@ es: review_issues: Revise sus imágenes e inténtelo de nuevo secure_account: Asegure su cuenta selfie: Tómese una foto - ssn: Por favor ingrese su número de seguro social. + ssn: Por favor ingrese su número de Seguro Social. + ssn_update: Actualice su número de Seguro Social take_picture: Toma una foto con un teléfono text_message: Enviamos un mensaje a su teléfono upload: '¿Cómo le gustaría subir su documento de identidad expedido por el @@ -201,6 +202,11 @@ es: su cuenta. Con el cifrado, sus datos quedan protegidos, por lo que solo usted, el titular de la cuenta, puede acceder a su información o modificarla. + ssn: Necesitamos su número de Seguro Social para validar su nombre, fecha de + nacimiento y habla a. Su número de Seguro Social está encriptado. Con su + consentimiento, compartimos este información con la agencia + gubernamental a la que está intentando acceder para verificar su + identidad. tag: Recomendado take_picture: Use la cámara en su teléfono móvil y cargue imágenes de su identificación. Solo usamos las imágenes para verificar su identidad. diff --git a/config/locales/doc_auth/fr.yml b/config/locales/doc_auth/fr.yml index 71400b83871..ec9029dc0bf 100644 --- a/config/locales/doc_auth/fr.yml +++ b/config/locales/doc_auth/fr.yml @@ -146,7 +146,7 @@ fr: state: Etat zip_code: Code postal headings: - address: Adresse mail + address: Mettre à jour votre adresse postale back: Verso capture_complete: Nous avons vérifié votre carte d’identité délivrée par l’État document_capture: Ajoutez votre carte d’identité délivrée par l’État @@ -162,7 +162,8 @@ fr: review_issues: Vérifiez vos images et essayez à nouveau secure_account: Sécuriser votre compte selfie: Prenez une photo de vous-même - ssn: S’il vous plaît entrez votre numéro de sécurité sociale. + ssn: S’il vous plaît entrez votre numéro de Sécurité Sociale. + ssn_update: Mettre à jour votre numéro de Sécurité Sociale take_picture: Prendre une photo avec un téléphone text_message: Nous avons envoyé un message à votre téléphone upload: Comment souhaitez-vous télécharger votre carte d’identité délivrée par @@ -210,6 +211,11 @@ fr: crypter votre compte. Le cryptage garantit la protection de vos données et seul vous, le titulaire du compte, pourrez accéder à vos informations ou les modifier. + ssn: Nous avons besoin de votre numéro de sécurité sociale pour valider votre + nom, date de naissance et adresse. Votre numéro de sécurité sociale est + crypté. Avec votre accord, nous partageons ce informations auprès de + l'agence gouvernementale à laquelle vous essayez d'accéder pour vérifier + votre identité. tag: Recommandation take_picture: Utilisez l’appareil photo sur votre téléphone portable et téléchargez des images de votre identifiant. Nous utilisons uniquement diff --git a/spec/features/idv/doc_auth/verify_step_spec.rb b/spec/features/idv/doc_auth/verify_step_spec.rb index e009b71d0f0..57f7544dfe9 100644 --- a/spec/features/idv/doc_auth/verify_step_spec.rb +++ b/spec/features/idv/doc_auth/verify_step_spec.rb @@ -51,10 +51,14 @@ expect(page).to have_selector("input[value='59010']") end - it 'proceeds to the ssn page if the user clicks change ssn' do + it 'proceeds to the ssn page if the user clicks change ssn and allows user to go back' do click_button t('doc_auth.buttons.change_ssn') expect(page).to have_current_path(idv_doc_auth_ssn_step) + expect(page).to have_content(t('doc_auth.headings.ssn_update')) + + click_button t('forms.buttons.back') + expect(page).to have_current_path(idv_doc_auth_verify_step) end it 'does not proceed to the next page if resolution fails' do