@12-apps/payments-frontend 3.32.0 → 3.34.0

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.
@@ -21,25 +21,35 @@
21
21
 
22
22
  /** The method tiles, and what each one promises. */
23
23
  export interface MethodPickerCopy {
24
- /** The group's heading, and its `aria-label` — one string, said once. */
24
+ /**
25
+ * The group's accessible name. Not drawn: the tiles are self-explaining
26
+ * ("Pix", "Cartão") and the heading cost the phone a line above the code
27
+ * (the 2026-10-06 Pix redesign).
28
+ */
25
29
  groupLabel: string;
26
30
  /**
27
- * What each method is CALLED. "PIX" is a Brazilian instrument and keeps its
31
+ * What each method is CALLED. "Pix" is a Brazilian instrument and keeps its
28
32
  * name everywhere, the way "Visa" does; "Cartão" is just the word for card,
29
33
  * and was the tile's label — so both are stated rather than one assumed.
30
34
  */
31
35
  pixLabel: string;
32
36
  cardLabel: string;
33
- /** What each method is like to use — shown under its name. */
37
+ /**
38
+ * What each method is like to use. The checkout's tiles no longer draw it
39
+ * (the 2026-10-06 Pix redesign kept the picker to one line); the flow
40
+ * pipeline's method list (`flows/pipeline/methods.ts`) still says it.
41
+ */
34
42
  pixDescription: string;
35
43
  /**
36
- * PIX's line when the store confirms it by hand (the chain's first PIX
37
- * provider declares `confirmation: 'MANUAL'`). Optional; absent falls back
38
- * to `pixDescription`, so a host enabling such a provider should set it.
44
+ * PIX's line when the store confirms it by hand. Optional; absent falls
45
+ * back to `pixDescription`.
39
46
  */
40
47
  pixManualDescription?: string;
41
48
  cardDescription: string;
42
- /** This store's providers cannot take that method. */
49
+ /**
50
+ * This store's providers cannot take that method: the disabled tile's
51
+ * accessible description, and a caption under the picker.
52
+ */
43
53
  unavailableHere: string;
44
54
  }
45
55
 
@@ -88,16 +98,59 @@ export interface SettlingCopy {
88
98
  checkAgainAction: string;
89
99
  }
90
100
 
101
+ /**
102
+ * The words the after-copy state says (the 2026-10-06 Pix redesign). One shape
103
+ * for both kinds of Pix: the manual one says the STORE confirms, the automatic
104
+ * one that the BANK does — the screen around it is the same.
105
+ */
106
+ export interface PixAfterCopyCopy {
107
+ title: string;
108
+ /**
109
+ * The sentence under the title. `wide` is the desktop layout, whose reader is
110
+ * on a "page" rather than a "screen"; `**…**` marks the bold span.
111
+ */
112
+ body(totalLabel: string, wide: boolean): string;
113
+ /** The three steps: copied (done), pay (current), the confirmation (pending). */
114
+ stepCopied: string;
115
+ stepPay(wide: boolean): string;
116
+ stepConfirm(time: string): string;
117
+ }
118
+
91
119
  /** The PIX pane: the QR, the copyable code, and the wait. */
