@bemony/card-embed-react 0.2.0-next.1 → 0.2.0-next.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/README.md +15 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -50,6 +50,21 @@ encaminhados ao SDK Web sem reinicializar o iframe.
|
|
|
50
50
|
Os callbacks públicos incluem `onReady`, `onStateChange`, `onError`, `onSessionExpiring`,
|
|
51
51
|
`onSessionExpired` e `onDestroyed`.
|
|
52
52
|
|
|
53
|
+
## Bandeiras aceitas
|
|
54
|
+
|
|
55
|
+
O componente não recebe uma prop de bandeiras. A allowlist vem da CheckoutSession, é aplicada pelo
|
|
56
|
+
Card Frame e é a mesma do SDK Web. Uma projeção legada ausente ou inválida usa o fallback
|
|
57
|
+
`VISA` + `MASTERCARD`, sem habilitar outras redes. O callback `onStateChange` informa `brand?` e
|
|
58
|
+
`errors.number === 'CARD_BRAND_NOT_SUPPORTED'` quando o comprador digita uma bandeira fora da
|
|
59
|
+
configuração. Nesse caso `valid` é `false` e `ref.current.tokenize()` rejeita com o erro público
|
|
60
|
+
`CARD_BRAND_NOT_SUPPORTED` sem iniciar tokenização.
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
onStateChange={(state) => {
|
|
64
|
+
setCanContinue(state.valid && state.errors.number !== 'CARD_BRAND_NOT_SUPPORTED');
|
|
65
|
+
}}
|
|
66
|
+
```
|
|
67
|
+
|
|
53
68
|
O adaptador não reclassifica erros. `onError` e a rejeição de `tokenize()` mantêm o mesmo
|
|
54
69
|
`CardEmbedError` entregue pelo SDK Web, inclusive `code`, `message`, `type`, `field`, `details`,
|
|
55
70
|
`retryable`, `requestId` e `httpStatus`. Cabe ao produto consumidor mapear esse contrato para a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bemony/card-embed-react",
|
|
3
|
-
"version": "0.2.0-next.
|
|
3
|
+
"version": "0.2.0-next.2",
|
|
4
4
|
"description": "Official React adapter for the secure Bemony Card Embed SDK.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bemony",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@bemony/card-embed": "^0.2.0-next.
|
|
38
|
+
"@bemony/card-embed": "^0.2.0-next.2"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": ">=19.0.0 <20.0.0",
|