@12-apps/payments-frontend 3.46.0 → 3.46.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 +1 -1
- package/src/components/checkout/list/bank-en-US.ts +1 -0
- package/src/components/checkout/list/bank-pt-BR.ts +1 -0
- package/src/components/checkout/list/list-pix.tsx +1 -1
- package/src/components/checkout/list/pix-banks.tsx +18 -2
- package/src/components/checkout/list/types.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@12-apps/payments-frontend",
|
|
3
|
-
"version": "3.46.
|
|
3
|
+
"version": "3.46.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.",
|
|
@@ -20,6 +20,7 @@ export const EN_US_PIX_BANK_COPY: PixBankCopy = {
|
|
|
20
20
|
other: "Another bank",
|
|
21
21
|
notOpened: (bank) => `We couldn't open ${bank.name}. Is the app installed on this phone?`,
|
|
22
22
|
retry: "Try again",
|
|
23
|
+
appHint: "Open your bank's app and paste the code in Pix copy and paste.",
|
|
23
24
|
copied: "Pix code copied",
|
|
24
25
|
copiedPick: "Pix code copied. Choose your bank.",
|
|
25
26
|
copiedOpening: (bank) => `Pix code copied. Opening ${bank.name}…`,
|
|
@@ -20,6 +20,7 @@ export const PT_BR_PIX_BANK_COPY: PixBankCopy = {
|
|
|
20
20
|
other: "Outro banco",
|
|
21
21
|
notOpened: (bank) => `Não conseguimos abrir ${bank.the}${bank.name}. O app está instalado neste celular?`,
|
|
22
22
|
retry: "Tentar de novo",
|
|
23
|
+
appHint: "Abra o app do seu banco e cole em Pix copia e cola.",
|
|
23
24
|
copied: "Código Pix copiado",
|
|
24
25
|
copiedPick: "Código Pix copiado. Escolha o banco.",
|
|
25
26
|
copiedOpening: (bank) => `Código Pix copiado. Abrindo ${bank.the}${bank.name}…`,
|
|
@@ -311,7 +311,7 @@ export function ListPixFace(props: ListPixFaceProps & { mode: PaymentListMode })
|
|
|
311
311
|
// On a phone the bank flow takes the copy: "Copiar e abrir o Nubank", the
|
|
312
312
|
// toast, the app. Without it — or on a computer — the copy is today's.
|
|
313
313
|
const onCopy = flow ? copies.copy : props.onCopy;
|
|
314
|
-
const banks = flow?.os ? { node: <PixBanks bank={flow.bank} state={flow.state} stale={stale} />, replacesChecklist:
|
|
314
|
+
const banks = flow?.os ? { node: <PixBanks bank={flow.bank} state={flow.state} stale={stale} />, replacesChecklist: true } : undefined;
|
|
315
315
|
return (
|
|
316
316
|
<Box data-testid="list-pix" sx={{ display: "flex", flexDirection: "column", gap: 1.5 }}>
|
|
317
317
|
<Text variant="body" size="md" weight="bold" as="p" style={{ margin: 0 }} data-testid="list-pix-title">
|
|
@@ -172,7 +172,23 @@ function Grid({ bank, state, stale }: { bank: CheckoutPixBank; state: PixBankSta
|
|
|
172
172
|
);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
/** The
|
|
175
|
+
/** The one line under the bank being opened, where the checklist was (FUT-3612). */
|
|
176
|
+
function AppHint({ text }: { text: string }): JSX.Element {
|
|
177
|
+
const { Text } = useCheckoutComponents();
|
|
178
|
+
return (
|
|
179
|
+
<Text variant="body" size="sm" color="secondary" as="p" style={{ margin: 0 }} data-testid="pix-bank-hint">
|
|
180
|
+
{text}
|
|
181
|
+
</Text>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** The grid, or the bank being opened and the line that says what to do there. */
|
|
176
186
|
export function PixBanks({ bank, state, stale }: { bank: CheckoutPixBank; state: PixBankState; stale: boolean }): JSX.Element {
|
|
177
|
-
|
|
187
|
+
if (!state.chosen) return <Grid bank={bank} state={state} stale={stale} />;
|
|
188
|
+
return (
|
|
189
|
+
<Box sx={{ display: "flex", flexDirection: "column", gap: 1 }}>
|
|
190
|
+
<Opening bank={bank} state={state} chosen={state.chosen} />
|
|
191
|
+
{bank.copy.appHint ? <AppHint text={bank.copy.appHint} /> : null}
|
|
192
|
+
</Box>
|
|
193
|
+
);
|
|
178
194
|
}
|
|
@@ -270,6 +270,11 @@ export interface PixBankCopy {
|
|
|
270
270
|
notOpened: (bank: PixBankName) => string;
|
|
271
271
|
/** "Tentar de novo". */
|
|
272
272
|
retry: string;
|
|
273
|
+
/**
|
|
274
|
+
* The one line under the bank being opened, in place of the checklist —
|
|
275
|
+
* "Abra o app do seu banco e cole em Pix copia e cola." Absent ⇒ no line.
|
|
276
|
+
*/
|
|
277
|
+
appHint?: string;
|
|
273
278
|
/** The toasts. */
|
|
274
279
|
copied: string;
|
|
275
280
|
copiedPick: string;
|