@bemony/payment-form-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 +19 -0
- package/package.json +12 -10
package/README.md
CHANGED
|
@@ -239,6 +239,25 @@ O hook só pode ser usado dentro de `BemonyPaymentFormProvider`.
|
|
|
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.
|
|
241
241
|
|
|
242
|
+
## Bandeiras de cartão habilitadas
|
|
243
|
+
|
|
244
|
+
Não passe uma lista de bandeiras por prop. A CheckoutSession é a autoridade e o Card Frame aplica
|
|
245
|
+
a configuração. Se uma projeção legada estiver ausente ou inválida, o frame assume apenas `VISA` e
|
|
246
|
+
`MASTERCARD` para preservar esses pagamentos; nenhuma outra rede é habilitada por esse fallback.
|
|
247
|
+
Quando a bandeira detectada não é aceita, `onCardStateChange` informa `valid: false` e nenhum token
|
|
248
|
+
é criado; desabilite o botão enquanto o estado for inválido.
|
|
249
|
+
|
|
250
|
+
```tsx
|
|
251
|
+
<BemonyPaymentForm
|
|
252
|
+
clientSecret={sessionClientSecret}
|
|
253
|
+
onCardStateChange={(state) => setCanPay(state.valid)}
|
|
254
|
+
/>
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Caso `pay()` seja chamado, capture `PaymentFormError.code === 'CARD_BRAND_NOT_SUPPORTED'`. É uma
|
|
258
|
+
falha local, `retryable: true`, classificada como `VALIDATION` em `CARD_TOKENIZATION`; o usuário
|
|
259
|
+
pode corrigir o cartão sem gerar uma tentativa financeira.
|
|
260
|
+
|
|
242
261
|
## Versões da API
|
|
243
262
|
|
|
244
263
|
```tsx
|
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.2",
|
|
4
4
|
"description": "Official React adapter for the hosted Bemony Payment Form.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bemony",
|
|
@@ -33,8 +33,17 @@
|
|
|
33
33
|
"default": "./dist/index.js"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "node ../../scripts/clean-package-dist.mjs && tsc -p tsconfig.build.json && esbuild ./src/index.ts --bundle --format=esm --platform=browser --target=es2022 --packages=external --sourcemap --outfile=dist/index.js && pnpm run verify:dist",
|
|
38
|
+
"verify:dist": "node ../../scripts/verify-payment-form-react-package.mjs",
|
|
39
|
+
"prepack": "pnpm run build",
|
|
40
|
+
"prepublishOnly": "node ../../scripts/verify-payment-form-release-source.mjs @bemony/payment-form-react",
|
|
41
|
+
"lint": "eslint src",
|
|
42
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
43
|
+
"test": "vitest run --passWithNoTests"
|
|
44
|
+
},
|
|
36
45
|
"dependencies": {
|
|
37
|
-
"@bemony/payment-form": "^0.2.0-next.
|
|
46
|
+
"@bemony/payment-form": "^0.2.0-next.2"
|
|
38
47
|
},
|
|
39
48
|
"peerDependencies": {
|
|
40
49
|
"react": ">=19.0.0 <20.0.0",
|
|
@@ -46,12 +55,5 @@
|
|
|
46
55
|
"publishConfig": {
|
|
47
56
|
"registry": "https://registry.npmjs.org/",
|
|
48
57
|
"access": "public"
|
|
49
|
-
},
|
|
50
|
-
"scripts": {
|
|
51
|
-
"build": "node ../../scripts/clean-package-dist.mjs && tsc -p tsconfig.build.json && esbuild ./src/index.ts --bundle --format=esm --platform=browser --target=es2022 --packages=external --sourcemap --outfile=dist/index.js && pnpm run verify:dist",
|
|
52
|
-
"verify:dist": "node ../../scripts/verify-payment-form-react-package.mjs",
|
|
53
|
-
"lint": "eslint src",
|
|
54
|
-
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
55
|
-
"test": "vitest run --passWithNoTests"
|
|
56
58
|
}
|
|
57
|
-
}
|
|
59
|
+
}
|