@vitrindigital/node 0.5.0 → 0.5.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 +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -196,6 +196,14 @@ consulta `GET /transactions/{transaction_id}/` por até ~60 s (após 2, 4, 8,
|
|
|
196
196
|
| recusada pelo emissor | lança `VitrinRefusedError`, como o `422` |
|
|
197
197
|
| ainda incerta no fim do prazo (ou consulta falhando) | lança `VitrinServerError` com `payment_status: "processing"` e `transaction_id` no `body` |
|
|
198
198
|
|
|
199
|
+
A recusa montada pela consulta tem a mesma classe (`VitrinRefusedError`),
|
|
200
|
+
`code`, `retryable` e `customerMessage` do `422`, tirados do `refusal` da
|
|
201
|
+
transação. Duas diferenças: o `body` do erro é a **transação** (o objeto do
|
|
202
|
+
`GET /transactions/{id}/`), não o corpo do `422`, então `err.body.return_code`
|
|
203
|
+
não existe ali (use `err.code` ou `err.body.refusal`); e o `message` vem de
|
|
204
|
+
`refusal.description`. Se o processador não informou o código, o `code` vem
|
|
205
|
+
`undefined` e a classe continua `VitrinRefusedError`: a cobrança chegou ao emissor.
|
|
206
|
+
|
|
199
207
|
O prazo é configurável: `new Vitrin({ apiKey, uncertainWaitMs: 30_000 })`;
|
|
200
208
|
`uncertainWaitMs: 0` desliga a consulta e lança o erro na hora. Uma falha na
|
|
201
209
|
consulta não conta como "não cobrado": o SDK segue consultando até o prazo.
|
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -84,8 +84,7 @@ declare class VitrinClient {
|
|
|
84
84
|
*/
|
|
85
85
|
/** ISO 4217. BRL é o default histórico; USD/EUR/GBP habilitados com orgs LLC. */
|
|
86
86
|
type Currency = 'BRL' | 'USD' | 'EUR' | 'GBP';
|
|
87
|
-
/** Tipo jurídico da organização
|
|
88
|
-
* LLC = Stripe Connect (US/internacional). */
|
|
87
|
+
/** Tipo jurídico da organização: `cnpj` (Brasil) ou `llc` (EUA/internacional). */
|
|
89
88
|
type EntityType = 'cnpj' | 'llc';
|
|
90
89
|
/**
|
|
91
90
|
* Métodos de pagamento suportados pela plataforma.
|
|
@@ -103,7 +102,7 @@ type EntityType = 'cnpj' | 'llc';
|
|
|
103
102
|
type PaymentMethod = 'PIX' | 'PIX_AUTOMATIC' | 'BOLETO' | 'CREDIT_CARD' | 'CARD_INTERNATIONAL' | 'ACH_DEBIT' | 'SEPA_DEBIT' | 'APPLE_PAY' | 'GOOGLE_PAY' | 'KLARNA' | 'AFTERPAY';
|
|
104
103
|
type TransactionStatus = 'pending' | 'confirmed' | 'received' | 'overdue' | 'refunded' | 'chargeback' | 'failed' | 'canceled';
|
|
105
104
|
/**
|
|
106
|
-
* Representa a organização
|
|
105
|
+
* Representa a organização dona da API key em uso.
|
|
107
106
|
*
|
|
108
107
|
* Nota: `default_currency` é derivado de `entity_type` no backend e pode
|
|
109
108
|
* ainda não estar exposto pelo serializer — a declaração aqui é
|
package/dist/index.d.ts
CHANGED
|
@@ -84,8 +84,7 @@ declare class VitrinClient {
|
|
|
84
84
|
*/
|
|
85
85
|
/** ISO 4217. BRL é o default histórico; USD/EUR/GBP habilitados com orgs LLC. */
|
|
86
86
|
type Currency = 'BRL' | 'USD' | 'EUR' | 'GBP';
|
|
87
|
-
/** Tipo jurídico da organização
|
|
88
|
-
* LLC = Stripe Connect (US/internacional). */
|
|
87
|
+
/** Tipo jurídico da organização: `cnpj` (Brasil) ou `llc` (EUA/internacional). */
|
|
89
88
|
type EntityType = 'cnpj' | 'llc';
|
|
90
89
|
/**
|
|
91
90
|
* Métodos de pagamento suportados pela plataforma.
|
|
@@ -103,7 +102,7 @@ type EntityType = 'cnpj' | 'llc';
|
|
|
103
102
|
type PaymentMethod = 'PIX' | 'PIX_AUTOMATIC' | 'BOLETO' | 'CREDIT_CARD' | 'CARD_INTERNATIONAL' | 'ACH_DEBIT' | 'SEPA_DEBIT' | 'APPLE_PAY' | 'GOOGLE_PAY' | 'KLARNA' | 'AFTERPAY';
|
|
104
103
|
type TransactionStatus = 'pending' | 'confirmed' | 'received' | 'overdue' | 'refunded' | 'chargeback' | 'failed' | 'canceled';
|
|
105
104
|
/**
|
|
106
|
-
* Representa a organização
|
|
105
|
+
* Representa a organização dona da API key em uso.
|
|
107
106
|
*
|
|
108
107
|
* Nota: `default_currency` é derivado de `entity_type` no backend e pode
|
|
109
108
|
* ainda não estar exposto pelo serializer — a declaração aqui é
|
package/dist/index.js
CHANGED