@12-apps/payments-frontend 3.12.0 → 3.14.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.
- package/package.json +4 -3
- package/src/card/copy.ts +6 -0
- package/src/card/en-US.ts +61 -0
- package/src/card/fields.tsx +1 -1
- package/src/card/index.ts +1 -0
- package/src/card/pt-BR.ts +1 -0
- package/src/components/ProviderSetupGuide.tsx +2 -1
- package/src/components/checkout/en-US.ts +95 -0
- package/src/components/checkout/screens-en-US.ts +113 -0
- package/src/components/checkout-payment-en-US.ts +53 -0
- package/src/components/platform/ConnectApplicationPanel.tsx +20 -5
- package/src/components/platform/ConnectEnvironmentCard.tsx +19 -18
- package/src/components/platform/HomologacaoGuideCard.tsx +12 -11
- package/src/components/platform/HomologacaoOutcomeCard.tsx +19 -21
- package/src/components/platform/PlatformHomologacao.tsx +16 -12
- package/src/components/platform/copy-context.tsx +45 -0
- package/src/components/platform/copy.ts +113 -0
- package/src/components/platform/en-US.ts +93 -0
- package/src/components/platform/pt-BR.ts +73 -0
- package/src/components/settings-copy.ts +6 -0
- package/src/components/settings-en-US.ts +187 -0
- package/src/components/settings-pt-BR.ts +1 -0
- package/src/index.ts +7 -7
- package/src/locales.ts +100 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import type { PaymentsSettingsCopy } from './settings-copy';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The en-US pack for the payments settings surface — a NAMED constant a host
|
|
5
|
+
* passes by hand, never a default.
|
|
6
|
+
*
|
|
7
|
+
* The four sentences that matter most on this screen are the ones about MONEY
|
|
8
|
+
* MOVING, and the translation keeps each of them blunt rather than polite:
|
|
9
|
+
*
|
|
10
|
+
* - `confirmSave.warning` — a wrong value pays a stranger, irreversibly;
|
|
11
|
+
* - `card.removeConsequenceLive` — removing a live connection stops the store
|
|
12
|
+
* taking money immediately;
|
|
13
|
+
* - `priority.noneActive` — with nothing active the checkout cannot charge;
|
|
14
|
+
* - `credentials.reverifyWarning` — changing credentials stops collection
|
|
15
|
+
* until re-verification finishes.
|
|
16
|
+
*
|
|
17
|
+
* `**bold**` markers are the surface's own emphasis and survive translation, on
|
|
18
|
+
* the phrase that carries the consequence.
|
|
19
|
+
*/
|
|
20
|
+
export const EN_US_PAYMENTS_SETTINGS_COPY: PaymentsSettingsCopy = {
|
|
21
|
+
status: {
|
|
22
|
+
verified: 'VERIFIED',
|
|
23
|
+
unverified: 'NOT VERIFIED',
|
|
24
|
+
connectionOk: 'CONNECTION OK',
|
|
25
|
+
reconnectRequired: 'RECONNECT',
|
|
26
|
+
notConnected: 'Not connected',
|
|
27
|
+
threeStepsAhead: 'This provider only starts taking sales after the 3 steps below.',
|
|
28
|
+
connectAndVerifyFirst: 'Connect and verify the provider before switching sales on.',
|
|
29
|
+
receiving: {
|
|
30
|
+
state: 'Taking sales',
|
|
31
|
+
sub: 'Your store is being paid through this provider.',
|
|
32
|
+
},
|
|
33
|
+
pausedByOwner: {
|
|
34
|
+
state: 'Paused',
|
|
35
|
+
sub: 'Connection ready and paused by you — no new order is charged here.',
|
|
36
|
+
},
|
|
37
|
+
pausedChip: 'Paused',
|
|
38
|
+
readyNotReceiving: {
|
|
39
|
+
state: 'Not taking sales yet',
|
|
40
|
+
sub: 'Everything is ready — flip the switch to start taking payments.',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
listBadge: {
|
|
44
|
+
active: 'Active',
|
|
45
|
+
connected: 'Connected',
|
|
46
|
+
reconnect: 'Reconnect',
|
|
47
|
+
notConnected: 'Not connected',
|
|
48
|
+
},
|
|
49
|
+
environment: {
|
|
50
|
+
production: 'Production',
|
|
51
|
+
sandbox: 'Sandbox',
|
|
52
|
+
groupLabel: "This connection's environment",
|
|
53
|
+
productionMeaning: 'Production — real money.',
|
|
54
|
+
sandboxMeaning: 'Sandbox — a test environment.',
|
|
55
|
+
productionConsequence: "Everything you do here applies to the store's real sales.",
|
|
56
|
+
sandboxConsequence: 'No money actually moves.',
|
|
57
|
+
// Leading space: it is appended to one of the sentences above.
|
|
58
|
+
storeIsUsing: (environmentName) => ` The store is currently using ${environmentName}.`,
|
|
59
|
+
},
|
|
60
|
+
oauth: {
|
|
61
|
+
connectAction: (displayName) => `Connect with ${displayName}`,
|
|
62
|
+
reconnectAction: 'Reconnect',
|
|
63
|
+
removeAction: 'Remove connection',
|
|
64
|
+
invitation: (displayName) =>
|
|
65
|
+
`Connect your ${displayName} account by authorising access on the provider's site. No keys to copy.`,
|
|
66
|
+
roundTripNote: 'You go out to the provider and come back here — it takes under a minute.',
|
|
67
|
+
connectedExplainer:
|
|
68
|
+
'Your account is connected. Charges are created on your behalf — no keys to copy.',
|
|
69
|
+
connectedNote: (displayName) =>
|
|
70
|
+
`${displayName} account connected. Revoke it whenever you like, here or in the provider's dashboard.`,
|
|
71
|
+
connectedAt: (when) => `Connected ${when}`,
|
|
72
|
+
validUntil: (when) => `Authorisation valid until ${when}`,
|
|
73
|
+
expiredAt: (when) =>
|
|
74
|
+
`The authorisation expired on ${when}. Reconnect to start taking payments again.`,
|
|
75
|
+
expiresAt: (when) =>
|
|
76
|
+
`The authorisation expires on ${when}. If the warning stays, reconnect the account.`,
|
|
77
|
+
revoked:
|
|
78
|
+
'The authorisation expired or was revoked. Reconnect to start taking payments again.',
|
|
79
|
+
notAvailableHere: (displayName) =>
|
|
80
|
+
`Connecting to ${displayName} automatically is not available in this installation — ` +
|
|
81
|
+
'the authorisation application has not been registered. To connect now, open ' +
|
|
82
|
+
'“I would rather enter the credentials myself” below and paste your own keys.',
|
|
83
|
+
connectUnavailable:
|
|
84
|
+
'This provider connects by authorisation, but the connect button is not available in this ' +
|
|
85
|
+
'installation. You can still connect by entering the credentials yourself.',
|
|
86
|
+
preferOAuth: 'I would rather connect by authorisation',
|
|
87
|
+
preferCredentials: 'I would rather enter the credentials myself',
|
|
88
|
+
// What the owner is granting, shown before they authorise.
|
|
89
|
+
scopes: {
|
|
90
|
+
read: 'Look up payments',
|
|
91
|
+
create: 'Create charges',
|
|
92
|
+
refund: 'Refund payments',
|
|
93
|
+
account: 'Look up account details',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
card: {
|
|
97
|
+
accountHeading: (displayName) => `${displayName} account`,
|
|
98
|
+
accountLabel: 'Account',
|
|
99
|
+
connectionLabel: 'Connection',
|
|
100
|
+
authorizedAt: (displayName) => `Authorised on ${displayName}`,
|
|
101
|
+
environmentLabel: 'Environment',
|
|
102
|
+
connectedAtLabel: 'Connected',
|
|
103
|
+
sandboxWithNote: 'Sandbox (testing)',
|
|
104
|
+
steps: {
|
|
105
|
+
signIn: (displayName) =>
|
|
106
|
+
`Sign in to your ${displayName} account — you can create one on the spot if you do not have one.`,
|
|
107
|
+
authorize: "Authorise access on the provider's screen.",
|
|
108
|
+
comeBack: 'You come back here with the account connected.',
|
|
109
|
+
},
|
|
110
|
+
removeAction: 'Remove connection',
|
|
111
|
+
removeQuestion: (displayName) => `Remove the connection to ${displayName}?`,
|
|
112
|
+
removeConsequenceLive:
|
|
113
|
+
'The store stops taking payments immediately and is left with no active provider — new orders cannot be paid until you connect another.',
|
|
114
|
+
removeConsequenceIdle: 'This connection leaves the store. You can connect again later.',
|
|
115
|
+
removeStopsChargingNow: 'New orders stop being charged immediately.',
|
|
116
|
+
removeRevokes: (displayName) =>
|
|
117
|
+
`The authorisation is revoked at ${displayName}. Your account and its history stay there, untouched.`,
|
|
118
|
+
removeKeepsSettled: (displayName) =>
|
|
119
|
+
`Payments already approved and refunds in flight carry on as normal through ${displayName}.`,
|
|
120
|
+
removeRestartsSetup: 'To reconnect, the steps start again from the beginning.',
|
|
121
|
+
pauseInstead: 'Just pause taking payments',
|
|
122
|
+
cancel: 'Cancel',
|
|
123
|
+
},
|
|
124
|
+
credentials: {
|
|
125
|
+
configuredKeepBlank: 'Configured — leave blank to keep the current value.',
|
|
126
|
+
// Leading space: it is appended to a field label.
|
|
127
|
+
advancedSuffix: ' · Connect platforms only',
|
|
128
|
+
probeAction: 'Test connection',
|
|
129
|
+
reverifyWarning: (displayName) =>
|
|
130
|
+
`This store is already verified. Changing the credentials **requires re-verification** ` +
|
|
131
|
+
`and the store **stops taking payments** through ${displayName} until it finishes.`,
|
|
132
|
+
probeRunning: 'Testing the connection…',
|
|
133
|
+
probeSaveNote: 'We save and test the keys with the provider before going on.',
|
|
134
|
+
probeIncompleteNote: 'We kept what you have filled in. Complete the fields to test.',
|
|
135
|
+
probeFailed: (environmentName) =>
|
|
136
|
+
`Could not connect in ${environmentName}. Check the credentials for this environment.`,
|
|
137
|
+
checkPass: 'Verified',
|
|
138
|
+
checkFail: 'Fix',
|
|
139
|
+
uncheckable: 'Not verifiable',
|
|
140
|
+
saveAndTest: 'Save and test connection',
|
|
141
|
+
save: 'Save',
|
|
142
|
+
saveOnly: (fieldLabel) => `Save ${fieldLabel}`,
|
|
143
|
+
changeAction: 'Change',
|
|
144
|
+
},
|
|
145
|
+
priority: {
|
|
146
|
+
moveUp: (label) => `Move ${label} up`,
|
|
147
|
+
moveDown: (label) => `Move ${label} down`,
|
|
148
|
+
saveFailed: 'Could not save the order.',
|
|
149
|
+
firstInChain: 'first',
|
|
150
|
+
orderHeading: 'Order of attempts',
|
|
151
|
+
chainExplainer: (firstProviderLabel) =>
|
|
152
|
+
`Checkout tries **${firstProviderLabel}** first. If a charge fails for a technical ` +
|
|
153
|
+
'reason it tries the next in the list — but only when it can prove the previous ' +
|
|
154
|
+
'attempt did not charge anything.',
|
|
155
|
+
noneActive:
|
|
156
|
+
'No provider is active. Checkout will not be able to charge until you switch at least one on.',
|
|
157
|
+
retryDeclinedLabel: 'Retry a **declined** card with the next provider',
|
|
158
|
+
// Both sides of the switch say what it COSTS, which is the point of the
|
|
159
|
+
// pair: one names the risk, the other names the default.
|
|
160
|
+
retryDeclinedOn:
|
|
161
|
+
'A decline moves on to the next in the list. This can raise transaction costs and fraud signals.',
|
|
162
|
+
retryDeclinedOff:
|
|
163
|
+
'Default: a decline ends the charge. Only technical failures move on to the next.',
|
|
164
|
+
},
|
|
165
|
+
providerList: {
|
|
166
|
+
heading: 'Choose the payment provider',
|
|
167
|
+
subheading: 'Pick where your store is paid — the setup is tailored to it.',
|
|
168
|
+
},
|
|
169
|
+
confirmSave: {
|
|
170
|
+
title: 'Confirm where the money goes',
|
|
171
|
+
body: (fieldLabel) =>
|
|
172
|
+
`Every payment this store takes will be deposited into the account this ${fieldLabel} belongs to:`,
|
|
173
|
+
fieldFallback: 'credential',
|
|
174
|
+
warning:
|
|
175
|
+
"A wrong value sends this store's payments to somebody else, and there is no way to reverse it.",
|
|
176
|
+
cancelAction: 'Go back and check',
|
|
177
|
+
confirmAction: "That's the one, save it",
|
|
178
|
+
},
|
|
179
|
+
setupGuide: {
|
|
180
|
+
defaultConfirmLabel: 'I have enabled Integrated Checkout',
|
|
181
|
+
confirmedByYou: 'Confirmed by you',
|
|
182
|
+
reviewAction: 'Review',
|
|
183
|
+
confirmPrompt: "Confirm once you have finished on the provider's side.",
|
|
184
|
+
copyValue: (fieldLabel) => `Copy ${fieldLabel}`,
|
|
185
|
+
copied: 'Copied',
|
|
186
|
+
},
|
|
187
|
+
};
|
|
@@ -166,6 +166,7 @@ export const PT_BR_PAYMENTS_SETTINGS_COPY: PaymentsSettingsCopy = {
|
|
|
166
166
|
defaultConfirmLabel: 'Já habilitei o Checkout Integrado',
|
|
167
167
|
confirmedByYou: 'Confirmado por você',
|
|
168
168
|
reviewAction: 'Revisar',
|
|
169
|
+
confirmPrompt: 'Confirme quando terminar do lado do provedor.',
|
|
169
170
|
copyValue: (fieldLabel) => `Copiar ${fieldLabel}`,
|
|
170
171
|
copied: 'Copiado',
|
|
171
172
|
},
|
package/src/index.ts
CHANGED
|
@@ -306,23 +306,23 @@ export {
|
|
|
306
306
|
// The PLATFORM operations screens (FUT-479 / FUT-483, packaged by FUT-573) —
|
|
307
307
|
// the Connect-application consult and the homologação, as dumb components a
|
|
308
308
|
// host page mounts with data + callbacks from its own routes. Their backend
|
|
309
|
-
// halves
|
|
310
|
-
// `
|
|
311
|
-
// `buildPlatformHomologacaoAnexo`).
|
|
309
|
+
// halves are `consultConnectApplications`, `platformHomologacaoGuide`,
|
|
310
|
+
// `createHomologationRecordService` and `buildPlatformHomologacaoAnexo`.
|
|
312
311
|
// ---------------------------------------------------------------------------
|
|
313
312
|
export {
|
|
314
313
|
ConnectApplicationPanel,
|
|
315
314
|
type ConnectApplicationPanelProps,
|
|
316
315
|
} from './components/platform/ConnectApplicationPanel';
|
|
317
|
-
export {
|
|
318
|
-
PlatformHomologacao,
|
|
319
|
-
type PlatformHomologacaoProps,
|
|
320
|
-
} from './components/platform/PlatformHomologacao';
|
|
316
|
+
export { PlatformHomologacao, type PlatformHomologacaoProps } from './components/platform/PlatformHomologacao';
|
|
321
317
|
export {
|
|
322
318
|
type HomologacaoSaveInput,
|
|
323
319
|
type HomologacaoSaveState,
|
|
324
320
|
type PlatformHomologationRecordView,
|
|
325
321
|
} from './components/platform/HomologacaoOutcomeCard';
|
|
322
|
+
// Both mounts require `copy`, so the contract and its pt-BR pack are part of
|
|
323
|
+
// the port — a required port a host cannot import is not one.
|
|
324
|
+
export type * from './components/platform/copy';
|
|
325
|
+
export { PT_BR_PLATFORM_HOMOLOGACAO_COPY } from './components/platform/pt-BR';
|
|
326
326
|
|
|
327
327
|
/**
|
|
328
328
|
* Re-exported because it appears in the `prepareConnect` prop a host must
|
package/src/locales.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { CardCopy } from './card/copy';
|
|
2
|
+
import { EN_US_CARD_COPY, PT_BR_CARD_COPY } from './card';
|
|
3
|
+
import type { CheckoutPaymentCopy } from './components/checkout-payment-copy';
|
|
4
|
+
import { EN_US_CHECKOUT_PAYMENT_COPY } from './components/checkout-payment-en-US';
|
|
5
|
+
import { PT_BR_CHECKOUT_PAYMENT_COPY } from './components/checkout-payment-pt-BR';
|
|
6
|
+
import type { CheckoutCopy } from './components/checkout/copy-context';
|
|
7
|
+
import {
|
|
8
|
+
EN_US_CHECKOUT_COPY,
|
|
9
|
+
EN_US_CHECKOUT_VIEW_COPY,
|
|
10
|
+
EN_US_PAYMENT_STATUS_COPY,
|
|
11
|
+
} from './components/checkout/en-US';
|
|
12
|
+
import {
|
|
13
|
+
PT_BR_CHECKOUT_COPY,
|
|
14
|
+
PT_BR_CHECKOUT_VIEW_COPY,
|
|
15
|
+
PT_BR_PAYMENT_STATUS_COPY,
|
|
16
|
+
} from './components/checkout/pt-BR';
|
|
17
|
+
import { EN_US_CHECKOUT_SCREENS_COPY } from './components/checkout/screens-en-US';
|
|
18
|
+
import type { CheckoutScreensCopy } from './components/checkout/screens-copy';
|
|
19
|
+
import { PT_BR_CHECKOUT_SCREENS_COPY } from './components/checkout/screens-pt-BR';
|
|
20
|
+
import type { CheckoutViewCopy, PaymentStatusCopy } from './components/checkout/view-copy';
|
|
21
|
+
import type { PlatformHomologacaoCopy } from './components/platform/copy';
|
|
22
|
+
import { EN_US_PLATFORM_HOMOLOGACAO_COPY } from './components/platform/en-US';
|
|
23
|
+
import { PT_BR_PLATFORM_HOMOLOGACAO_COPY } from './components/platform/pt-BR';
|
|
24
|
+
import { EN_US_PAYMENTS_SETTINGS_COPY } from './components/settings-en-US';
|
|
25
|
+
import type { PaymentsSettingsCopy } from './components/settings-copy';
|
|
26
|
+
import { PT_BR_PAYMENTS_SETTINGS_COPY } from './components/settings-pt-BR';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Every surface this half renders, in both languages, keyed by tag.
|
|
30
|
+
*
|
|
31
|
+
* The two AUDIENCES here are worth keeping apart when a host wires them: the
|
|
32
|
+
* checkout packs are read by a SHOPPER mid-purchase and the settings and
|
|
33
|
+
* homologação packs by the store's OPERATOR. A store whose owner reads English
|
|
34
|
+
* and whose buyers read Portuguese is the ordinary case, not an edge one, so
|
|
35
|
+
* these resolve from different preferences rather than one.
|
|
36
|
+
*
|
|
37
|
+
* `LocalePack` is declared here rather than imported, and in this package that
|
|
38
|
+
* is not merely a preference: `payments/no-host-imports` forbids
|
|
39
|
+
* `packages/payments/**` from importing a sibling workspace package at all.
|
|
40
|
+
*/
|
|
41
|
+
type LocalePack<T> = { readonly 'pt-BR': T; readonly 'en-US': T };
|
|
42
|
+
|
|
43
|
+
export const CARD_COPY = {
|
|
44
|
+
'pt-BR': PT_BR_CARD_COPY,
|
|
45
|
+
'en-US': EN_US_CARD_COPY,
|
|
46
|
+
} as const satisfies LocalePack<CardCopy>;
|
|
47
|
+
|
|
48
|
+
export const CHECKOUT_SCREENS_COPY = {
|
|
49
|
+
'pt-BR': PT_BR_CHECKOUT_SCREENS_COPY,
|
|
50
|
+
'en-US': EN_US_CHECKOUT_SCREENS_COPY,
|
|
51
|
+
} as const satisfies LocalePack<CheckoutScreensCopy>;
|
|
52
|
+
|
|
53
|
+
export const CHECKOUT_COPY = {
|
|
54
|
+
'pt-BR': PT_BR_CHECKOUT_COPY,
|
|
55
|
+
'en-US': EN_US_CHECKOUT_COPY,
|
|
56
|
+
} as const satisfies LocalePack<CheckoutCopy>;
|
|
57
|
+
|
|
58
|
+
export const CHECKOUT_VIEW_COPY = {
|
|
59
|
+
'pt-BR': PT_BR_CHECKOUT_VIEW_COPY,
|
|
60
|
+
'en-US': EN_US_CHECKOUT_VIEW_COPY,
|
|
61
|
+
} as const satisfies LocalePack<CheckoutViewCopy>;
|
|
62
|
+
|
|
63
|
+
export const PAYMENT_STATUS_COPY = {
|
|
64
|
+
'pt-BR': PT_BR_PAYMENT_STATUS_COPY,
|
|
65
|
+
'en-US': EN_US_PAYMENT_STATUS_COPY,
|
|
66
|
+
} as const satisfies LocalePack<PaymentStatusCopy>;
|
|
67
|
+
|
|
68
|
+
export const CHECKOUT_PAYMENT_COPY = {
|
|
69
|
+
'pt-BR': PT_BR_CHECKOUT_PAYMENT_COPY,
|
|
70
|
+
'en-US': EN_US_CHECKOUT_PAYMENT_COPY,
|
|
71
|
+
} as const satisfies LocalePack<CheckoutPaymentCopy>;
|
|
72
|
+
|
|
73
|
+
export const PAYMENTS_SETTINGS_COPY = {
|
|
74
|
+
'pt-BR': PT_BR_PAYMENTS_SETTINGS_COPY,
|
|
75
|
+
'en-US': EN_US_PAYMENTS_SETTINGS_COPY,
|
|
76
|
+
} as const satisfies LocalePack<PaymentsSettingsCopy>;
|
|
77
|
+
|
|
78
|
+
export const PLATFORM_HOMOLOGACAO_COPY = {
|
|
79
|
+
'pt-BR': PT_BR_PLATFORM_HOMOLOGACAO_COPY,
|
|
80
|
+
'en-US': EN_US_PLATFORM_HOMOLOGACAO_COPY,
|
|
81
|
+
} as const satisfies LocalePack<PlatformHomologacaoCopy>;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The en-US packs are published from HERE rather than from the root barrel,
|
|
85
|
+
* which is at its 400-line budget. That is a happier arrangement than it
|
|
86
|
+
* sounds: `@12-apps/payments-frontend/locales` is now the one subpath that
|
|
87
|
+
* holds everything about language — the per-locale packs and the records that
|
|
88
|
+
* key them — while the root keeps exporting the pt-BR names it always has, so
|
|
89
|
+
* no existing import moves.
|
|
90
|
+
*/
|
|
91
|
+
export { EN_US_CARD_COPY } from './card';
|
|
92
|
+
export { EN_US_CHECKOUT_PAYMENT_COPY } from './components/checkout-payment-en-US';
|
|
93
|
+
export {
|
|
94
|
+
EN_US_CHECKOUT_COPY,
|
|
95
|
+
EN_US_CHECKOUT_VIEW_COPY,
|
|
96
|
+
EN_US_PAYMENT_STATUS_COPY,
|
|
97
|
+
} from './components/checkout/en-US';
|
|
98
|
+
export { EN_US_CHECKOUT_SCREENS_COPY } from './components/checkout/screens-en-US';
|
|
99
|
+
export { EN_US_PAYMENTS_SETTINGS_COPY } from './components/settings-en-US';
|
|
100
|
+
export { EN_US_PLATFORM_HOMOLOGACAO_COPY } from './components/platform/en-US';
|