@tuppence/node 0.1.0 → 0.1.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 -8
- package/dist/http.d.ts +1 -1
- package/dist/http.js +1 -1
- package/dist/index.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,12 +23,12 @@ for await (const payment of tuppence.payments.listAll({ limit: 100 })) {
|
|
|
23
23
|
|
|
24
24
|
## Retries are safe
|
|
25
25
|
|
|
26
|
-
Every POST carries an `Idempotency-Key
|
|
26
|
+
Every POST carries an `Idempotency-Key`: yours (`{ idempotencyKey }`) or a fresh one that is
|
|
27
27
|
**reused across that call's retries**. So when a request times out and is retried, the API does
|
|
28
28
|
it once: a refund is never made twice, a payment never charged twice.
|
|
29
29
|
|
|
30
30
|
The SDK retries network errors, timeouts, `429` (honouring `Retry-After`), `5xx` and `409
|
|
31
|
-
idempotency_in_progress`
|
|
31
|
+
idempotency_in_progress` (twice by default, with jittered backoff), and never a `4xx` that the
|
|
32
32
|
same request would get again.
|
|
33
33
|
|
|
34
34
|
```ts
|
|
@@ -64,7 +64,7 @@ try {
|
|
|
64
64
|
|
|
65
65
|
## Webhooks
|
|
66
66
|
|
|
67
|
-
Pass the **raw** body
|
|
67
|
+
Pass the **raw** body, not re-serialised JSON:
|
|
68
68
|
|
|
69
69
|
```ts
|
|
70
70
|
app.post("/webhooks", express.raw({ type: "application/json" }), (req, res) => {
|
|
@@ -85,7 +85,7 @@ payload the same way, for testing your handler.
|
|
|
85
85
|
## Tuppence Connect: acting as your connected accounts
|
|
86
86
|
|
|
87
87
|
A platform's connected accounts are full Tuppence accounts. Make one, send its owner onboarding,
|
|
88
|
-
then act as it with your own key
|
|
88
|
+
then act as it with your own key, per request or through a client bound to it:
|
|
89
89
|
|
|
90
90
|
```ts
|
|
91
91
|
const bella = await tuppence.accounts.create({ email: "bella@example.com", business_type: "individual" });
|
|
@@ -102,7 +102,7 @@ await tuppence.payments.create(
|
|
|
102
102
|
{ tuppenceAccount: bella.id },
|
|
103
103
|
);
|
|
104
104
|
|
|
105
|
-
// Or a client bound to her
|
|
105
|
+
// Or a client bound to her. It is a new one: `tuppence` itself is unchanged.
|
|
106
106
|
const asBella = tuppence.as(bella.id);
|
|
107
107
|
await asBella.bookings.list();
|
|
108
108
|
```
|
|
@@ -110,7 +110,7 @@ await asBella.bookings.list();
|
|
|
110
110
|
`tuppence.accounts.persons`, `.externalAccounts` and `.capabilities`, and `tuppence.files.create`
|
|
111
111
|
(a `Blob`, a buffer or a stream) are the rest of onboarding through your own forms.
|
|
112
112
|
`tuppence.applicationFees` (and `.refunds`) and `tuppence.transfers` (and `.reversals`) are the
|
|
113
|
-
money: your fees on your accounts' payments, and what you send them from your Connect balance
|
|
113
|
+
money: your fees on your accounts' payments, and what you send them from your Connect balance;
|
|
114
114
|
`tuppence.balance.listTransactions({ balance: "connect" })` lists its every movement. A Connect
|
|
115
115
|
webhook's event carries `event.account`: the connected account it happened on.
|
|
116
116
|
|
|
@@ -119,12 +119,12 @@ webhook's event carries `event.account`: the connected account it happened on.
|
|
|
119
119
|
`tuppence.payouts.settings()` says when money is paid out and what could change it;
|
|
120
120
|
`.instantQuote()` and `.create({ method: "instant" })` move pending money now, and
|
|
121
121
|
`.setNextDay({ enabled })` switches next-day payouts (UK) on or off once `next_day.available`
|
|
122
|
-
says so. `tuppence.account.retrievePricing()` is every price the account pays
|
|
122
|
+
says so. `tuppence.account.retrievePricing()` is every price the account pays: the list's, or
|
|
123
123
|
one agreed with Tuppence, with its dates.
|
|
124
124
|
|
|
125
125
|
## Types
|
|
126
126
|
|
|
127
|
-
Types are generated from the API's OpenAPI document, so they match the API exactly
|
|
127
|
+
Types are generated from the API's OpenAPI document, so they match the API exactly: a
|
|
128
128
|
misspelt field is a compile error, not a silently ignored parameter.
|
|
129
129
|
|
|
130
130
|
## Anything else
|
package/dist/http.d.ts
CHANGED
package/dist/http.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConnectionError, TuppenceError } from "./errors.js";
|
|
2
|
-
export const VERSION = "0.1.
|
|
2
|
+
export const VERSION = "0.1.1";
|
|
3
3
|
export const DEFAULT_API_VERSION = "2026-09-20";
|
|
4
4
|
/**
|
|
5
5
|
* A body already encoded — the multipart of `files.create` — sent as these exact bytes on every
|
package/dist/index.cjs
CHANGED
|
@@ -108,7 +108,7 @@ var SignatureVerificationError = class extends TuppenceError {
|
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
// src/http.ts
|
|
111
|
-
var VERSION = "0.1.
|
|
111
|
+
var VERSION = "0.1.1";
|
|
112
112
|
var DEFAULT_API_VERSION = "2026-09-20";
|
|
113
113
|
var EncodedBody = class {
|
|
114
114
|
constructor(bytes, contentType) {
|