diff --git a/apps/billing-web/src/checkout/payVerdict.test.ts b/apps/billing-web/src/checkout/payVerdict.test.ts index e3b3eba3185..b33e1f9e59c 100644 --- a/apps/billing-web/src/checkout/payVerdict.test.ts +++ b/apps/billing-web/src/checkout/payVerdict.test.ts @@ -124,7 +124,7 @@ describe('payVerdictOf', () => { }, { name: 'a stale subscription quote', - result: refusedWith('REQUEST_FAILED', 'SUBSCRIPTION_QUOTE_STALE'), + result: { status: 'error', code: 'QUOTE_STALE' }, expected: { kind: 'requote', because: 'quote_expired' } }, { diff --git a/apps/billing-web/src/checkout/payVerdict.ts b/apps/billing-web/src/checkout/payVerdict.ts index 85565b866b4..909b7f470f8 100644 --- a/apps/billing-web/src/checkout/payVerdict.ts +++ b/apps/billing-web/src/checkout/payVerdict.ts @@ -12,10 +12,7 @@ import { import type { InlineOutcome, OperationOutcome } from '@/checkout/checkoutPage' /** The server refused the quote the customer consented to; re-price before asking again. */ -const STALE_QUOTE_SERVER_CODES = [ - 'PRORATION_QUOTE_EXPIRED', - 'SUBSCRIPTION_QUOTE_STALE' -] as const +const STALE_QUOTE_SERVER_CODES = ['PRORATION_QUOTE_EXPIRED'] as const /** * What a Pay's result asks of the page. `settled` needs nothing from @@ -39,6 +36,8 @@ export function payVerdictOf(result: SubscriptionCommandResult): PayVerdict { ) return { kind: 'requote', because: 'quote_expired' } switch (result.code) { + case 'QUOTE_STALE': + return { kind: 'requote', because: 'quote_expired' } case 'REACTIVATION_CONFIRMATION_REQUIRED': return { kind: 'requote', because: 'reactivation_required' } case 'OPERATION_ALREADY_PENDING': diff --git a/apps/billing-web/src/views/FullPageCheckoutView.test.ts b/apps/billing-web/src/views/FullPageCheckoutView.test.ts index 2c8615542d4..da75d1ee4b5 100644 --- a/apps/billing-web/src/views/FullPageCheckoutView.test.ts +++ b/apps/billing-web/src/views/FullPageCheckoutView.test.ts @@ -2169,14 +2169,7 @@ describe('FullPageCheckoutView promo codes', () => { it('a code that lapsed before Pay: back to capture, chip gone, the expired card instead of a decline', async () => { const fake = await renderCheckout( { - subscribe: { - status: 'error', - code: 'REQUEST_FAILED', - serverCode: readBillingErrorCode({ - code: 'SUBSCRIPTION_QUOTE_STALE', - message: 'stale' - }) - } + subscribe: { status: 'error', code: 'QUOTE_STALE' } }, quotesByCode )