Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
21624fd
PP-14616 add fixtures
ralphm10 Feb 18, 2026
a6ce1a9
PP-14616 scaffold stubs
ralphm10 Feb 19, 2026
6afa008
PP-14616 add transaction stub
ralphm10 Feb 19, 2026
6786891
PP-14616 page content tests
ralphm10 Feb 20, 2026
134cad6
PP-14616 WIP assertion for transaction fields
ralphm10 Feb 20, 2026
20b97de
Merge branch 'master' into PP-14616-transactions-list-view-cypress-tests
ralphm10 Feb 23, 2026
283dac1
PP-14616 update assertions for transaction row
ralphm10 Feb 23, 2026
cc5190c
PP-14616 update assertions for transaction row
ralphm10 Feb 24, 2026
368a3b2
PP-14616 update current page
ralphm10 Feb 24, 2026
ccee191
PP-14616 test corporate surcharge
ralphm10 Feb 24, 2026
100dd3e
PP-14616 test for provider fees
ralphm10 Feb 24, 2026
bad98be
PP-14616 WIP dispute status test
ralphm10 Feb 24, 2026
79cee05
PP-14616 WIP dispute status test
ralphm10 Feb 25, 2026
7750638
Merge branch 'master' into PP-14616-transactions-list-view-cypress-tests
ralphm10 Feb 25, 2026
a32bb3b
PP-14616 test for error if possible PAN entered
ralphm10 Feb 25, 2026
3b5e540
PP-14616 tests for error states
ralphm10 Feb 26, 2026
06ec9d1
PP-14616 refactor test
ralphm10 Feb 26, 2026
8c59abb
PP-14616 pagination test for page 1
ralphm10 Feb 26, 2026
b74c646
PP-14616 pagination tests
ralphm10 Feb 27, 2026
947fb02
PP-14616 pagination tests
ralphm10 Feb 27, 2026
3baf402
PP-14616 test fr date filters
ralphm10 Feb 27, 2026
3b9b438
PP-14616 test for date range WIP
ralphm10 Mar 2, 2026
08bfacb
PP-14616 add stub for transactions
ralphm10 Mar 2, 2026
bf28e85
PP-14616 refund and dispute filter tests
ralphm10 Mar 3, 2026
77c2c02
PP-14616 dispute lost test
ralphm10 Mar 3, 2026
1d46467
PP-14616 dispute won test
ralphm10 Mar 3, 2026
3311a3f
PP-14616 refactor tests
ralphm10 Mar 3, 2026
cc531b1
PP-14616 fix lint error
ralphm10 Mar 3, 2026
aad65fa
PP-14616 refactor tests
ralphm10 Mar 4, 2026
fcc8289
PP-14616 prettier
ralphm10 Mar 4, 2026
93102bd
Merge branch 'master' into PP-14616-transactions-list-view-cypress-tests
ralphm10 Mar 4, 2026
68e69db
PP-14616 WIP csv dl test
ralphm10 Mar 5, 2026
74b6996
PP-14616 csv dl tests
ralphm10 Mar 5, 2026
50888d8
PP-14616 csv dl tests
ralphm10 Mar 5, 2026
29ac3a3
PP-14616 csv test for 0 tx
ralphm10 Mar 5, 2026
cf09ad5
Merge branch 'master' into PP-14616-transactions-list-view-cypress-tests
ralphm10 Mar 9, 2026
7621304
PP-14616 add test for refund url
ralphm10 Mar 9, 2026
4312b0e
PP-14616 prettier
ralphm10 Mar 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -278,42 +278,42 @@
"filename": "src/views/simplified-account/transactions/index.njk",
"hashed_secret": "8a764e7de8baf91c09a0141c9d0653d6c62300fa",
"is_verified": false,
"line_number": 136
"line_number": 140
},
{
"type": "Base64 High Entropy String",
"filename": "src/views/simplified-account/transactions/index.njk",
"hashed_secret": "c15bfbed4cf339878d4c69339491df034b592627",
"is_verified": false,
"line_number": 142
"line_number": 146
},
{
"type": "Base64 High Entropy String",
"filename": "src/views/simplified-account/transactions/index.njk",
"hashed_secret": "09ea33e2341efbf111c4eb12a709ae94c96a7e51",
"is_verified": false,
"line_number": 150
"line_number": 154
},
{
"type": "Base64 High Entropy String",
"filename": "src/views/simplified-account/transactions/index.njk",
"hashed_secret": "d9d993cc5556aa0fa6e18b26fdfd4fa8527db044",
"is_verified": false,
"line_number": 155
"line_number": 159
},
{
"type": "Base64 High Entropy String",
"filename": "src/views/simplified-account/transactions/index.njk",
"hashed_secret": "ce50854e96f8dd430451450f2e7334e4b48db7f0",
"is_verified": false,
"line_number": 160
"line_number": 164
},
{
"type": "Base64 High Entropy String",
"filename": "src/views/simplified-account/transactions/index.njk",
"hashed_secret": "34f47d2f3c482850fd7f6de8564a8aa73afe87bc",
"is_verified": false,
"line_number": 165
"line_number": 169
}
],
"src/views/transactions/index.njk": [
Expand Down Expand Up @@ -794,5 +794,5 @@
}
]
},
"generated_at": "2026-03-03T13:42:18Z"
"generated_at": "2026-03-05T12:26:11Z"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {
WorldpayStatusFilters,
} from '@utils/simplified-account/services/transactions/status-filters'