92
120
  export interface PixPaneCopy {
93
121
  heading: string;
94
- /** What to do with the QR, carrying the order total the buyer is paying. */
95
- instructions(totalLabel: string): string;
96
122
  /** The QR image's alternative text — the only thing a screen reader gets. */
97
123
  qrAlt: string;
124
+ /** The primary copy button. */
98
125
  copyAction: string;
99
- /** The same button for the two seconds after a successful copy. */
126
+ /** Replaces a copy button's label for the two seconds after a successful copy. */
100
127
  copiedAction: string;
128
+ /** The after-copy state's copy-again button. */
129
+ copyAgainAction: string;
130
+ /** The after-copy state's way back to the QR (narrow layout only). */
131
+ showQrAction: string;
132
+ /** The after-copy state's way to the card, when the store takes one. */
133
+ preferCardAction: string;
134
+ /** The after-copy state's poll line. */
135
+ verifying: string;
136
+ /** The narrow layout's tabs: their group name and the two labels. */
137
+ tabsLabel: string;
138
+ copyPasteTab: string;
139
+ qrTab: string;
140
+ /** The wide layout's two column headings and the word between them. */
141
+ qrHeading: string;
142
+ copyPasteHeading: string;
143
+ or: string;
144
+ /** Under the QR in the wide layout; `**…**` marks the bold span. */
145
+ qrInstructions: string;
146
+ /** Under the QR in the narrow layout's QR tab. */
147
+ qrTabCaption: string;
148
+ /** Under the copy button: narrow and wide. `**…**` marks the bold span. */
149
+ copyPasteHint: string;
150
+ internetBankingHint: string;
151
+ /** The wide after-copy state's QR box. */
152
+ notPaidYet: string;
153
+ scanFromPhone: string;
101
154
  /**
102
155
  * How long the code lasts. Takes the already-formatted clock time, and
103
156
  * {@link expiryLocale} is what formatted it.
@@ -113,6 +166,14 @@ export interface PixPaneCopy {
113
166
  awaiting: string;
114
167
  /** The order came back with no PIX charge on it — nothing to show. */
115
168
  chargeMissing: string;
169
+ /**
170
+ * @deprecated Unread since the 2026-10-06 redesign (FUT-3368): the pane's
171
+ * hints replaced the one instructions line. Kept, optional and in its old
172
+ * shape, so an old pack only has to ADD the new keys; remove it from yours.
173
+ */
174
+ instructions?: (totalLabel: string) => string;
175
+ /** After a copy, for a Pix the BANK confirms. */
176
+ afterCopy: PixAfterCopyCopy;
116
177
  /**
117
178
  * The same pane for a Pix the STORE confirms (`PixCharge.confirmation:
118
179
  * 'MANUAL'`). Optional so a host's own table keeps compiling; absent, the
@@ -120,9 +181,14 @@ export interface PixPaneCopy {
120
181
  * enables a store-confirmed provider should set them.
121
182
  */
122
183
  manual?: {
123
- instructions(totalLabel: string): string;
124
184
  validUntil(time: string): string;
125
185
  awaiting: string;
186
+ /** Required: the automatic sentences promise "automática" (FUT-3232). */
187
+ afterCopy: PixAfterCopyCopy;
188
+ /** @deprecated Unread since FUT-3368; see {@link PixPaneCopy.instructions}. */
189
+ instructions?: (totalLabel: string) => string;
190
+ /** @deprecated Unread since FUT-3368: the after-copy screen replaced the notice. */
191
+ copied?: { title: string; description: string };
126
192
  };
127
193
  }
128
194
 
