Skip to content

Commit 4d7bd87

Browse files
fix(sub v3): Improve payment failure experience (#102480)
Removes the duplicate payment failure banner + changes the top banner to use the danger/error motif <img width="1100" height="333" alt="Screenshot 2025-10-31 at 1 42 16 PM" src="https://github.com/user-attachments/assets/ec4cd257-f61d-4a9e-8f2b-9ef7c1206165" />
1 parent 7801dfd commit 4d7bd87

File tree

4 files changed

+12
-67
lines changed

4 files changed

+12
-67
lines changed

static/gsApp/components/gsBanner.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import Cookies from 'js-cookie';
55
import snakeCase from 'lodash/snakeCase';
66
import moment from 'moment-timezone';
77

8+
import {Flex} from '@sentry/scraps/layout';
9+
810
import type {ModalRenderProps} from 'sentry/actionCreators/modal';
911
import {openModal} from 'sentry/actionCreators/modal';
1012
import {fetchOrganizationDetails} from 'sentry/actionCreators/organization';
@@ -16,7 +18,7 @@ import {
1618
} from 'sentry/actionCreators/prompts';
1719
import type {Client} from 'sentry/api';
1820
import {Alert, type AlertProps} from 'sentry/components/core/alert';
19-
import {Badge} from 'sentry/components/core/badge';
21+
import {Tag} from 'sentry/components/core/badge';
2022
import {Button} from 'sentry/components/core/button';
2123
import {ButtonBar} from 'sentry/components/core/button/buttonBar';
2224
import {LinkButton} from 'sentry/components/core/button/linkButton';
@@ -951,9 +953,15 @@ class GSBanner extends Component<Props, State> {
951953

952954
return (
953955
<Alert.Container>
954-
<InvertedAlert
956+
<Alert
957+
system
958+
type="error"
955959
data-test-id="banner-alert-past-due"
956-
trailingItems={<Badge type="warning">{t('Action Required')}</Badge>}
960+
trailingItems={
961+
<Flex align="center" height="100%">
962+
<Tag type="error">{t('Action Required')}</Tag>
963+
</Flex>
964+
}
957965
>
958966
{billingPermissions
959967
? tct(
@@ -984,7 +992,7 @@ class GSBanner extends Component<Props, State> {
984992
),
985993
}
986994
)}
987-
</InvertedAlert>
995+
</Alert>
988996
</Alert.Container>
989997
);
990998
}

static/gsApp/views/subscriptionPage/components/paymentFailureAlert.tsx

Lines changed: 0 additions & 42 deletions
This file was deleted.

static/gsApp/views/subscriptionPage/subscriptionHeader.spec.tsx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -324,25 +324,6 @@ describe('SubscriptionHeader', () => {
324324
});
325325
});
326326

327-
it('renders new payment failure alert for past due subscriptions with flag', async () => {
328-
const organization = OrganizationFixture({
329-
features: ['subscriptions-v3'],
330-
access: ['org:billing'],
331-
});
332-
const subscription = SubscriptionFixture({
333-
organization,
334-
plan: 'am3_team',
335-
isPastDue: true,
336-
});
337-
SubscriptionStore.set(organization.slug, subscription);
338-
render(
339-
<SubscriptionHeader organization={organization} subscription={subscription} />
340-
);
341-
await screen.findByText(
342-
'Automatic payment failed. Update your payment method to ensure uninterrupted access to Sentry.'
343-
);
344-
});
345-
346327
it('does not render new payment failure alert for past due subscriptions without flag', async () => {
347328
const organization = OrganizationFixture({
348329
access: ['org:billing'],

static/gsApp/views/subscriptionPage/subscriptionHeader.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
hasPartnerMigrationFeature,
2727
} from 'getsentry/utils/billing';
2828
import {isDisabledByPartner} from 'getsentry/utils/partnerships';
29-
import PaymentFailureAlert from 'getsentry/views/subscriptionPage/components/paymentFailureAlert';
3029
import PartnershipNote from 'getsentry/views/subscriptionPage/partnershipNote';
3130

3231
import HeaderCards from './headerCards/headerCards';
@@ -268,7 +267,6 @@ function BodyWithBillingPerms({
268267
{subscription.pendingChanges ? (
269268
<DecidePendingChanges subscription={subscription} organization={organization} />
270269
) : null}
271-
<PaymentFailureAlert subscription={subscription} organization={organization} />
272270
<TrialAlert subscription={subscription} organization={organization} />
273271
{hasPartnerMigrationFeature(organization) && (
274272
<PartnerPlanEndingBanner

0 commit comments

Comments
 (0)