@12-apps/payments-frontend 3.47.1 → 3.47.2
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.47.
|
|
3
|
+
"version": "3.47.2",
|
|
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.",
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
type GooglePaymentData,
|
|
26
26
|
type GooglePaymentsClient,
|
|
27
27
|
} from '../checkout/google-pay-button';
|
|
28
|
-
import type { HomologacaoEvidenceWalletsCopy } from './copy';
|
|
28
|
+
import type { AppleAbsence, HomologacaoEvidenceWalletsCopy } from './copy';
|
|
29
29
|
import { usePlatformCopy } from './copy-context';
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -171,9 +171,10 @@ function notOffered(wallet: EvidenceWallet, input: EvidenceWalletsInput, googleR
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
/** Why Apple Pay has no button on a screen whose host carries wallets — null when it has one, or no wallets at all. */
|
|
174
|
-
function appleAbsence(input: EvidenceWalletsInput, offered: boolean):
|
|
174
|
+
function appleAbsence(input: EvidenceWalletsInput, offered: boolean): AppleAbsence | null {
|
|
175
175
|
if (offered || !input.config) return null;
|
|
176
|
-
|
|
176
|
+
const failure = notOffered('APPLE_PAY', input, false)?.failure;
|
|
177
|
+
return failure === 'NOT_CONFIGURED' || failure === 'NOT_AVAILABLE' || failure === 'MERCHANT_VALIDATION_FAILED' ? failure : null;
|
|
177
178
|
}
|
|
178
179
|
|
|
179
180
|
/** The wallet step's state: the sheets' answers, the presses that open them, and what phase 2 gets. */
|
|
@@ -216,7 +217,7 @@ function GooglePayMount({ client, onPress, locale }: { client: GooglePaymentsCli
|
|
|
216
217
|
element.replaceChildren(client.createButton({ onClick: () => latest.current(), buttonSizeMode: 'fill', buttonLocale: locale }));
|
|
217
218
|
return () => element.replaceChildren();
|
|
218
219
|
}, [client, locale]);
|
|
219
|
-
return <Box ref={mount} data-testid="evidence-google-pay" sx={{ minHeight: 40, width: 240, '& > *': { width: '100%' } }} />;
|
|
220
|
+
return <Box ref={mount} data-testid="evidence-google-pay" sx={{ minHeight: 40, width: { xs: '100%', sm: 240 }, '& > *': { width: '100%' } }} />;
|
|
220
221
|
}
|
|
221
222
|
|
|
222
223
|
/** Apple's button: Safari draws it (`-apple-pay-button`); elsewhere the name on a black pill. */
|
|
@@ -231,7 +232,7 @@ function ApplePayPress({ label, onPress }: { label: string; onPress: () => void
|
|
|
231
232
|
sx={{
|
|
232
233
|
WebkitAppearance: '-apple-pay-button',
|
|
233
234
|
height: 40,
|
|
234
|
-
width: 240,
|
|
235
|
+
width: { xs: '100%', sm: 240 },
|
|
235
236
|
border: 0,
|
|
236
237
|
borderRadius: 1,
|
|
237
238
|
cursor: 'pointer',
|
|
@@ -270,20 +271,22 @@ export function EvidenceWalletBlock({ wallets }: { wallets: EvidenceWallets }):
|
|
|
270
271
|
return result ? [result] : [];
|
|
271
272
|
});
|
|
272
273
|
return (
|
|
273
|
-
<Stack spacing={1} data-testid="evidence-wallets">
|
|
274
|
+
<Stack spacing={1} data-testid="evidence-wallets" sx={{ maxWidth: '72ch' }}>
|
|
274
275
|
<Typography variant="body2" fontWeight={600}>
|
|
275
276
|
{copy.heading}
|
|
276
277
|
</Typography>
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
278
|
+
{wallets.google || wallets.apple ? (
|
|
279
|
+
<Typography variant="caption" component="p" color="text.secondary">
|
|
280
|
+
{copy.hint}
|
|
281
|
+
</Typography>
|
|
282
|
+
) : null}
|
|
280
283
|
<Stack direction={{ xs: 'column', sm: 'row' }} spacing={1}>
|
|
281
284
|
{wallets.google ? (
|
|
282
285
|
<GooglePayMount client={wallets.google.client} onPress={wallets.google.press} locale={copy.googlePayButtonLocale} />
|
|
283
286
|
) : null}
|
|
284
287
|
{wallets.apple ? <ApplePayPress label={copy.applePayButton} onPress={wallets.apple.press} /> : null}
|
|
285
288
|
</Stack>
|
|
286
|
-
{wallets.appleAbsent
|
|
289
|
+
{wallets.appleAbsent ? (
|
|
287
290
|
<Typography variant="caption" component="p" color="text.secondary" data-testid="evidence-apple-pay-absent">
|
|
288
291
|
{copy.applePayAbsent[wallets.appleAbsent]}
|
|
289
292
|
</Typography>
|
|
@@ -156,6 +156,9 @@ export interface HomologacaoEvidenceCardCopy {
|
|
|
156
156
|
wallets: HomologacaoEvidenceWalletsCopy;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
+
/** Why Apple Pay has no button on the evidence card (FUT-3755). */
|
|
160
|
+
export type AppleAbsence = 'NOT_CONFIGURED' | 'NOT_AVAILABLE' | 'MERCHANT_VALIDATION_FAILED';
|
|
161
|
+
|
|
159
162
|
/** The Google Pay / Apple Pay step of the evidence card (FUT-3755). */
|
|
160
163
|
export interface HomologacaoEvidenceWalletsCopy {
|
|
161
164
|
heading: string;
|
|
@@ -174,7 +177,7 @@ export interface HomologacaoEvidenceWalletsCopy {
|
|
|
174
177
|
/** Apple Pay started and failed. */
|
|
175
178
|
applePayCannotComplete: string;
|
|
176
179
|
/** Why Apple Pay has no button here: the platform has no Apple Pay identity yet, or this browser has no sheet. */
|
|
177
|
-
applePayAbsent:
|
|
180
|
+
applePayAbsent: Record<AppleAbsence, string>;
|
|
178
181
|
/** A wallet holds its token: `card` is the network and last four the wallet showed — never the token. */
|
|
179
182
|
ready: (wallet: string, card: string) => string;
|
|
180
183
|
/** The sheet answered no token; pressing again retries. */
|
|
@@ -147,9 +147,7 @@ export const EN_US_PLATFORM_HOMOLOGACAO_COPY: PlatformHomologacaoCopy = {
|
|
|
147
147
|
wallets: {
|
|
148
148
|
heading: 'Digital wallets (before generating)',
|
|
149
149
|
names: { GOOGLE_PAY: 'Google Pay', APPLE_PAY: 'Apple Pay' },
|
|
150
|
-
hint:
|
|
151
|
-
'Google Pay and Apple Pay open their own sheet, and only on your tap. Tap each one before generating the file; ' +
|
|
152
|
-
"without it, the wallets' sections stay pending. Test only: nothing is charged.",
|
|
150
|
+
hint: "Tap each wallet before generating; without it, that wallet's section stays pending.",
|
|
153
151
|
googlePayButtonLocale: 'en',
|
|
154
152
|
applePayButton: 'Pay with Apple Pay',
|
|
155
153
|
applePaySheetTotal: 'Homologation test',
|
|
@@ -158,6 +156,7 @@ export const EN_US_PLATFORM_HOMOLOGACAO_COPY: PlatformHomologacaoCopy = {
|
|
|
158
156
|
applePayAbsent: {
|
|
159
157
|
NOT_CONFIGURED: 'Apple Pay: waiting for the Apple Developer account. Its section stays pending.',
|
|
160
158
|
NOT_AVAILABLE: 'Apple Pay: open this screen in Safari on an iPhone or Mac to test it.',
|
|
159
|
+
MERCHANT_VALIDATION_FAILED: "Apple Pay: the merchant validation is not set up. Its section stays pending.",
|
|
161
160
|
},
|
|
162
161
|
ready: (wallet, card) => `${wallet} ready${card ? ` — ${card}` : ''}. It will be used when the file is generated.`,
|
|
163
162
|
failed: (wallet) => `${wallet} returned no token. Tap again to retry.`,
|
|
@@ -131,9 +131,7 @@ export const PT_BR_PLATFORM_HOMOLOGACAO_COPY: PlatformHomologacaoCopy = {
|
|
|
131
131
|
wallets: {
|
|
132
132
|
heading: 'Carteiras digitais (antes de gerar)',
|
|
133
133
|
names: { GOOGLE_PAY: 'Google Pay', APPLE_PAY: 'Apple Pay' },
|
|
134
|
-
hint:
|
|
135
|
-
'O Google Pay e o Apple Pay abrem a própria folha e só com o seu toque. Toque em cada um antes de gerar o arquivo; ' +
|
|
136
|
-
'sem isso, as seções das carteiras ficam pendentes. Somente teste: nada é cobrado.',
|
|
134
|
+
hint: 'Toque em cada carteira antes de gerar; sem isso, a seção dela fica pendente.',
|
|
137
135
|
googlePayButtonLocale: 'pt',
|
|
138
136
|
applePayButton: 'Pagar com Apple Pay',
|
|
139
137
|
applePaySheetTotal: 'Teste de homologação',
|
|
@@ -142,6 +140,7 @@ export const PT_BR_PLATFORM_HOMOLOGACAO_COPY: PlatformHomologacaoCopy = {
|
|
|
142
140
|
applePayAbsent: {
|
|
143
141
|
NOT_CONFIGURED: 'Apple Pay: aguardando a conta Apple Developer. A seção fica pendente.',
|
|
144
142
|
NOT_AVAILABLE: 'Apple Pay: abra esta tela no Safari de um iPhone ou Mac para testar.',
|
|
143
|
+
MERCHANT_VALIDATION_FAILED: 'Apple Pay: a validação do comerciante não está configurada. A seção fica pendente.',
|
|
145
144
|
},
|
|
146
145
|
ready: (wallet, card) => `${wallet} pronto${card ? ` — ${card}` : ''}. Será usado ao gerar o arquivo.`,
|
|
147
146
|
failed: (wallet) => `O ${wallet} não devolveu o token. Toque de novo para tentar.`,
|