Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions packages/manager/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## [2025-07-21] - v1.146.2

### Fixed:

- Resort to payment id for edit billing flow ([#12544](https://github.com/linode/manager/pull/12544))

## [2025-07-16] - v1.146.1


Expand Down
2 changes: 1 addition & 1 deletion packages/manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "linode-manager",
"author": "Linode",
"description": "The Linode Manager website",
"version": "1.146.1",
"version": "1.146.2",
"private": true,
"type": "module",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,17 +243,7 @@ describe('Payment Method Row', () => {

expect(navigate).toHaveBeenCalledWith({
search: {
paymentMethod: {
created: '2021-05-21T14:27:51',
data: {
card_type: 'Visa',
expiry: '12/2022',
last_four: '1881',
},
id: 9,
is_default: false,
type: 'credit_card',
},
paymentMethodId: 9,
},
to: '/account/billing/make-payment',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ export const PaymentMethodRow = (props: Props) => {
onClick: () => {
navigate({
to: '/account/billing/make-payment',
search: { paymentMethod },
search: {
paymentMethodId: paymentMethod.id,
},
});
},
title: 'Make a Payment',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ export const BillingSummary = (props: BillingSummaryProps) => {

const navigate = useNavigate();
const match = useMatch({ strict: false });
const { paymentMethod } = useSearch({
const search = useSearch({
strict: false,
});

const { paymentMethodId } = search;

const routeForMakePayment = '/account/billing/make-payment';
const makePaymentRouteMatch = match?.routeId === routeForMakePayment;

Expand Down Expand Up @@ -91,13 +93,17 @@ export const BillingSummary = (props: BillingSummaryProps) => {
return;
}

const selectedPaymentMethod =
paymentMethod ??
paymentMethods?.find((payment) => payment.is_default) ??
undefined;
const selectedPaymentMethod = paymentMethodId
? paymentMethods?.find((payment) => payment.id === paymentMethodId)
: (paymentMethods?.find((payment) => payment.is_default) ?? undefined);

openPaymentDrawer(selectedPaymentMethod);
}, [paymentMethods, openPaymentDrawer, makePaymentRouteMatch, paymentMethod]);
}, [
paymentMethods,
openPaymentDrawer,
makePaymentRouteMatch,
paymentMethodId,
]);

//
// Account Balance logic
Expand Down
4 changes: 1 addition & 3 deletions packages/manager/src/routes/account/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ import { createRoute, redirect } from '@tanstack/react-router';
import { rootRoute } from '../root';
import { AccountRoute } from './AccountRoute';

import type { PaymentMethod } from '@linode/api-v4';

interface AccountBillingSearch {
contactDrawerOpen?: boolean;
focusEmail?: boolean;
}

interface AccountBillingMakePaymentSearch {
paymentMethod?: PaymentMethod;
paymentMethodId?: number;
}

const accountRoute = createRoute({
Expand Down