@bemony/payment-form-react 0.2.0-next.4 → 0.2.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/README.md +28 -27
- 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-
|
|
45
|
+
'x-bemony-api-version': '2026-11-02'
|
|
46
46
|
},
|
|
47
47
|
body: JSON.stringify({
|
|
48
48
|
mode: 'CREATE',
|
|
@@ -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' \| '2026-10-30'`
|
|
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' \| 'production_aws'` | `sandbox` | infraestrutura hospedada |
|
|
227
|
+
| `version` | `'2026-09-25' \| '2026-10-20' \| '2026-10-30'` | `2026-10-30` | compatibilidade do protocolo hospedado |
|
|
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.
|
|
@@ -274,16 +274,17 @@ import {
|
|
|
274
274
|
| `2026-10-20` | `PAYMENT_FORM_API_VERSION.ENRICHMENT` | enriquecimento e body completo |
|
|
275
275
|
| `2026-10-30` | `PAYMENT_FORM_API_VERSION.TOKEN_INTENT` | Token Intent/CVV |
|
|
276
276
|
|
|
277
|
-
O padrão é `DEFAULT_PAYMENT_FORM_API_VERSION`, atualmente `2026-10-30`. O
|
|
278
|
-
é validado novamente pelo SDK e pelo hosted BFF.
|
|
279
|
-
|
|
277
|
+
O padrão do protocolo hospedado é `DEFAULT_PAYMENT_FORM_API_VERSION`, atualmente `2026-10-30`. O
|
|
278
|
+
tipo é fechado e o valor é validado novamente pelo SDK e pelo hosted BFF. A versão enviada pelo BFF
|
|
279
|
+
à API é definida pelo deploy via `BEMONY_API_VERSION`.
|
|
280
280
|
|
|
281
|
-
|
|
281
|
+
A prop `version` controla somente o handshake entre o adaptador, o SDK e o formulário hospedado.
|
|
282
|
+
Ela não substitui o header HTTP usado pelo backend para criar a CheckoutSession.
|
|
282
283
|
|
|
283
284
|
## Ambientes
|
|
284
285
|
|
|
285
286
|
- `sandbox`: padrão compatível atual conectado à Railway;
|
|
286
|
-
- `production
|
|
287
|
+
- `production` e `production_aws` usam a AWS em `https://embed-payment-orchestration.bemony.com`.
|
|
287
288
|
|
|
288
289
|
O componente nunca recebe endpoint ou origem arbitrária. A configuração dos hosts pertence aos
|
|
289
290
|
deploys Bemony.
|
|
@@ -415,20 +416,20 @@ site e permita os hosts Bemony e os collectors habilitados:
|
|
|
415
416
|
|
|
416
417
|
```text
|
|
417
418
|
default-src 'self';
|
|
418
|
-
frame-src https://form.bemony.com https://bemony-payment-form.vercel.app https://
|
|
419
|
+
frame-src https://form.bemony.com https://bemony-payment-form.vercel.app https://embed-payment-orchestration.bemony.com;
|
|
419
420
|
script-src 'self' https://js.stripe.com https://tst.kaptcha.com https://ssl.kaptcha.com;
|
|
420
|
-
connect-src 'self' https://form.bemony.com https://bemony-payment-form.vercel.app https://
|
|
421
|
+
connect-src 'self' https://form.bemony.com https://bemony-payment-form.vercel.app https://embed-payment-orchestration.bemony.com https://api.stripe.com https://r.stripe.com https://m.stripe.com https://tst.kaptcha.com https://ssl.kaptcha.com;
|
|
421
422
|
```
|
|
422
423
|
|
|
423
424
|
## Migração e rollout
|
|
424
425
|
|
|
425
426
|
1. publique primeiro o hosted Payment Form compatível com `apiVersion`;
|
|
426
427
|
2. valide o hosted usando a versão antiga do pacote;
|
|
427
|
-
3. publique Web e React com tag `
|
|
428
|
-
4. atualize um consumidor de teste explicitamente para `
|
|
429
|
-
5. valide legado, enriquecimento
|
|
428
|
+
3. publique Web e React com tag `latest`;
|
|
429
|
+
4. atualize um consumidor de teste explicitamente para `0.2.1`;
|
|
430
|
+
5. valide legado, enriquecimento, Token Intent, 3DS e reconciliação.
|
|
430
431
|
|
|
431
|
-
Omitir `version` usa `2026-10-30`
|
|
432
|
+
Omitir `version` usa `2026-10-30` no handshake. Consumidores antigos não mudam de pacote nem
|
|
432
433
|
recebem a nova implementação até atualizarem sua dependência.
|
|
433
434
|
|
|
434
435
|
## Regras de segurança
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bemony/payment-form-react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Official React adapter for the hosted Bemony Payment Form.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bemony",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@bemony/payment-form": "^0.2.
|
|
37
|
+
"@bemony/payment-form": "^0.2.1"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": ">=19.0.0 <20.0.0",
|