diff --git a/internal/donor/donorpage/payment_confirmation.go b/internal/donor/donorpage/payment_confirmation.go index 09e9162614..1b9c0d9606 100644 --- a/internal/donor/donorpage/payment_confirmation.go +++ b/internal/donor/donorpage/payment_confirmation.go @@ -78,6 +78,8 @@ func PaymentConfirmation(logger Logger, tmpl template.Template, payClient PayCli nextPage = donor.PathEvidenceSuccessfullyUploaded } else if provided.EvidenceDelivery.IsPost() { nextPage = donor.PathWhatHappensNextPostEvidence + } else if provided.FeeType.IsRepeatApplicationFee() { + nextPage = donor.PathEvidenceSuccessfullyUploaded } switch provided.Tasks.PayForLpa { diff --git a/internal/donor/donorpage/payment_confirmation_test.go b/internal/donor/donorpage/payment_confirmation_test.go index 0ae15aa8f3..aaf7196c51 100644 --- a/internal/donor/donorpage/payment_confirmation_test.go +++ b/internal/donor/donorpage/payment_confirmation_test.go @@ -198,6 +198,107 @@ func TestGetPaymentConfirmationHalfFee(t *testing.T) { assert.Equal(t, http.StatusOK, resp.StatusCode) } +func TestGetPaymentConfirmationRepeatApplicationFee(t *testing.T) { + testcases := map[string]struct { + evidenceDelivery pay.EvidenceDelivery + nextPage donor.Path + }{ + "empty": { + nextPage: donor.PathEvidenceSuccessfullyUploaded, + }, + "upload": { + evidenceDelivery: pay.Upload, + nextPage: donor.PathEvidenceSuccessfullyUploaded, + }, + "post": { + evidenceDelivery: pay.Post, + nextPage: donor.PathWhatHappensNextPostEvidence, + }, + } + + for name, tc := range testcases { + t.Run(name, func(t *testing.T) { + w := httptest.NewRecorder() + r, _ := http.NewRequest(http.MethodGet, "/payment-confirmation", nil) + + payClient := newMockPayClient(t). + withASuccessfulPayment(8200, r.Context()) + + localizer := newMockLocalizer(t). + withEmailLocalizations() + + testAppData.Localizer = localizer + + template := newMockTemplate(t) + template.EXPECT(). + Execute(w, &paymentConfirmationData{ + App: testAppData, + PaymentReference: "123456789012", + FeeType: pay.RepeatApplicationFee, + NextPage: tc.nextPage, + EvidenceDelivery: tc.evidenceDelivery, + }). + Return(nil) + + sessionStore := newMockSessionStore(t). + withPaySession(r). + withExpiredPaySession(r, w) + + donorStore := newMockDonorStore(t) + donorStore.EXPECT(). + Put(r.Context(), &donordata.Provided{ + Type: lpadata.LpaTypePersonalWelfare, + Donor: donordata.Donor{FirstNames: "a", LastName: "b"}, + LpaUID: "lpa-uid", + FeeType: pay.RepeatApplicationFee, + EvidenceDelivery: tc.evidenceDelivery, + CertificateProvider: donordata.CertificateProvider{ + Email: "certificateprovider@example.com", + }, + PaymentDetails: []donordata.Payment{{ + PaymentId: "abc123", + PaymentReference: "123456789012", + Amount: 8200, + }}, + Tasks: donordata.Tasks{ + PayForLpa: task.PaymentStatePending, + }, + }). + Return(nil) + + eventClient := newMockEventClient(t) + eventClient.EXPECT(). + SendPaymentReceived(r.Context(), event.PaymentReceived{ + UID: "lpa-uid", + PaymentID: "abc123", + Amount: 8200, + }). + Return(nil) + + notifyClient := newMockNotifyClient(t). + withEmailPersonalizations(r.Context(), "£82") + + err := PaymentConfirmation(newMockLogger(t), template.Execute, payClient, donorStore, sessionStore, nil, nil, eventClient, notifyClient)(testAppData, w, r, &donordata.Provided{ + LpaUID: "lpa-uid", + FeeType: pay.RepeatApplicationFee, + EvidenceDelivery: tc.evidenceDelivery, + CertificateProvider: donordata.CertificateProvider{ + Email: "certificateprovider@example.com", + }, + Tasks: donordata.Tasks{ + PayForLpa: task.PaymentStateInProgress, + }, + Donor: donordata.Donor{FirstNames: "a", LastName: "b"}, + Type: lpadata.LpaTypePersonalWelfare, + }) + resp := w.Result() + + assert.Nil(t, err) + assert.Equal(t, http.StatusOK, resp.StatusCode) + }) + } +} + func TestGetPaymentConfirmationApprovedOrDenied(t *testing.T) { for _, taskState := range []task.PaymentState{task.PaymentStateApproved, task.PaymentStateDenied} { t.Run(taskState.String(), func(t *testing.T) { diff --git a/lang/cy.json b/lang/cy.json index c8d24dd677..952de761b0 100644 --- a/lang/cy.json +++ b/lang/cy.json @@ -927,9 +927,16 @@ "nothingHardship": "Dim - ni dalais am fy mod wedi cael hepgoriad oherwydd caledi", "howMuchYouPreviouslyPaid": "y swm wnaethoch dalu o’r blaen", "evidenceSuccessfullyUploaded": "Mae’r dystiolaeth wedi’i huwchlwytho’n llwyddiannus", - "weWillReviewYourLpaApplicationAndSupportingEvidence": "
Byddwn yn adolygu’ch cais am LPA a’ch tystiolaeth ategol.
Gallwch lofnodi’ch LPA tra byddwn ni yn adolygu’ch cais. Rhaid i’ch darparwr tystysgrif fod yn bresennol fel tyst pan fyddwch yn ei llofnodi.
Fodd bynnag, ni fyddwn yn cysylltu â’ch darparwr tystysgrif ynghylch darparu ei dystysgrif nes bydd eich {{.Application}} wedi cael ei gymeradwyo.
Unwaith y byddwn wedi cymeradwyo’ch taliad, byddwn yn cysylltu â’ch darparwr tystysgrif er mwyn iddo ddarparu ei dystysgrif.
Byddwn yn cysylltu â chi os bydd arnom angen mwy o wybodaeth neu os nad oedd eich cais yn llwyddiannus.
", + "referenceNumberStored": "Welsh", + "weWillReviewYourLpaApplicationAndSupportingEvidence": "Byddwn yn adolygu’ch cais am LPA a’ch tystiolaeth ategol.", + "weWillReviewYourLpaApplication": "Welsh", "youCanStillSignYourLpa": "Welsh
Welsh {{ .Application }} Welsh
", - "ifYourApplicationIsSuccessful": "Welsh
Welsh
", + "ifYourApplicationIsSuccessful": "Os bydd eich cais yn llwyddiannus", + "onceWeHaveApprovedYourPayment": "Unwaith y byddwn wedi cymeradwyo’ch taliad, byddwn yn cysylltu â’ch darparwr tystysgrif er mwyn iddo ddarparu ei dystysgrif.", + "onceWeHaveApprovedYourRequest": "Welsh", + "onceWeHaveApprovedYourRepeatApplication": "Welsh", + "ifYourApplicationIsNotSuccessful": "Os na fydd eich cais yn llwyddiannus", + "weWillContactYouIfWeNeedMoreInformation": "Byddwn yn cysylltu â chi os bydd arnom angen mwy o wybodaeth neu os nad oedd eich cais yn llwyddiannus.", "applicationNoFee": "cais i beidio â thalu ffi", "applicationHalfFee": "cais i dalu hanner y ffi", "applicationHardshipFee": "cais oherwydd caledi", @@ -941,7 +948,7 @@ "sendUsYourEvidenceByPost": "Anfonwch eich tystiolaeth atom drwy’r post", "sendUsYourEvidenceByPostContent": "Gallwch anfon eich tystiolaeth i’n cyfeiriad post:
Office of the Public Guardian
PO Box 16185BirminghamB2 2WH
Rhaid i’r llythyr gynnwys llythyr eglurhaol sydd â’ch cyfeirnod arno.
Os ydych yn gwneud dwy LPA yr un pryd, nid oes angen i chi anfon eich tystiolaeth ddwywaith. Gallwch ei hanfon unwaith a chynnwys cyfeirnodau’r ddwy LPA yn eich llythyr eglurhaol.
", "youMustIncludeYourReferenceNumberWarning": "Rhaid i chi gynnwys eich cyfeirnod fel y gallwn gysylltu’ch tystiolaeth â’ch cais . Byddai peidio â’i ddarparu yn gallu achosi oedi a byddai cyfnod eich cais am LPA yn gallu dod i ben.", - "whatHappensNextPostEvidenceContent": "Nawr dylech anfon eich tystiolaeth atom drwy’r post. Byddwn yn ei hadolygu ynghyd â’ch cais am LPA.
Gallwch lofnodi’ch LPA tra byddwn ni’n adolygu’ch cais. Rhaid i’ch darparwr tystysgrif fod yn bresennol fel tyst pan fyddwch yn ei llofnodi.
Fodd bynnag, ni fyddwn yn cysylltu â’ch darparwr tystysgrif ynghylch darparu ei dystysgrif nes bydd eich {{.Application}} wedi cael ei gymeradwyo.
Unwaith y byddwn wedi cymeradwyo’ch taliad, byddwn yn cysylltu â’ch darparwr tystysgrif er mwyn iddo ddarparu ei dystysgrif.
Byddwn yn cysylltu â chi os bydd arnom angen mwy o wybodaeth neu os nad oedd eich cais yn llwyddiannus.
", + "whatHappensNextPostEvidenceContent": "Nawr dylech anfon eich tystiolaeth atom drwy’r post. Byddwn yn ei hadolygu ynghyd â’ch cais am LPA.
Gallwch lofnodi’ch LPA tra byddwn ni’n adolygu’ch cais. Rhaid i’ch darparwr tystysgrif fod yn bresennol fel tyst pan fyddwch yn ei llofnodi.
Fodd bynnag, ni fyddwn yn cysylltu â’ch darparwr tystysgrif ynghylch darparu ei dystysgrif nes bydd eich {{.Application}} wedi cael ei gymeradwyo.
", "appealingTheDecision": "Apelio yn erbyn y penderfyniad", "appealingTheDecisionDetails": "Os nad oedd eich cais yn llwyddiannus, gallwch apelio o fewn 4 wythnos ar ôl y penderfyniad drwy ysgrifennu at y Pennaeth Gwasanaethau Corfforaethol.
Os bydd y penderfyniad gwreiddiol yn cael ei ategu, bydd yn cael ei gyfeirio i sylw’r Gwarcheidwad Cyhoeddus i’w gadarnhau.
", "removeTrustCorporation": "Dileu corfforaeth ymddiriedolaeth", diff --git a/lang/en.json b/lang/en.json index 9d277d783d..db268e0df1 100644 --- a/lang/en.json +++ b/lang/en.json @@ -874,9 +874,16 @@ "nothingHardship": "Nothing - I paid no fee because I got a hardship fee waiver", "howMuchYouPreviouslyPaid": "how much you previously paid", "evidenceSuccessfullyUploaded": "Evidence successfully uploaded", - "weWillReviewYourLpaApplicationAndSupportingEvidence": "We will review your LPA application and supporting evidence.
You can still sign your LPA while we’re reviewing your application. Your certificate provider must be there as a witness when you sign it.
However, we will not contact your certificate provider to provide their certificate until your {{ .Application }} has been approved.
", - "ifYourApplicationIsSuccessful": "Once we have approved your payment, we will contact your certificate provider to provide their certificate.
We will contact you if we need more information or if your application is unsuccessful.
", + "ifYourApplicationIsSuccessful": "If your application is successful", + "onceWeHaveApprovedYourPayment": "Once we have approved your payment, we will contact your certificate provider to provide their certificate.", + "onceWeHaveApprovedYourRequest": "Once we have approved your request, we will contact your certificate provider to provide their certificate.", + "onceWeHaveApprovedYourRepeatApplication": "Once we have approved your repeat application, we will contact your certificate provider to provide their certificate.", + "ifYourApplicationIsNotSuccessful": "If your application is not successful", + "weWillContactYouIfWeNeedMoreInformation": "We will contact you if we need more information or if your application is unsuccessful.", "applicationNoFee": "application to pay no fee", "applicationHalfFee": "application to pay a half fee", "applicationHardshipFee": "hardship application", @@ -888,7 +895,7 @@ "sendUsYourEvidenceByPost": "Send us your evidence by post", "sendUsYourEvidenceByPostContent": "You can send your evidence to our postal address:
Office of the Public Guardian
PO Box 16185BirminghamB2 2WH
Your letter must include a cover letter with your reference number on it.
If you are making two LPAs at the same time, you do not need to send your evidence twice. You can send it once and include both LPA reference numbers on your cover letter.
", "youMustIncludeYourReferenceNumberWarning": "You must include your reference number so we can link your evidence to your application. Not providing it could cause a delay and your LPA application could expire.", - "whatHappensNextPostEvidenceContent": "You should now send us your evidence by post. We will review it along with your LPA application.
You can still sign your LPA while we’re reviewing your application. Your certificate provider must be there as a witness when you sign it.
However, we will not contact your certificate provider to provide their certificate until your {{.Application}} has been approved.
Once we have approved your payment, we will contact your certificate provider to provide their certificate.
We will contact you if we need more information or if your application is unsuccessful.
", + "whatHappensNextPostEvidenceContent": "You should now send us your evidence by post. We will review it along with your LPA application.
You can still sign your LPA while we’re reviewing your application. Your certificate provider must be there as a witness when you sign it.
However, we will not contact your certificate provider to provide their certificate until your {{.Application}} has been approved.
", "appealingTheDecision": "Appealing the decision", "appealingTheDecisionDetails": "If your application is unsuccessful, you can appeal within 4 weeks of the decision by writing to the Head of Corporate Services.
If the original decision is upheld, it will be referred to the Public Guardian for confirmation.
", "removeTrustCorporation": "Remove trust corporation", diff --git a/web/template/donor/evidence_successfully_uploaded.gohtml b/web/template/donor/evidence_successfully_uploaded.gohtml index 23c7f71a3f..8bb7dedf58 100644 --- a/web/template/donor/evidence_successfully_uploaded.gohtml +++ b/web/template/donor/evidence_successfully_uploaded.gohtml @@ -6,16 +6,42 @@+ {{ if and .Donor.FeeType.IsRepeatApplicationFee (or .Donor.PreviousFee.IsPreviousFeeFull .Donor.PreviousFee.Empty) }} + {{ tr .App "weWillReviewYourLpaApplication" }} + {{ else }} + {{ tr .App "weWillReviewYourLpaApplicationAndSupportingEvidence" }} + {{ end }} +
+ ++ {{ if .Donor.FeeType.IsNoFee }} + {{ tr .App "onceWeHaveApprovedYourRequest" }} + {{ else if and .Donor.FeeType.IsRepeatApplicationFee }} + {{ tr .App "onceWeHaveApprovedYourRepeatApplication" }} + {{ else }} + {{ tr .App "onceWeHaveApprovedYourPayment" }} + {{ end }} +
+ +{{ tr .App "weWillContactYouIfWeNeedMoreInformation" }}
{{ if not .Donor.FeeType.IsRepeatApplicationFee }} {{ template "details" (details . "appealingTheDecision" "appealingTheDecisionDetails" false) }} diff --git a/web/template/donor/what_happens_next_post_evidence.gohtml b/web/template/donor/what_happens_next_post_evidence.gohtml index 5026e0c6ec..ef2e9f84d9 100644 --- a/web/template/donor/what_happens_next_post_evidence.gohtml +++ b/web/template/donor/what_happens_next_post_evidence.gohtml @@ -9,6 +9,20 @@ {{ trFormatHtml .App "whatHappensNextPostEvidenceContent" "Application" (printf "application%s" .Donor.FeeType.String | tr .App) }} ++ {{ if .Donor.FeeType.IsNoFee }} + {{ tr .App "onceWeHaveApprovedYourRequest" }} + {{ else if and .Donor.FeeType.IsRepeatApplicationFee }} + {{ tr .App "onceWeHaveApprovedYourRepeatApplication" }} + {{ else }} + {{ tr .App "onceWeHaveApprovedYourPayment" }} + {{ end }} +
+ +{{ tr .App "weWillContactYouIfWeNeedMoreInformation" }}
+ {{ if not .Donor.FeeType.IsRepeatApplicationFee }} {{ template "details" (details . "appealingTheDecision" "appealingTheDecisionDetails" false) }} {{ end }}