@peable.to/shared-types 0.5.1 → 0.7.0
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/dist/cjs/billing-authority.js +2 -2
- package/dist/cjs/dispute.js +0 -15
- package/dist/cjs/list.js +3 -0
- package/dist/cjs/tax.js +2 -2
- package/dist/esm/billing-authority.js +2 -2
- package/dist/esm/dispute.js +0 -15
- package/dist/esm/list.js +2 -0
- package/dist/types/billing-authority.d.ts +2 -2
- package/dist/types/billing.d.ts +141 -141
- package/dist/types/checkoutSession.d.ts +22 -16
- package/dist/types/connect.d.ts +6 -6
- package/dist/types/dispute.d.ts +26 -25
- package/dist/types/event.d.ts +5 -5
- package/dist/types/index.d.ts +4 -3
- package/dist/types/list.d.ts +52 -0
- package/dist/types/merchant.d.ts +7 -7
- package/dist/types/merchantDisplay.d.ts +1 -1
- package/dist/types/paymentIntent.d.ts +23 -11
- package/dist/types/paymentLink.d.ts +15 -4
- package/dist/types/settlement.d.ts +41 -39
- package/dist/types/social.d.ts +6 -6
- package/dist/types/tax.d.ts +87 -90
- package/dist/types/webhookDelivery.d.ts +10 -10
- package/package.json +2 -2
package/dist/types/dispute.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PaymentIntent } from './paymentIntent';
|
|
1
2
|
/**
|
|
2
3
|
* A dispute — the card network holding a settled payment's money while a
|
|
3
4
|
* cardholder contests it.
|
|
@@ -25,8 +26,8 @@ export type DisputeStatus = 'needs_response' | 'under_review' | 'won' | 'lost';
|
|
|
25
26
|
export interface Dispute {
|
|
26
27
|
id: string;
|
|
27
28
|
object: 'dispute';
|
|
28
|
-
/** The
|
|
29
|
-
|
|
29
|
+
/** The disputed payment's `pi_…`, or the {@link PaymentIntent} with `expand[]=payment_intent`. */
|
|
30
|
+
payment_intent: string | PaymentIntent;
|
|
30
31
|
/**
|
|
31
32
|
* Amount in the currency's smallest unit as a canonical integer string —
|
|
32
33
|
* the same encoding every other money field on these contracts uses.
|
|
@@ -47,15 +48,15 @@ export interface Dispute {
|
|
|
47
48
|
*/
|
|
48
49
|
reason: string | null;
|
|
49
50
|
/**
|
|
50
|
-
* When the network stops accepting evidence,
|
|
51
|
+
* When the network stops accepting evidence, Unix seconds.
|
|
51
52
|
*
|
|
52
53
|
* `null` once the dispute is closed — there is no deadline for a decision
|
|
53
54
|
* already made, and a closed dispute still showing one would put a response
|
|
54
55
|
* in front of a merchant that can no longer be given.
|
|
55
56
|
*/
|
|
56
|
-
|
|
57
|
+
evidence_due_at: number | null;
|
|
57
58
|
/**
|
|
58
|
-
* When the merchant's response reached the network,
|
|
59
|
+
* When the merchant's response reached the network, Unix seconds. `null` while
|
|
59
60
|
* none has been submitted.
|
|
60
61
|
*
|
|
61
62
|
* The timestamp and nothing else: the evidence itself is forwarded to the
|
|
@@ -66,9 +67,9 @@ export interface Dispute {
|
|
|
66
67
|
* Together with `evidenceDueAt` it answers the only two questions a merchant
|
|
67
68
|
* has about a live dispute: whether they still owe a response, and by when.
|
|
68
69
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
evidence_submitted_at: number | null;
|
|
71
|
+
created: number;
|
|
72
|
+
updated_at: number;
|
|
72
73
|
}
|
|
73
74
|
/**
|
|
74
75
|
* A merchant's response to a dispute — the whole field set, declared once.
|
|
@@ -104,21 +105,21 @@ export interface Dispute {
|
|
|
104
105
|
* forgotten. What is recorded is `evidenceSubmittedAt` and nothing more.
|
|
105
106
|
*/
|
|
106
107
|
export interface DisputeEvidence {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
108
|
+
product_description?: string;
|
|
109
|
+
customer_name?: string;
|
|
110
|
+
customer_email_address?: string;
|
|
111
|
+
customer_purchase_ip?: string;
|
|
112
|
+
billing_address?: string;
|
|
113
|
+
shipping_address?: string;
|
|
114
|
+
shipping_carrier?: string;
|
|
115
|
+
shipping_date?: string;
|
|
116
|
+
shipping_tracking_number?: string;
|
|
117
|
+
service_date?: string;
|
|
118
|
+
access_activity_log?: string;
|
|
119
|
+
cancellation_policy_disclosure?: string;
|
|
120
|
+
cancellation_rebuttal?: string;
|
|
121
|
+
duplicate_charge_explanation?: string;
|
|
122
|
+
refund_policy_disclosure?: string;
|
|
123
|
+
refund_refusal_explanation?: string;
|
|
124
|
+
uncategorized_text?: string;
|
|
124
125
|
}
|
package/dist/types/event.d.ts
CHANGED
|
@@ -71,10 +71,10 @@ export type WebhookEventType = 'payment_intent.confirming' | 'payment_intent.set
|
|
|
71
71
|
/** Wake-up only. Re-read the owner-bound SDK resource; this is never paid or grant authority. */
|
|
72
72
|
export interface BillingObservation {
|
|
73
73
|
object: 'billing_observation';
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
resource_kind: 'subscription' | 'invoice';
|
|
75
|
+
resource_id: string;
|
|
76
76
|
revision: number;
|
|
77
|
-
|
|
77
|
+
observed_at: number;
|
|
78
78
|
}
|
|
79
79
|
export interface WebhookEventPayload {
|
|
80
80
|
'billing.observation.updated': BillingObservation;
|
|
@@ -97,7 +97,7 @@ export interface WebhookEventPayload {
|
|
|
97
97
|
*
|
|
98
98
|
* ```ts
|
|
99
99
|
* if (event.type === 'payment_intent.disputed') {
|
|
100
|
-
* event.data.object.
|
|
100
|
+
* event.data.object.evidence_due_at; // Dispute, not PaymentIntent
|
|
101
101
|
* }
|
|
102
102
|
* ```
|
|
103
103
|
*
|
|
@@ -116,7 +116,7 @@ export type WebhookEvent<K extends WebhookEventType = WebhookEventType> = {
|
|
|
116
116
|
id: string;
|
|
117
117
|
object: 'event';
|
|
118
118
|
type: T;
|
|
119
|
-
created:
|
|
119
|
+
created: number;
|
|
120
120
|
/**
|
|
121
121
|
* The connected account (`ca_…`) this event is about — Stripe's
|
|
122
122
|
* `event.account` (ADR 0012 D7). Present on every event for an on-behalf
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { UNITS_PER_COIN, isBaseUnitString, type CurrencyCode, CURRENCY_CODES, CURRENCY_DECIMALS, decimalsFor, isCurrencyCode, } from './money';
|
|
2
2
|
export type { NetworkType } from './network';
|
|
3
|
-
export
|
|
3
|
+
export type { ExpandParams, List, ListParams, RangeQuery } from './list';
|
|
4
|
+
export { type PaymentIntentStatus, type PaymentIntentRail, type PaymentIntent, type CreatePaymentIntentParams, type UpdatePaymentIntentParams, isValidStatusTransition, canStillBePaid, reachesSettlementFromPayer, POST_SETTLEMENT_STATUSES, PAYMENT_INTENT_STATUSES, PAYMENT_INTENT_RAILS, CHAIN_ONLY_STATUSES, CARD_ONLY_STATUSES, EXPIRABLE_STATUSES, canExpire, } from './paymentIntent';
|
|
4
5
|
export type { WebhookEventType, WebhookEvent, WebhookEventPayload, BillingObservation, } from './event';
|
|
5
6
|
export type { Dispute, DisputeEvidence, DisputeStatus } from './dispute';
|
|
6
7
|
export type { CapabilityStatus, ConnectedAccount, ConnectedAccountFaircoin, ConnectedAccountFaircoinStatus, ConnectedAccountRail, Refund, RefundOrigin, RefundStatus, Settlement, Transfer, TransferReversal, TransferReversalStatus, TransferStatus, TransferWithReversal, } from './settlement';
|
|
@@ -9,8 +10,8 @@ export { signWebhook, verifyWebhook } from './webhookSigner';
|
|
|
9
10
|
export { type MerchantEnvironment, type Merchant, MERCHANT_ENVIRONMENTS, } from './merchant';
|
|
10
11
|
export type { MerchantDisplay } from './merchantDisplay';
|
|
11
12
|
export type { AccountLink, ConnectOnboarding, ConnectOnboardingComplete, RegisterFaircoinKeyParams, } from './connect';
|
|
12
|
-
export type { PaymentLink, PublicPaymentLink, CreatePaymentLinkParams, } from './paymentLink';
|
|
13
|
-
export type { CheckoutSession, CheckoutSessionPublic, CreateCheckoutSessionParams, } from './checkoutSession';
|
|
13
|
+
export type { PaymentLink, PublicPaymentLink, CreatePaymentLinkParams, UpdatePaymentLinkParams, } from './paymentLink';
|
|
14
|
+
export type { CheckoutSession, CheckoutSessionPublic, CreateCheckoutSessionParams, UpdateCheckoutSessionParams, } from './checkoutSession';
|
|
14
15
|
export { SOCIAL_SOURCE_APP_MAX_LENGTH, SOCIAL_SOURCE_REF_MAX_LENGTH, type SocialPaymentSource, type SocialNextAddressRequest, type SocialNextAddressResponse, type SocialReceiveCursorResponse, type SocialPaymentDirection, type SocialPayment, type SocialPaymentsResponse, type EnrichmentKind, type EnrichmentResult, type EnrichRequest, type EnrichResponse, } from './social';
|
|
15
16
|
export { BILLING_SUBSCRIPTION_STATUSES, type BillingSubscriptionStatus, type CreateBillingTaxQuoteParams, type BillingTaxQuote, type BillingInvoiceAuthoritySource, type BillingFinalInvoice, type BillingFinalInvoiceAuthority, type BillingFaircoinRenewalChoice, type BillingFaircoinRenewalConsent, type BillingFaircoinRenewalRevocation, type BillingCheckoutSession, type BillingCheckoutObservation, type RetrieveBillingCheckoutOperationParams, type BillingCheckoutOperationSource, type BillingCheckoutOperationRecovery, type BillingPaidInvoice, type BillingInvoiceState, type BillingCustomer, type BillingRail, type BillingRailSettlement, type BillingRailOffer, type BillingRailOption, type BillingRailList, type EnsureBillingCustomerParams, type CreateBillingCheckoutParams, type CreateBillingPortalParams, type BillingHostedSession, type BillingSubscription, } from './billing';
|
|
16
17
|
export { canonicalBillingAuthority, canonicalBillingTaxQuote, PEABLE_BILLING_AUTHORITY_KEYS, } from './billing-authority';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One page of a list, newest first.
|
|
3
|
+
*
|
|
4
|
+
* `url` is the path that was listed (`/v1/payment_intents`,
|
|
5
|
+
* `/v1/payment_intents/pi_…/refunds`), so a page carries enough to fetch the
|
|
6
|
+
* next one without the caller remembering where it came from.
|
|
7
|
+
*/
|
|
8
|
+
export interface List<T> {
|
|
9
|
+
object: 'list';
|
|
10
|
+
data: T[];
|
|
11
|
+
/** Whether another page exists in the direction this one was read. */
|
|
12
|
+
has_more: boolean;
|
|
13
|
+
url: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A range over an integer Unix-seconds field, Stripe's `created[gt]=…` form.
|
|
17
|
+
* Each bound is optional; together they are a conjunction.
|
|
18
|
+
*/
|
|
19
|
+
export interface RangeQuery {
|
|
20
|
+
gt?: number;
|
|
21
|
+
gte?: number;
|
|
22
|
+
lt?: number;
|
|
23
|
+
lte?: number;
|
|
24
|
+
}
|
|
25
|
+
/** The parameters every list accepts. A route adds its own filters beside them. */
|
|
26
|
+
export interface ListParams {
|
|
27
|
+
/** 1–100. Default 10. */
|
|
28
|
+
limit?: number;
|
|
29
|
+
/**
|
|
30
|
+
* The id of the LAST object of the previous page: the next page is the
|
|
31
|
+
* objects older than it. Mutually exclusive with `ending_before`.
|
|
32
|
+
*/
|
|
33
|
+
starting_after?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The id of the FIRST object of the current page: the page returned is the
|
|
36
|
+
* objects newer than it, still newest first, with `has_more` saying whether
|
|
37
|
+
* there are newer ones still.
|
|
38
|
+
*/
|
|
39
|
+
ending_before?: string;
|
|
40
|
+
/** Exactly this second (`number`), or a range. Unix seconds. */
|
|
41
|
+
created?: number | RangeQuery;
|
|
42
|
+
/**
|
|
43
|
+
* Expand references into objects, `data.`-prefixed on a list
|
|
44
|
+
* (`['data.payment_intent']`). At most four levels deep.
|
|
45
|
+
*/
|
|
46
|
+
expand?: string[];
|
|
47
|
+
}
|
|
48
|
+
/** The parameter a single read or write accepts to expand its answer. */
|
|
49
|
+
export interface ExpandParams {
|
|
50
|
+
/** Dot paths, at most four levels deep (`['payment_intent.connected_account']`). */
|
|
51
|
+
expand?: string[];
|
|
52
|
+
}
|
package/dist/types/merchant.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type MerchantEnvironment = (typeof MERCHANT_ENVIRONMENTS)[number];
|
|
|
4
4
|
export interface Merchant {
|
|
5
5
|
id: string;
|
|
6
6
|
object: 'merchant';
|
|
7
|
-
|
|
7
|
+
oxy_app_id: string;
|
|
8
8
|
environment: MerchantEnvironment;
|
|
9
9
|
/**
|
|
10
10
|
* The FairCoin chain this merchant accepts on — `null` on a CARD-ONLY
|
|
@@ -18,20 +18,20 @@ export interface Merchant {
|
|
|
18
18
|
network: NetworkType | null;
|
|
19
19
|
/** `null` on a card-only merchant. Nullable together with `network`. */
|
|
20
20
|
xpub: string | null;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
webhook_url?: string;
|
|
22
|
+
required_confirmations: number;
|
|
23
23
|
/**
|
|
24
24
|
* Payer-facing branding. Absent when unset — `MerchantDisplay` is what a
|
|
25
25
|
* payer surface renders, and it substitutes a neutral fallback; these are
|
|
26
26
|
* the raw values the merchant owns.
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
display_name?: string;
|
|
29
29
|
/**
|
|
30
30
|
* Bare Oxy file id, not a URL. `MerchantDisplay.avatarUrl` resolves it.
|
|
31
31
|
* Absent again once Oxy reports the file deleted or taken down.
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
avatar_file_id?: string;
|
|
34
34
|
description?: string;
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
created: number;
|
|
36
|
+
updated_at: number;
|
|
37
37
|
}
|
|
@@ -2,6 +2,6 @@ export interface MerchantDisplay {
|
|
|
2
2
|
/** `Merchant.displayName`, or a neutral fallback when unset. */
|
|
3
3
|
name: string;
|
|
4
4
|
/** Resolved server-side via the canonical media chokepoint; `null` when the merchant has no avatar. */
|
|
5
|
-
|
|
5
|
+
avatar_url: string | null;
|
|
6
6
|
description: string | null;
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ConnectedAccount } from './settlement';
|
|
1
2
|
import type { CurrencyCode } from './money';
|
|
2
3
|
import type { NetworkType } from './network';
|
|
3
4
|
/**
|
|
@@ -89,26 +90,26 @@ export interface PaymentIntent {
|
|
|
89
90
|
* FairCoin rail only; `null` on a card payment, which reserves no address.
|
|
90
91
|
*/
|
|
91
92
|
address: string | null;
|
|
92
|
-
|
|
93
|
+
merchant_id: string;
|
|
93
94
|
/**
|
|
94
95
|
* The seller this payment is made ON BEHALF OF (`ca_…`), or `null` for a
|
|
95
96
|
* payment to the merchant itself (ADR 0012 D5). On-behalf payments are
|
|
96
97
|
* FairCoin only, and `address` derives from that seller's own key.
|
|
97
98
|
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
99
|
+
* The seller's `ca_…`, or the {@link ConnectedAccount} itself when the
|
|
100
|
+
* request asked for `expand[]=connected_account`.
|
|
100
101
|
*/
|
|
101
|
-
|
|
102
|
+
connected_account: string | ConnectedAccount | null;
|
|
102
103
|
txid: string | null;
|
|
103
104
|
/** On-chain confirmations. Structurally `0` for the whole life of a card payment. */
|
|
104
105
|
confirmations: number;
|
|
105
|
-
|
|
106
|
+
client_secret: string;
|
|
106
107
|
metadata: Record<string, string>;
|
|
107
108
|
/**
|
|
108
109
|
* When an UNPAID intent expires. Meaningful only while {@link canExpire}
|
|
109
110
|
* is true for `status` — see `canExpire` below.
|
|
110
111
|
*/
|
|
111
|
-
|
|
112
|
+
expires_at: number;
|
|
112
113
|
/**
|
|
113
114
|
* Whether this intent can still expire (ADR 0012 D9). `false` once the payer
|
|
114
115
|
* has reported a broadcast: a FairCoin payment that is `broadcast` or
|
|
@@ -117,9 +118,9 @@ export interface PaymentIntent {
|
|
|
117
118
|
* Optional in the type only for fixtures written against earlier versions;
|
|
118
119
|
* a gateway at this version always sends it.
|
|
119
120
|
*/
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
can_expire?: boolean;
|
|
122
|
+
created: number;
|
|
123
|
+
updated_at: number;
|
|
123
124
|
}
|
|
124
125
|
export interface CreatePaymentIntentParams {
|
|
125
126
|
/** Amount in the currency's smallest unit, as a canonical integer string. */
|
|
@@ -134,7 +135,7 @@ export interface CreatePaymentIntentParams {
|
|
|
134
135
|
/** Defaults to `'FAIR'` on the faircoin rail; required on the card rail. */
|
|
135
136
|
currency?: CurrencyCode;
|
|
136
137
|
metadata?: Record<string, string>;
|
|
137
|
-
|
|
138
|
+
expires_in_seconds?: number;
|
|
138
139
|
/**
|
|
139
140
|
* Create the payment ON BEHALF OF this connected account (`ca_…`) — the
|
|
140
141
|
* address derives from the seller's own key and the coins go straight to
|
|
@@ -142,5 +143,16 @@ export interface CreatePaymentIntentParams {
|
|
|
142
143
|
* is refused. The account's FairCoin half must be `active` and `network`
|
|
143
144
|
* must be the account's network.
|
|
144
145
|
*/
|
|
145
|
-
|
|
146
|
+
connected_account?: string;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* `POST /v1/payment_intents/:id`. Only the merchant's own `metadata` is
|
|
150
|
+
* mutable on an intent: everything else is either the payment itself or the
|
|
151
|
+
* state machine's, which moves only through its own operations.
|
|
152
|
+
*
|
|
153
|
+
* `metadata` is a PATCH: named keys are set, a key sent as `""` is removed,
|
|
154
|
+
* keys not named are kept.
|
|
155
|
+
*/
|
|
156
|
+
export interface UpdatePaymentIntentParams {
|
|
157
|
+
metadata?: Record<string, string>;
|
|
146
158
|
}
|
|
@@ -20,11 +20,11 @@ export interface PaymentLink {
|
|
|
20
20
|
active: boolean;
|
|
21
21
|
metadata: Record<string, string>;
|
|
22
22
|
/** Optional post-payment redirect target for the checkout page. */
|
|
23
|
-
|
|
23
|
+
success_url?: string;
|
|
24
24
|
/** Canonical `checkout.peable.to/l/<id>` URL. */
|
|
25
25
|
url: string;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
created: number;
|
|
27
|
+
updated_at: number;
|
|
28
28
|
}
|
|
29
29
|
/** What an unauthenticated checkout-page visitor may see — no secrets, no metadata. */
|
|
30
30
|
export interface PublicPaymentLink {
|
|
@@ -47,5 +47,16 @@ export interface CreatePaymentLinkParams {
|
|
|
47
47
|
/** Defaults to `'FAIR'` on the faircoin rail; required on the card rail. */
|
|
48
48
|
currency?: CurrencyCode;
|
|
49
49
|
metadata?: Record<string, string>;
|
|
50
|
-
|
|
50
|
+
success_url?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* `POST /v1/payment_links/:id`. `amount`/`network` are deliberately absent — a
|
|
54
|
+
* link's price is immutable once shared.
|
|
55
|
+
*/
|
|
56
|
+
export interface UpdatePaymentLinkParams {
|
|
57
|
+
active?: boolean;
|
|
58
|
+
/** A patch: named keys are set, `""` removes a key, others are kept. */
|
|
59
|
+
metadata?: Record<string, string>;
|
|
60
|
+
/** `null` removes it. */
|
|
61
|
+
success_url?: string | null;
|
|
51
62
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CurrencyCode } from './money';
|
|
2
2
|
import type { NetworkType } from './network';
|
|
3
|
+
import type { PaymentIntent } from './paymentIntent';
|
|
3
4
|
/** How a provider reports one capability on a seller's account. */
|
|
4
5
|
export type CapabilityStatus = 'active' | 'pending' | 'inactive';
|
|
5
6
|
/** Where one settlement stands. */
|
|
@@ -35,15 +36,15 @@ export interface ConnectedAccountFaircoin {
|
|
|
35
36
|
network: NetworkType;
|
|
36
37
|
status: ConnectedAccountFaircoinStatus;
|
|
37
38
|
/** The Oxy user who may register the key — and, once `active`, who did. */
|
|
38
|
-
|
|
39
|
+
oxy_user_id: string;
|
|
39
40
|
/** When the seller registered their key. `null` while `pending`. */
|
|
40
|
-
|
|
41
|
+
registered_at: number | null;
|
|
41
42
|
}
|
|
42
43
|
export interface ConnectedAccount {
|
|
43
44
|
id: string;
|
|
44
45
|
object: 'connected_account';
|
|
45
46
|
/** The merchant's OWN id for this seller — how they address it. */
|
|
46
|
-
|
|
47
|
+
external_ref: string;
|
|
47
48
|
/** Which halves this account has. Never empty. */
|
|
48
49
|
rails: readonly ConnectedAccountRail[];
|
|
49
50
|
/**
|
|
@@ -57,7 +58,7 @@ export interface ConnectedAccount {
|
|
|
57
58
|
* no card half and was never asked for one (ADR 0012 D1).
|
|
58
59
|
*/
|
|
59
60
|
country: string | null;
|
|
60
|
-
|
|
61
|
+
default_currency: string | null;
|
|
61
62
|
/**
|
|
62
63
|
* Whether this seller can receive a CARD settlement (a transfer) right now.
|
|
63
64
|
* Always `false` on a FairCoin-only seller.
|
|
@@ -68,40 +69,40 @@ export interface ConnectedAccount {
|
|
|
68
69
|
* question that belongs to the merchant.
|
|
69
70
|
*/
|
|
70
71
|
payable: boolean;
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
payouts_enabled: boolean;
|
|
73
|
+
charges_enabled: boolean;
|
|
73
74
|
/**
|
|
74
75
|
* `null` means the capability was never REQUESTED, which is a different fact
|
|
75
76
|
* from the provider declining it (`inactive`). Collapsing the two makes "why
|
|
76
77
|
* is this seller stuck" unanswerable.
|
|
77
78
|
*/
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
transfers_capability: CapabilityStatus | null;
|
|
80
|
+
card_payments_capability: CapabilityStatus | null;
|
|
80
81
|
/**
|
|
81
82
|
* COUNTS of outstanding requirements, never the requirements themselves and
|
|
82
83
|
* never their values. The gateway records that a seller owes a document; it
|
|
83
84
|
* does not learn what the document says.
|
|
84
85
|
*/
|
|
85
86
|
requirements: {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
currently_due: number;
|
|
88
|
+
eventually_due: number;
|
|
89
|
+
past_due: number;
|
|
90
|
+
pending_verification: number;
|
|
90
91
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
disabled_reason_codes: readonly string[];
|
|
93
|
+
last_synced_at: number | null;
|
|
94
|
+
created: number;
|
|
95
|
+
updated_at: number;
|
|
95
96
|
}
|
|
96
97
|
export interface Transfer {
|
|
97
98
|
id: string;
|
|
98
99
|
object: 'transfer';
|
|
99
100
|
/** The merchant's OWN id for what this settles. Their idempotency. */
|
|
100
|
-
|
|
101
|
-
/** The `ca_…`
|
|
102
|
-
|
|
103
|
-
/** The `pi_…` this settlement was funded by
|
|
104
|
-
|
|
101
|
+
external_ref: string;
|
|
102
|
+
/** The seller's `ca_…` — never their account id at the provider — or the object, expanded. */
|
|
103
|
+
connected_account: string | ConnectedAccount;
|
|
104
|
+
/** The `pi_…` this settlement was funded by, or the {@link PaymentIntent}, expanded. */
|
|
105
|
+
payment_intent: string | PaymentIntent;
|
|
105
106
|
amount: string;
|
|
106
107
|
currency: string;
|
|
107
108
|
/**
|
|
@@ -111,11 +112,11 @@ export interface Transfer {
|
|
|
111
112
|
* add up reversals it may not have all seen, which is why this is the
|
|
112
113
|
* provider's own total rather than a sum of the reversals below.
|
|
113
114
|
*/
|
|
114
|
-
|
|
115
|
+
amount_reversed: string;
|
|
115
116
|
status: TransferStatus;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
failure_message: string | null;
|
|
118
|
+
created: number;
|
|
119
|
+
updated_at: number;
|
|
119
120
|
}
|
|
120
121
|
/**
|
|
121
122
|
* One reversal operation, returned beside the settlement it acted on.
|
|
@@ -128,12 +129,12 @@ export interface TransferReversal {
|
|
|
128
129
|
id: string;
|
|
129
130
|
object: 'transfer_reversal';
|
|
130
131
|
/** The merchant's own id for this reversal — their `Idempotency-Key`. */
|
|
131
|
-
|
|
132
|
+
external_ref: string;
|
|
132
133
|
amount: string;
|
|
133
134
|
currency: string;
|
|
134
135
|
status: TransferReversalStatus;
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
failure_message: string | null;
|
|
137
|
+
created: number;
|
|
137
138
|
}
|
|
138
139
|
/** What `POST /v1/transfers/:id/reversals` answers: the transfer, and the leg. */
|
|
139
140
|
export interface TransferWithReversal extends Transfer {
|
|
@@ -163,8 +164,8 @@ export interface TransferWithReversal extends Transfer {
|
|
|
163
164
|
*/
|
|
164
165
|
export interface Settlement {
|
|
165
166
|
object: 'settlement';
|
|
166
|
-
/** The `pi_…` this describes
|
|
167
|
-
|
|
167
|
+
/** The `pi_…` this describes, or the {@link PaymentIntent} with `expand[]=payment_intent`. */
|
|
168
|
+
payment_intent: string | PaymentIntent;
|
|
168
169
|
/**
|
|
169
170
|
* - `available` — settled; these figures are final.
|
|
170
171
|
* - `pending` — a settlement record exists and is not final yet.
|
|
@@ -177,10 +178,10 @@ export interface Settlement {
|
|
|
177
178
|
net: string | null;
|
|
178
179
|
/** The SETTLEMENT currency, which may differ from the payment's. */
|
|
179
180
|
currency: string | null;
|
|
180
|
-
/** When the funds become available,
|
|
181
|
-
|
|
181
|
+
/** When the funds become available, Unix seconds. */
|
|
182
|
+
available_on: number | null;
|
|
182
183
|
/** Present only when a conversion happened. `null` is not a rate of 1. */
|
|
183
|
-
|
|
184
|
+
exchange_rate: number | null;
|
|
184
185
|
}
|
|
185
186
|
/** Where one refund stands — the MONEY's own lifecycle, not the payment's. */
|
|
186
187
|
export type RefundStatus = 'pending' | 'succeeded' | 'failed';
|
|
@@ -196,9 +197,10 @@ export interface Refund {
|
|
|
196
197
|
id: string;
|
|
197
198
|
object: 'refund';
|
|
198
199
|
/** `null` on an IMPORTED refund; see {@link RefundOrigin}. */
|
|
199
|
-
|
|
200
|
+
external_ref: string | null;
|
|
200
201
|
origin: RefundOrigin;
|
|
201
|
-
|
|
202
|
+
/** The refunded payment's `pi_…`, or the {@link PaymentIntent} with `expand[]=payment_intent`. */
|
|
203
|
+
payment_intent: string | PaymentIntent;
|
|
202
204
|
amount: string;
|
|
203
205
|
currency: CurrencyCode | string;
|
|
204
206
|
status: RefundStatus;
|
|
@@ -210,8 +212,8 @@ export interface Refund {
|
|
|
210
212
|
* them re-read the intent is a round trip whose answer can move on before it
|
|
211
213
|
* arrives.
|
|
212
214
|
*/
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
payment_status: string;
|
|
216
|
+
failure_code: string | null;
|
|
217
|
+
created: number;
|
|
218
|
+
updated_at: number;
|
|
217
219
|
}
|
package/dist/types/social.d.ts
CHANGED
|
@@ -78,7 +78,7 @@ export interface SocialReceiveCursorResponse {
|
|
|
78
78
|
* `SOCIAL_RECEIVE_FIRST_FRESH_INDEX - 1`, since index 0 itself is the
|
|
79
79
|
* caller's stable default address and is never reserved through this flow.
|
|
80
80
|
*/
|
|
81
|
-
|
|
81
|
+
reserved_through: number;
|
|
82
82
|
/**
|
|
83
83
|
* The identity public key (hex) those addresses were derived from, as the
|
|
84
84
|
* backend saw it. A device compares it with the key it derives from itself:
|
|
@@ -88,7 +88,7 @@ export interface SocialReceiveCursorResponse {
|
|
|
88
88
|
* `null` means exactly one thing: this caller has no cursor, so no address
|
|
89
89
|
* has ever been reserved for them. Every cursor that exists names its key.
|
|
90
90
|
*/
|
|
91
|
-
|
|
91
|
+
identity_public_key: string | null;
|
|
92
92
|
}
|
|
93
93
|
/** Where a transaction's counterparty identity came from (spec §4.8). */
|
|
94
94
|
export type EnrichmentKind = 'merchant' | 'user' | 'unknown';
|
|
@@ -100,9 +100,9 @@ export type EnrichmentKind = 'merchant' | 'user' | 'unknown';
|
|
|
100
100
|
export interface EnrichmentResult {
|
|
101
101
|
kind: EnrichmentKind;
|
|
102
102
|
/** Merchant name or user's `name.displayName ?? handle`. */
|
|
103
|
-
|
|
103
|
+
display_name?: string;
|
|
104
104
|
/** Bare Oxy file id — render via the canonical media chokepoint, never a URL. */
|
|
105
|
-
|
|
105
|
+
avatar_file_id?: string;
|
|
106
106
|
/** Present for `kind: 'user'` only. */
|
|
107
107
|
username?: string;
|
|
108
108
|
/** Present for `kind: 'merchant'` only. */
|
|
@@ -151,8 +151,8 @@ export interface SocialPayment {
|
|
|
151
151
|
* than dropping the payment.
|
|
152
152
|
*/
|
|
153
153
|
source?: SocialPaymentSource;
|
|
154
|
-
/**
|
|
155
|
-
|
|
154
|
+
/** Unix seconds. When the address was minted, which is when the payment was set up. */
|
|
155
|
+
created: number;
|
|
156
156
|
}
|
|
157
157
|
/** Response of `GET /v1/social/me/payments`, newest first. */
|
|
158
158
|
export interface SocialPaymentsResponse {
|