@@ -19,12 +19,12 @@ import type { CheckoutScreensCopy } from './screens-copy';
19
19
  export const EN_US_CHECKOUT_SCREENS_COPY: CheckoutScreensCopy = {
20
20
  method: {
21
21
  groupLabel: 'Payment method',
22
- pixLabel: 'PIX',
22
+ pixLabel: 'Pix',
23
23
  cardLabel: 'Card',
24
24
  pixDescription: 'Approved instantly',
25
25
  pixManualDescription: 'Confirmed by the store',
26
26
  cardDescription: 'Credit, paid in full',
27
- unavailableHere: 'Unavailable in this store',
27
+ unavailableHere: 'Not available at this store',
28
28
  },
29
29
  settling: {
30
30
  cannotConfirm: 'Could not confirm the payment',
@@ -42,21 +42,51 @@ export const EN_US_CHECKOUT_SCREENS_COPY: CheckoutScreensCopy = {
42
42
  checkAgainAction: 'Check again',
43
43
  },
44
44
  pix: {
45
- heading: 'Pay with PIX',
46
- instructions: (totalLabel) =>
47
- `Scan the QR code in your banking app, or copy the code. Total ${totalLabel}.`,
45
+ heading: 'Pay with Pix',
48
46
  qrAlt: 'PIX QR code for payment',
49
- copyAction: 'Copy',
47
+ copyAction: 'Copy code',
50
48
  copiedAction: 'Copied!',
49
+ copyAgainAction: 'Copy again',
50
+ showQrAction: 'Show QR code',
51
+ preferCardAction: 'Rather pay by card?',
52
+ verifying: 'Checking automatically…',
53
+ tabsLabel: 'How to pay the Pix',
54
+ copyPasteTab: 'Copy and paste',
55
+ qrTab: 'QR code',
56
+ qrHeading: 'On your phone',
57
+ copyPasteHeading: 'Pix copy and paste',
58
+ or: 'or',
59
+ qrInstructions: 'Open your banking app on your phone, choose **Pix › Scan QR code** and point it at the screen.',
60
+ qrTabCaption: 'Scan it with the banking app on another phone.',
61
+ copyPasteHint: 'Paste it into your banking app under **Pix copy and paste**.',
62
+ internetBankingHint: 'Paying through internet banking? Paste the code under **Pix copy and paste**.',
63
+ notPaidYet: 'Not paid yet?',
64
+ scanFromPhone: 'Scan it with the banking app on your phone.',
51
65
  validUntil: (time) => `Valid until ${time}. Confirmation is automatic.`,
52
66
  expiryLocale: 'en-US',
53
67
  awaiting: 'Waiting for payment…',
54
68
  chargeMissing: 'Could not generate the PIX code.',
69
+ afterCopy: {
70
+ title: 'Waiting for the payment',
71
+ body: (totalLabel, wide) =>
72
+ `As soon as the bank confirms the payment of ${wide ? `**${totalLabel}**` : totalLabel}, your order shows up here. You can leave this ${wide ? 'page' : 'screen'} open.`,
73
+ stepCopied: 'Pix code copied',
74
+ stepPay: (wide) =>
75
+ wide ? 'Pay in your banking app or internet banking (Pix copy and paste)' : 'Pay in your banking app (Pix copy and paste)',
76
+ stepConfirm: () => 'The bank confirms the payment automatically',
77
+ },
55
78
  manual: {
56
- instructions: (totalLabel) =>
57
- `Pay ${totalLabel} with the QR code or the code below. The store checks it arrived and confirms your order.`,
58
79
  validUntil: (time) => `The store confirms the payment by ${time}.`,
59
- awaiting: 'Waiting for the store to confirm the payment…',
80
+ awaiting: 'Waiting for the store to confirm…',
81
+ afterCopy: {
82
+ title: 'Waiting for the store',
83
+ body: (totalLabel, wide) =>
84
+ `As soon as the store confirms it received ${wide ? `**${totalLabel}**` : totalLabel}, your order shows up here. You can leave this ${wide ? 'page' : 'screen'} open.`,
85
+ stepCopied: 'Pix code copied',
86
+ stepPay: (wide) =>
87
+ wide ? 'Pay in your banking app or internet banking (Pix copy and paste)' : 'Pay in your banking app (Pix copy and paste)',
88
+ stepConfirm: (time) => `The store confirms the payment — by ${time}`,
89
+ },
60
90
  },
61
91
  },
62
92
  card: {
@@ -12,7 +12,7 @@ import type { CheckoutScreensCopy } from './screens-copy';
12
12
  export const PT_BR_CHECKOUT_SCREENS_COPY: CheckoutScreensCopy = {
13
13
  method: {
14
14
  groupLabel: 'Forma de pagamento',
15
- pixLabel: 'PIX',
15
+ pixLabel: 'Pix',
16
16
  cardLabel: 'Cartão',
17
17
  pixDescription: 'Aprovação imediata',
18
18
  pixManualDescription: 'Confirmado pela loja',
@@ -31,21 +31,51 @@ export const PT_BR_CHECKOUT_SCREENS_COPY: CheckoutScreensCopy = {
31
31
  checkAgainAction: 'Verificar de novo',
32
32
  },
33
33
  pix: {
34
- heading: 'Pague com PIX',
35
- instructions: (totalLabel) =>
36
- `Escaneie o QR code no app do seu banco ou copie o código. Total ${totalLabel}.`,
34
+ heading: 'Pague com Pix',
37
35
  qrAlt: 'QR Code PIX para pagamento',
38
- copyAction: 'Copiar',
36
+ copyAction: 'Copiar código',
39
37
  copiedAction: 'Copiado!',
38
+ copyAgainAction: 'Copiar de novo',
39
+ showQrAction: 'Ver QR code',
40
+ preferCardAction: 'Prefere pagar com cartão?',
41
+ verifying: 'Verificando automaticamente…',
42
+ tabsLabel: 'Forma de pagar o Pix',
43
+ copyPasteTab: 'Copia e cola',
44
+ qrTab: 'QR code',
45
+ qrHeading: 'Pelo celular',
46
+ copyPasteHeading: 'Pix Copia e Cola',
47
+ or: 'ou',
48
+ qrInstructions: 'Abra o app do seu banco no celular, escolha **Pix › Ler QR code** e aponte para a tela.',
49
+ qrTabCaption: 'Escaneie com o app do banco em outro celular.',
50
+ copyPasteHint: 'Cole no app do seu banco em **Pix Copia e Cola**.',
51
+ internetBankingHint: 'Pagando pelo internet banking? Cole o código em **Pix Copia e Cola**.',
52
+ notPaidYet: 'Ainda não pagou?',
53
+ scanFromPhone: 'Escaneie com o app do banco no celular.',
40
54
  validUntil: (time) => `Válido até ${time}. A confirmação é automática.`,
41
55
  expiryLocale: 'pt-BR',
42
56
  awaiting: 'Aguardando pagamento…',
43
57
  chargeMissing: 'Não foi possível gerar o código PIX.',
58
+ afterCopy: {
59
+ title: 'Aguardando o pagamento',
60
+ body: (totalLabel, wide) =>
61
+ `Assim que o banco confirmar o pagamento de ${wide ? `**${totalLabel}**` : totalLabel}, seu pedido aparece aqui. Pode deixar esta ${wide ? 'página' : 'tela'} aberta.`,
62
+ stepCopied: 'Código Pix copiado',
63
+ stepPay: (wide) =>
64
+ wide ? 'Pague no app ou no internet banking (Pix Copia e Cola)' : 'Pague no app do seu banco (Pix Copia e Cola)',
65
+ stepConfirm: () => 'O banco confirma o pagamento automaticamente',
66
+ },
44
67
  manual: {
45
- instructions: (totalLabel) =>
46
- `Pague ${totalLabel} com o QR code ou o código abaixo. A loja confere o recebimento e confirma o seu pedido.`,
47
68
  validUntil: (time) => `A loja confirma o pagamento até ${time}.`,
48
- awaiting: 'Aguardando confirmação do pagamento pela loja…',
69
+ awaiting: 'Aguardando confirmação da loja…',
70
+ afterCopy: {
71
+ title: 'Aguardando a loja',
72
+ body: (totalLabel, wide) =>
73
+ `Assim que a loja confirmar o recebimento de ${wide ? `**${totalLabel}**` : totalLabel}, seu pedido aparece aqui. Pode deixar esta ${wide ? 'página' : 'tela'} aberta.`,
74
+ stepCopied: 'Código Pix copiado',
75
+ stepPay: (wide) =>
76
+ wide ? 'Pague no app ou no internet banking (Pix Copia e Cola)' : 'Pague no app do seu banco (Pix Copia e Cola)',
77
+ stepConfirm: (time) => `A loja confirma o pagamento — até ${time}`,
78
+ },
49
79
  },
50
80
  },
51
81
  card: {
package/src/index.ts CHANGED
@@ -125,6 +125,7 @@ export type {
125
125
  MethodPickerCopy,
126
126
  PayerSummaryCopy,
127
127
  PaymentErrorCopy,
128
+ PixAfterCopyCopy,
128
129
  PixPaneCopy,
129
130
  SettlingCopy,
130
131
  WalletCopy,