const LEDGER_TRANSACTION_COUNT_LIMIT = 5000

const getUrlGenerator = (filters: Record<string, string>, transactionsUrl: string) => {
const getPath = (pageNumber: number) => {
const params = new URLSearchParams(filters)
Expand Down Expand Up @@ -69,6 +71,10 @@ async function get(req: ServiceRequest, res: ServiceResponse) {
)
const downloadQueryString = transactionSearchParams.getQueryParams().toString()
const downloadLink = downloadQueryString.length ? `${downloadUrl}?${downloadQueryString}` : downloadUrl
const transactionCountWithinRange = results.total > 0 && results.total <= LEDGER_TRANSACTION_COUNT_LIMIT
const hasQueryParams = transactionSearchParams.getQueryParams().toString().length
const showCsvDownload =
transactionCountWithinRange || (hasQueryParams && results.total > LEDGER_TRANSACTION_COUNT_LIMIT)

return response(req, res, 'simplified-account/transactions/index', {
results,
Expand All @@ -80,6 +86,7 @@ async function get(req: ServiceRequest, res: ServiceResponse) {
cardBrands: [{ value: '', text: 'Any' }, ...cardBrands],
statuses: eventStates,
downloadLink,
showCsvDownload,
})
}

Expand Down
8 changes: 8 additions & 0 deletions src/models/transaction/TransactionDisplayValues.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ export class TransactionDisplayValues {
}

get netAmount(): string {
if (this.isRefund && this.transaction.state.status === Status.SUCCESS) {
return penceToPoundsWithCurrency(-this.transaction.amount)
}

if (this.isDispute && this.transaction.state.status === Status.LOST) {
return penceToPoundsWithCurrency(-this.transaction.netAmount!)
}

return this.transaction.netAmount ? penceToPoundsWithCurrency(this.transaction.netAmount) : ''
}

Expand Down
20 changes: 12 additions & 8 deletions src/views/simplified-account/transactions/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% set fullWidth = true %}

{% block pageTitle %}
Transactions - {{ currentService.name }} {{ currentGatewayAccount.full_type }} - GOV.UK Pay
Transactions - {{ currentService.name }} - GOV.UK Pay
{% endblock %}

{% block beforeContent %}
Expand Down Expand Up @@ -83,13 +83,17 @@
</form>
<hr class="govuk-section-break govuk-section-break--m govuk-section-break--visible" />

{{
govukButton({
text: "Download CSV",
classes: "govuk-button--secondary",
href: downloadLink
})
}}
{% if (showCsvDownload) %}
{{
govukButton({
text: "Download CSV",
classes: "govuk-button--secondary",
href: downloadLink
})
}}
{% elif (results.transactions.length) %}
<p id="csv-download" class="govuk-body">Filter results to download a CSV of transactions</p>
{% endif %}

{% if isBST %}
<details class="govuk-details">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
{{ transaction.cardDetails.cardBrand }}
</td>
<td class="govuk-table__cell govuk-!-font-size-16 state vertical-align-middle">
{{ transaction.formattedStatus }}
{{ transaction._locals.formatted.status }}
</td>
<td
style="text-align: left"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
>
<td class="govuk-table__cell amount govuk-!-font-size-16 vertical-align-middle" id="amount">
{%- if transaction.totalAmount and transaction.corporateCardSurcharge -%}
{{ transaction._locals.formatted.signedAmount }}
{{ transaction._locals.formatted.totalAmount }}
<span class="govuk-!-display-block govuk-!-font-size-16">(with card fee)</span>
{%- else -%}
<span style="white-space: pre">{{ transaction._locals.formatted.amount }}</span>
<span style="white-space: pre">{{ transaction._locals.formatted.signedAmount }}</span>
{%- endif -%}
</td>
<td class="govuk-table__cell govuk-!-font-size-16 brand vertical-align-middle">
Expand Down
Loading
Loading