@bemony/payment-form-react 0.2.0-next.2 → 0.2.0-next.3
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/README.md +27 -26
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ const response = await fetch(
|
|
|
42
42
|
authorization: `Bearer ${process.env.BEMONY_SECRET_KEY}`,
|
|
43
43
|
'content-type': 'application/json',
|
|
44
44
|
'idempotency-key': crypto.randomUUID(),
|
|
45
|
-
'x-bemony-api-version': '2026-10-
|
|
45
|
+
'x-bemony-api-version': '2026-10-30'
|
|
46
46
|
},
|
|
47
47
|
body: JSON.stringify({
|
|
48
48
|
mode: 'CREATE',
|
|
@@ -130,7 +130,7 @@ export function Checkout({ sessionClientSecret, riskCollectors }: CheckoutProps)
|
|
|
130
130
|
ref={formRef}
|
|
131
131
|
clientSecret={sessionClientSecret}
|
|
132
132
|
environment="sandbox"
|
|
133
|
-
version={PAYMENT_FORM_API_VERSION.
|
|
133
|
+
version={PAYMENT_FORM_API_VERSION.TOKEN_INTENT}
|
|
134
134
|
riskCollectors={riskCollectors}
|
|
135
135
|
threeDS={{ presentation: 'modal' }}
|
|
136
136
|
appearance={{ theme: 'system' }}
|
|
@@ -196,7 +196,7 @@ export function CheckoutWithProvider({ session, input }: CheckoutWithProviderPro
|
|
|
196
196
|
<BemonyPaymentFormProvider
|
|
197
197
|
clientSecret={session.sessionClientSecret}
|
|
198
198
|
environment="sandbox"
|
|
199
|
-
version={PAYMENT_FORM_API_VERSION.
|
|
199
|
+
version={PAYMENT_FORM_API_VERSION.TOKEN_INTENT}
|
|
200
200
|
riskCollectors={session.riskCollectors}
|
|
201
201
|
threeDS={{ presentation: 'modal' }}
|
|
202
202
|
>
|
|
@@ -220,21 +220,21 @@ O hook só pode ser usado dentro de `BemonyPaymentFormProvider`.
|
|
|
220
220
|
|
|
221
221
|
## Props
|
|
222
222
|
|
|
223
|
-
| Prop | Tipo
|
|
224
|
-
| ------------------- |
|
|
225
|
-
| `clientSecret` | `string`
|
|
226
|
-
| `environment` | `'sandbox' \| 'production'`
|
|
227
|
-
| `version` | `'2026-09-25' \| '2026-10-20'`
|
|
228
|
-
| `riskCollectors` | `readonly RiskCollector[]`
|
|
229
|
-
| `appearance` | `PaymentFormAppearance`
|
|
230
|
-
| `threeDS` | `{ presentation?: 'modal' \| 'inline' }`
|
|
231
|
-
| `className` | `string`
|
|
232
|
-
| `onReady` | `() => void`
|
|
233
|
-
| `onCardStateChange` | `(state: CardState) => void`
|
|
234
|
-
| `onStatusChange` | `(status) => void`
|
|
235
|
-
| `onSuccess` | `(payment) => void`
|
|
236
|
-
| `onError` | `(error) => void`
|
|
237
|
-
| `onEvent` | `(event) => void`
|
|
223
|
+
| Prop | Tipo | Padrão | Descrição |
|
|
224
|
+
| ------------------- | ---------------------------------------------- | ------------ | ------------------------------------------ |
|
|
225
|
+
| `clientSecret` | `string` | obrigatório | segredo público da CheckoutSession |
|
|
226
|
+
| `environment` | `'sandbox' \| 'production'` | `sandbox` | infraestrutura hospedada |
|
|
227
|
+
| `version` | `'2026-09-25' \| '2026-10-20' \| '2026-10-30'` | `2026-10-30` | contrato da API |
|
|
228
|
+
| `riskCollectors` | `readonly RiskCollector[]` | ausente | instruções públicas devolvidas pela sessão |
|
|
229
|
+
| `appearance` | `PaymentFormAppearance` | sistema | tema e variáveis visuais |
|
|
230
|
+
| `threeDS` | `{ presentation?: 'modal' \| 'inline' }` | `modal` | apresentação do challenge |
|
|
231
|
+
| `className` | `string` | ausente | classe aplicada ao container React |
|
|
232
|
+
| `onReady` | `() => void` | ausente | iframe e Card Frame prontos |
|
|
233
|
+
| `onCardStateChange` | `(state: CardState) => void` | ausente | completude e validade dos campos |
|
|
234
|
+
| `onStatusChange` | `(status) => void` | ausente | transição do estado público |
|
|
235
|
+
| `onSuccess` | `(payment) => void` | ausente | pagamento `AUTHORIZED` ou `CAPTURED` |
|
|
236
|
+
| `onError` | `(error) => void` | ausente | mesmo erro público rejeitado por `pay()` |
|
|
237
|
+
| `onEvent` | `(event) => void` | ausente | telemetria segura de montagem/pagamento |
|
|
238
238
|
|
|
239
239
|
No Provider, `children` também é obrigatório. No componente standalone, `clientSecret` é
|
|
240
240
|
obrigatório; dentro do Provider, a configuração vem do contexto.
|
|
@@ -268,12 +268,13 @@ import {
|
|
|
268
268
|
} from '@bemony/payment-form-react';
|
|
269
269
|
```
|
|
270
270
|
|
|
271
|
-
| Versão | Constante
|
|
272
|
-
| ------------ |
|
|
273
|
-
| `2026-09-25` | `PAYMENT_FORM_API_VERSION.LEGACY`
|
|
274
|
-
| `2026-10-20` | `PAYMENT_FORM_API_VERSION.ENRICHMENT`
|
|
271
|
+
| Versão | Constante | Uso |
|
|
272
|
+
| ------------ | --------------------------------------- | ------------------------------ |
|
|
273
|
+
| `2026-09-25` | `PAYMENT_FORM_API_VERSION.LEGACY` | contrato legado |
|
|
274
|
+
| `2026-10-20` | `PAYMENT_FORM_API_VERSION.ENRICHMENT` | enriquecimento e body completo |
|
|
275
|
+
| `2026-10-30` | `PAYMENT_FORM_API_VERSION.TOKEN_INTENT` | Token Intent/CVV |
|
|
275
276
|
|
|
276
|
-
O padrão é `DEFAULT_PAYMENT_FORM_API_VERSION`, atualmente `2026-10-
|
|
277
|
+
O padrão é `DEFAULT_PAYMENT_FORM_API_VERSION`, atualmente `2026-10-30`. O tipo é fechado e o valor
|
|
277
278
|
é validado novamente pelo SDK e pelo hosted BFF. Campos exclusivos da versão enriquecida retornam
|
|
278
279
|
`400 UNKNOWN_FIELD` quando enviados com a versão legada.
|
|
279
280
|
|
|
@@ -425,10 +426,10 @@ connect-src 'self' https://form.bemony.com https://bemony-payment-form.vercel.ap
|
|
|
425
426
|
2. valide o hosted usando a versão antiga do pacote;
|
|
426
427
|
3. publique Web e React com tag `next`;
|
|
427
428
|
4. atualize um consumidor de teste explicitamente para `next`;
|
|
428
|
-
5. valide legado e
|
|
429
|
+
5. valide legado, enriquecimento e Token Intent antes de promover `latest`.
|
|
429
430
|
|
|
430
|
-
Omitir `version`
|
|
431
|
-
|
|
431
|
+
Omitir `version` usa `2026-10-30` nas novas versões. Consumidores antigos não mudam de pacote nem
|
|
432
|
+
recebem a nova implementação até atualizarem sua dependência.
|
|
432
433
|
|
|
433
434
|
## Regras de segurança
|
|
434
435
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bemony/payment-form-react",
|
|
3
|
-
"version": "0.2.0-next.
|
|
3
|
+
"version": "0.2.0-next.3",
|
|
4
4
|
"description": "Official React adapter for the hosted Bemony Payment Form.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bemony",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"test": "vitest run --passWithNoTests"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@bemony/payment-form": "^0.2.0-next.
|
|
46
|
+
"@bemony/payment-form": "^0.2.0-next.3"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"react": ">=19.0.0 <20.0.0",
|