Skip to content

Commit

Permalink
PP-13030: Don't show Worldpay create service button (#1852)
Browse files Browse the repository at this point in the history
Don't show this button if service has a Stripe gateway account.
  • Loading branch information
oswaldquek authored Oct 14, 2024
1 parent d638dae commit 132982e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
14 changes: 7 additions & 7 deletions scripts/generate-dev-environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ const fs = require('fs')

const ENV_FILE = '.env'

const LOCAL_URL_MAP =`ADMINUSERS_URL=http://localhost:9700
CONNECTOR_URL=http://localhost:9300
PRODUCTS_URL=http://localhost:18000
PUBLIC_AUTH_URL=http://localhost:9600
LEDGER_URL=http://localhost:10700
WEBHOOKS_URL=http://localhost:10800
SELFSERVICE_URL=http://localhost:9400`
const LOCAL_URL_MAP =`ADMINUSERS_URL=http://127.0.0.1:9700
CONNECTOR_URL=http://127.0.0.1:9300
PRODUCTS_URL=http://127.0.0.1:18000
PUBLIC_AUTH_URL=http://127.0.0.1:9600
LEDGER_URL=http://127.0.0.1:10700
WEBHOOKS_URL=http://127.0.0.1:10800
SELFSERVICE_URL=http://127.0.0.1:9400`

const TUNNEL_URL_MAP =`ADMINUSERS_URL=https://localhost:9001
CONNECTOR_URL=https://localhost:9003
Expand Down
2 changes: 1 addition & 1 deletion src/web/modules/services/detail.njk
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
</div>
{% endif %}

{% if not isWorldpayTestService %}
{% if not isWorldpayTestService and not hasStripeTestAccount %}
<div>
<h2 class="govuk-heading-m">Create Worldpay test service</h2>
<p class="govuk-body">Spin off a separate service that will contain a Worldpay test account.</p>
Expand Down
5 changes: 2 additions & 3 deletions src/web/modules/services/services.http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import {IOValidationError, ValidationError as CustomValidationError} from '../..
import {formatServiceExportCsv} from './serviceExportCsv'
import {BooleanFilterOption} from '../common/BooleanFilterOption'
import {ServiceFilters, fetchAndFilterServices, getLiveNotArchivedServices} from './getFilteredServices'
import AddTestAccountFormRequest from "./AddTestAccountForm";
import {liveStatus} from "../../../lib/liveStatus";
import {GoLiveStage} from "../../../lib/pay-request/services/admin_users/types";
import {providers} from "../../../lib/providers";
import {CreateGatewayAccountRequest} from "../../../lib/pay-request/services/connector/types";
Expand Down Expand Up @@ -113,7 +111,8 @@ export async function detail(req: Request, res: Response, next: NextFunction): P
adminEmails,
showWorldpayTestServiceCreatedSuccess: req.flash('worldpayTestService')[0] === 'success',
isWorldpayTestService: serviceGatewayAccounts.length === 1 && serviceGatewayAccounts[0].type === 'test' &&
serviceGatewayAccounts[0].payment_provider.toUpperCase() === 'WORLDPAY'
serviceGatewayAccounts[0].payment_provider.toUpperCase() === 'WORLDPAY',
hasStripeTestAccount: serviceGatewayAccounts.some(item => item.payment_provider === 'stripe')
})
} catch (error) {
next(error)
Expand Down

0 comments on commit 132982e

Please sign in to comment.