@12-apps/payments-frontend 3.45.0 → 3.45.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@12-apps/payments-frontend",
3
- "version": "3.45.0",
3
+ "version": "3.45.1",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Browser half of the vendor-agnostic payments platform: plug-and-play MUI components for the per-provider settings page (credential form from each provider's schema, masked hints, verify/enable) and the checkout page (PIX QR + polling, card tokenization, hosted-checkout redirect), plus the headless hooks and fetch clients they build on. Talks only to the host's payments HTTP surface — never to a provider directly. Microfrontend-ready: no app coupling, host injects theme and auth.",
@@ -23,7 +23,7 @@
23
23
  "storybook:build": "storybook build"
24
24
  },
25
25
  "dependencies": {
26
- "@12-apps/payments-backend": "^4.34.0",
26
+ "@12-apps/payments-backend": "^4.36.1",
27
27
  "react-qr-code": "^2.2.0"
28
28
  },
29
29
  "peerDependencies": {
@@ -197,9 +197,12 @@ export function actionLabel(
197
197
  choice: CheckoutListChoice | null,
198
198
  door: CheckoutDoorOption | undefined,
199
199
  provider: string | null,
200
+ covered = false,
200
201
  ): string {
201
202
  if (!choice) return copy.actions.choose;
202
203
  if (choice.kind === "door") return door?.action ?? copy.actions.choose;
204
+ // A handoff leaves the store for a provider even at zero: it keeps its own verb.
205
+ if (covered && choice.method !== "HAND_OFF") return copy.actions.covered;
203
206
  const verbs: Record<CheckoutOnlineChoice, string> = {
204
207
  PIX: copy.actions.pix,
205
208
  CARD: copy.actions.card,
@@ -50,6 +50,7 @@ export const EN_US_PAYMENT_LIST_COPY: PaymentListCopy = {
50
50
  card: "Pay",
51
51
  pix: "Create Pix",
52
52
  googlePay: "Pay with Google Pay",
53
+ covered: "Pay with balance",
53
54
  handOff: (provider) => (provider ? `Go to ${provider}` : "Go to payment"),
54
55
  },
55
56
  payer: (name) => `Paying as ${name} · CPF ✓`,
@@ -173,7 +173,7 @@ function buttonFacts(props: ListFaceProps): { label: string; total: string; busy
173
173
  const door = chosenDoor(props);
174
174
  const online = state.choice?.kind === "online";
175
175
  return {
176
- label: list.hold ? list.hold.action : pixBankLabel(list, state) ?? actionLabel(list.copy, state.choice, door, props.provider),
176
+ label: list.hold ? list.hold.action : pixBankLabel(list, state) ?? actionLabel(list.copy, state.choice, door, props.provider, coveredByHost(list)),
177
177
  total: door ? (door.totalLabel ?? props.total) : online ? onlineTotal(props) : props.total,
178
178
  busy: inFlight(props),
179
179
  };
@@ -66,6 +66,7 @@ export const PT_BR_PAYMENT_LIST_COPY: PaymentListCopy = {
66
66
  card: "Pagar",
67
67
  pix: "Gerar Pix",
68
68
  googlePay: "Pagar com Google Pay",
69
+ covered: "Pagar com saldo",
69
70
  handOff: (provider) => (provider ? `Ir para ${the(provider)}` : "Ir para o pagamento"),
70
71
  },
71
72
  payer: (name) => `Pagando como ${name} · CPF ✓`,
@@ -354,6 +354,8 @@ export interface PaymentListCopy {
354
354
  card: string;
355
355
  pix: string;
356
356
  googlePay: string;
357
+ /** The bar's verb when the host's balance pays the whole amount. */
358
+ covered: string;
357
359
  handOff: (provider: string | null) => string;
358
360
  };
359
361
  /** "Pagando como Ana Teste · CPF ✓". */