@vtex/faststore-plugin-buyer-portal 1.3.80 → 1.3.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.3.82] - 2026-04-29
11
+
12
+ ### Changed
13
+
14
+ - Updates the Buyer Organization Agent from `b2b-agent` to `buyer-organization-manager`
15
+
16
+ ## [1.3.81] - 2026-04-29
17
+
18
+ ### Changed
19
+
20
+ - Switch payment methods route/api integration to `payment-groups` and support string-based ids in the add/remove flow (`B2BTEAM-3238`)
21
+ - Register the page in `plugin.config.js` as `payment-groups` with path `/pvt/organization-account/payment-groups/[orgUnitId]/[contractId]` so it matches `buyerPortalRoutes` and resolves navigation 404s. Bookmarks or deep links using the previous `/pvt/organization-account/payment-methods/...` path are no longer served by this plugin (`B2BTEAM-3238`)
22
+
10
23
  ## [1.3.80] - 2026-04-29
11
24
 
12
25
  ### Fixed
@@ -597,7 +610,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
597
610
  - Add CHANGELOG file
598
611
  - Add README file
599
612
 
600
- [unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.80...HEAD
613
+ [unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.82...HEAD
601
614
  [1.3.55]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.54...v1.3.55
602
615
  [1.3.54]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.53...v1.3.54
603
616
  [1.3.53]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.52...v1.3.53
@@ -665,6 +678,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
665
678
  [1.3.65]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.64...v1.3.65
666
679
  [1.3.64]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.3.64
667
680
  [1.3.69]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.3.69
681
+ [1.3.82]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.81...v1.3.82
682
+ [1.3.81]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.80...v1.3.81
668
683
  [1.3.80]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.79...v1.3.80
669
684
  [1.3.79]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.78...v1.3.79
670
685
  [1.3.78]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.77...v1.3.78
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtex/faststore-plugin-buyer-portal",
3
- "version": "1.3.80",
3
+ "version": "1.3.82",
4
4
  "description": "A plugin for faststore with buyer portal",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/plugin.config.js CHANGED
@@ -28,8 +28,8 @@ module.exports = {
28
28
  path: "/pvt/organization-account/budgets/[orgUnitId]/[contractId]/[budgetId]",
29
29
  appLayout: false,
30
30
  },
31
- "payment-methods": {
32
- path: "/pvt/organization-account/payment-methods/[orgUnitId]/[contractId]",
31
+ "payment-groups": {
32
+ path: "/pvt/organization-account/payment-groups/[orgUnitId]/[contractId]",
33
33
  appLayout: false,
34
34
  },
35
35
  "credit-cards": {
@@ -88,8 +88,8 @@ module.exports = {
88
88
  path: "/pvt/organization-account/org-unit/[orgUnitId]",
89
89
  appLayout: false,
90
90
  },
91
- "b2b-agent": {
92
- path: "/pvt/organization-account/b2b-agent",
91
+ "buyer-organization-manager": {
92
+ path: "/pvt/organization-account/buyer-organization-manager",
93
93
  appLayout: false,
94
94
  },
95
95
  },
@@ -2,6 +2,7 @@ import { Client } from "../../shared/clients/Client";
2
2
  import { getApiUrl } from "../../shared/utils";
3
3
 
4
4
  import type {
5
+ PaymentMethodId,
5
6
  PaymentMethodResponse,
6
7
  PaymentMethodsIdArray,
7
8
  PaymentMethodsReqCommonParams,
@@ -39,7 +40,7 @@ export default class PaymentMethodsClient extends Client {
39
40
  }
40
41
 
41
42
  const queryString = queryParams.toString();
42
- const url = `customers/${customerId}/units/${unitId}/payment-methods/paginated${
43
+ const url = `customers/${customerId}/units/${unitId}/payment-groups/paginated${
43
44
  queryString ? `?${queryString}` : ""
44
45
  }`;
45
46
 
@@ -58,7 +59,7 @@ export default class PaymentMethodsClient extends Client {
58
59
  const { customerId, unitId, cookie, paymentMethodsIds } = data;
59
60
 
60
61
  return await this.post<PaymentMethodResponse, PaymentMethodsIdArray>(
61
- `customers/${customerId}/units/${unitId}/payment-methods`,
62
+ `customers/${customerId}/units/${unitId}/payment-groups`,
62
63
  paymentMethodsIds,
63
64
  {
64
65
  headers: {
@@ -71,13 +72,13 @@ export default class PaymentMethodsClient extends Client {
71
72
 
72
73
  async removePaymentMethodFromUnit(
73
74
  data: PaymentMethodsReqCommonParams & {
74
- paymentMethodId: number;
75
+ paymentMethodId: PaymentMethodId;
75
76
  }
76
77
  ) {
77
78
  const { customerId, unitId, cookie, paymentMethodId } = data;
78
79
 
79
80
  return await this.delete(
80
- `customers/${customerId}/units/${unitId}/payment-methods/${paymentMethodId}`,
81
+ `customers/${customerId}/units/${unitId}/payment-groups/${paymentMethodId}`,
81
82
  null,
82
83
  {
83
84
  headers: {
@@ -19,6 +19,7 @@ import { useAddPaymentMethodsToUnit } from "../../hooks";
19
19
  import { useDebouncedSearchPaymentMethods } from "../../hooks/useDebouncedSearchPaymentMethods";
20
20
 
21
21
  import type { TableColumn } from "../../../shared/components/Table/TableHead/TableHead";
22
+ import type { PaymentMethodId } from "../../../shared/types";
22
23
 
23
24
  export type AddPaymentMethodsDrawerProps = Omit<
24
25
  BasicDrawerProps,
@@ -35,7 +36,7 @@ export const AddPaymentMethodsDrawer = ({
35
36
  const [querySearch, setQuerySearch] = useState("");
36
37
  const [drawerPage, setDrawerPage] = useState(1);
37
38
  const [isLastPage, setIsLastPage] = useState(true);
38
- const [selectedMethods, setSelectedMethods] = useState<Set<number>>(
39
+ const [selectedMethods, setSelectedMethods] = useState<Set<PaymentMethodId>>(
39
40
  new Set()
40
41
  );
41
42
 
@@ -116,7 +117,7 @@ export const AddPaymentMethodsDrawer = ({
116
117
  }
117
118
  }, [someSelected]);
118
119
 
119
- const toggleItem = useCallback((id: number) => {
120
+ const toggleItem = useCallback((id: PaymentMethodId) => {
120
121
  setSelectedMethods((prev) => {
121
122
  const next = new Set(prev);
122
123
  if (next.has(id)) next.delete(id);
@@ -2,6 +2,7 @@ import { type BasicDrawerProps, BasicDrawer } from "../../../shared/components";
2
2
  import { useBuyerPortal } from "../../../shared/hooks";
3
3
  import { useRemovePaymentMethod } from "../../hooks/useRemovePaymentMethodSubmit";
4
4
 
5
+ import type { PaymentMethodId } from "../../../shared/types";
5
6
  import type { PaymentMethodData } from "../../types";
6
7
 
7
8
  export type RemovePaymentMethodsDrawerProps = Omit<
@@ -27,7 +28,7 @@ export const RemovePaymentMethodsDrawer = ({
27
28
  const { remove, isRemovingPaymentMethod } =
28
29
  useRemovePaymentMethod(handleSuccess);
29
30
 
30
- const handleSubmit = (paymentMethodId: number) => {
31
+ const handleSubmit = (paymentMethodId: PaymentMethodId) => {
31
32
  remove(paymentMethodId);
32
33
  };
33
34
 
@@ -7,6 +7,7 @@ import { CHANGES_TIMEOUT_MESSAGE } from "../../shared/utils/constants";
7
7
 
8
8
  import { useRemovePaymentMethodFromUnit } from "./useRemovePaymentMethodsFromUnit";
9
9
 
10
+ import type { PaymentMethodId } from "../../shared/types";
10
11
  import type { PaymentMethodData } from "../types";
11
12
 
12
13
  export function useRemovePaymentMethod(onAfterSuccess?: () => void) {
@@ -38,12 +39,14 @@ export function useRemovePaymentMethod(onAfterSuccess?: () => void) {
38
39
  },
39
40
  });
40
41
 
41
- const remove = (paymentMethod: PaymentMethodData | number) => {
42
+ const remove = (paymentMethod: PaymentMethodData | PaymentMethodId) => {
42
43
  removePaymentMethod({
43
44
  customerId,
44
45
  unitId,
45
46
  paymentMethodId:
46
- typeof paymentMethod === "number" ? paymentMethod : paymentMethod?.id,
47
+ typeof paymentMethod === "number" || typeof paymentMethod === "string"
48
+ ? paymentMethod
49
+ : paymentMethod?.id,
47
50
  });
48
51
  };
49
52
 
@@ -1,9 +1,11 @@
1
1
  import { paymentMethodsClient } from "../clients/PaymentMethodsClient";
2
2
 
3
+ import type { PaymentMethodId } from "../../shared/types";
4
+
3
5
  export type RemovePaymentMethodFromUnitServiceProps = {
4
6
  customerId: string;
5
7
  unitId: string;
6
- paymentMethodId: number;
8
+ paymentMethodId: PaymentMethodId;
7
9
  cookie: string;
8
10
  };
9
11
 
@@ -1,7 +1,9 @@
1
1
  import { PageControl } from "../../product-assortment/types";
2
2
 
3
+ import type { PaymentMethodId } from "../../shared/types";
4
+
3
5
  export type PaymentMethodData = {
4
- id: number;
6
+ id: PaymentMethodId;
5
7
  name: string;
6
8
  isEnabled?: boolean;
7
9
  };
@@ -1,4 +1,5 @@
1
- export type PaymentMethodsIdArray = Array<{ id: number }>;
1
+ export type PaymentMethodId = string | number;
2
+ export type PaymentMethodsIdArray = Array<{ id: PaymentMethodId }>;
2
3
 
3
4
  export type PaymentMethodResponse = {
4
5
  message: string;
@@ -4,6 +4,7 @@ export type { CurrencyType, LocaleType } from "./CurrencyType";
4
4
  export type { LoaderData } from "./LoaderData";
5
5
  export type { IPagination } from "./Pagination";
6
6
  export type {
7
+ PaymentMethodId,
7
8
  PaymentMethodResponse,
8
9
  PaymentMethodsIdArray,
9
10
  PaymentMethodsReqCommonParams,
@@ -15,7 +15,7 @@ export const buyerPortalRoutes = {
15
15
  profileDetails: (params: { orgUnitId: string; contractId: string }) =>
16
16
  replaceParams(`${base}/profile/[orgUnitId]/[contractId]`, params),
17
17
 
18
- b2bAgent: `${base}/b2b-agent`,
18
+ b2bAgent: `${base}/buyer-organization-manager`,
19
19
 
20
20
  addresses: (params: { orgUnitId: string; contractId: string }) =>
21
21
  replaceParams(`${base}/addresses/[orgUnitId]/[contractId]`, params),
@@ -42,7 +42,7 @@ export const buyerPortalRoutes = {
42
42
  ),
43
43
 
44
44
  paymentMethods: (params: { orgUnitId: string; contractId: string }) =>
45
- replaceParams(`${base}/payment-methods/[orgUnitId]/[contractId]`, params),
45
+ replaceParams(`${base}/payment-groups/[orgUnitId]/[contractId]`, params),
46
46
 
47
47
  creditCards: (params: { orgUnitId: string; contractId: string }) =>
48
48
  replaceParams(`${base}/credit-cards/[orgUnitId]/[contractId]`, params),
@@ -22,7 +22,7 @@ export const SCOPE_KEYS = {
22
22
  CREDIT_CARDS: "creditCards",
23
23
  } as const;
24
24
 
25
- export const CURRENT_VERSION = "1.3.80";
25
+ export const CURRENT_VERSION = "1.3.82";
26
26
 
27
27
  export const CHANGES_TIMEOUT_MESSAGE =
28
28
  "Changes may take up to 10 minutes to apply.";
@@ -27,7 +27,7 @@ export const ROUTE_TABS_LAYOUT_MAPPING: Record<string, RouteTabsLayoutConfig> =
27
27
  pageName: "Contract",
28
28
  pageTitle: "Address Details",
29
29
  },
30
- "/pvt/organization-account/payment-methods/[orgUnitId]/[contractId]": {
30
+ "/pvt/organization-account/payment-groups/[orgUnitId]/[contractId]": {
31
31
  layout: "ContractTabsLayout",
32
32
  pageName: "Contract",
33
33
  pageTitle: "Payment Methods",