@peable.to/shared-types 0.5.1 → 0.6.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/esm/billing-authority.js +2 -2
- package/dist/types/billing-authority.d.ts +2 -2
- package/dist/types/billing.d.ts +141 -141
- package/dist/types/checkoutSession.d.ts +14 -14
- package/dist/types/connect.d.ts +6 -6
- package/dist/types/dispute.d.ts +24 -24
- package/dist/types/event.d.ts +5 -5
- package/dist/types/merchant.d.ts +7 -7
- package/dist/types/merchantDisplay.d.ts +1 -1
- package/dist/types/paymentIntent.d.ts +9 -9
- package/dist/types/paymentLink.d.ts +4 -4
- package/dist/types/settlement.d.ts +36 -36
- package/dist/types/social.d.ts +6 -6
- package/dist/types/tax.d.ts +85 -83
- package/dist/types/webhookDelivery.d.ts +10 -10
- package/package.json +2 -2
|
@@ -25,7 +25,7 @@ function encode(value) {
|
|
|
25
25
|
}
|
|
26
26
|
function canonicalBillingAuthority(authority) {
|
|
27
27
|
return encode({
|
|
28
|
-
|
|
28
|
+
schema_version: authority.schema_version,
|
|
29
29
|
source: authority.source,
|
|
30
30
|
invoice: authority.invoice,
|
|
31
31
|
method: authority.method,
|
|
@@ -33,7 +33,7 @@ function canonicalBillingAuthority(authority) {
|
|
|
33
33
|
}
|
|
34
34
|
function canonicalBillingTaxQuote(authority) {
|
|
35
35
|
return encode({
|
|
36
|
-
|
|
36
|
+
schema_version: authority.schema_version,
|
|
37
37
|
source: authority.source,
|
|
38
38
|
quote: authority.quote,
|
|
39
39
|
});
|
|
@@ -20,7 +20,7 @@ function encode(value) {
|
|
|
20
20
|
}
|
|
21
21
|
export function canonicalBillingAuthority(authority) {
|
|
22
22
|
return encode({
|
|
23
|
-
|
|
23
|
+
schema_version: authority.schema_version,
|
|
24
24
|
source: authority.source,
|
|
25
25
|
invoice: authority.invoice,
|
|
26
26
|
method: authority.method,
|
|
@@ -28,7 +28,7 @@ export function canonicalBillingAuthority(authority) {
|
|
|
28
28
|
}
|
|
29
29
|
export function canonicalBillingTaxQuote(authority) {
|
|
30
30
|
return encode({
|
|
31
|
-
|
|
31
|
+
schema_version: authority.schema_version,
|
|
32
32
|
source: authority.source,
|
|
33
33
|
quote: authority.quote,
|
|
34
34
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BillingFinalInvoiceAuthority, BillingTaxQuote } from './billing';
|
|
2
|
-
export declare function canonicalBillingAuthority(authority: Pick<BillingFinalInvoiceAuthority, '
|
|
3
|
-
export declare function canonicalBillingTaxQuote(authority: Pick<BillingTaxQuote, '
|
|
2
|
+
export declare function canonicalBillingAuthority(authority: Pick<BillingFinalInvoiceAuthority, 'schema_version' | 'source' | 'invoice' | 'method'>): string;
|
|
3
|
+
export declare function canonicalBillingTaxQuote(authority: Pick<BillingTaxQuote, 'schema_version' | 'source' | 'quote'>): string;
|
|
4
4
|
/**
|
|
5
5
|
* The PUBLIC halves of the Ed25519 keys production Peable signs billing
|
|
6
6
|
* authority with (signed tax quotes and final invoice authorities), by key id.
|
package/dist/types/billing.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { BillingInvoiceTaxLine } from './tax';
|
|
|
4
4
|
export declare const BILLING_SUBSCRIPTION_STATUSES: readonly ["incomplete", "incomplete_expired", "trialing", "active", "past_due", "canceled", "unpaid", "paused"];
|
|
5
5
|
export type BillingSubscriptionStatus = (typeof BILLING_SUBSCRIPTION_STATUSES)[number];
|
|
6
6
|
export interface BillingCustomer {
|
|
7
|
-
|
|
7
|
+
provider_customer_id: string;
|
|
8
8
|
}
|
|
9
9
|
/** A settlement rail a merchant's recurring offers can be paid through. `stripe`
|
|
10
10
|
* (and any further fiat provider) settles in fiat; `faircoin` settles natively
|
|
@@ -16,12 +16,12 @@ export type BillingRailSettlement = 'fiat' | 'faircoin';
|
|
|
16
16
|
/** One offer a rail can sell. Fiat provider rails bind their prices from the
|
|
17
17
|
* app's own provider catalogue, so they list `offers: null`. */
|
|
18
18
|
export interface BillingRailOffer {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
provider_price_id: string;
|
|
20
|
+
plan_id: string;
|
|
21
21
|
interval: 'month' | 'year';
|
|
22
22
|
currency: string;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
gross_minor_units: number;
|
|
24
|
+
tax_treatment: 'inclusive' | 'exclusive';
|
|
25
25
|
}
|
|
26
26
|
export interface BillingRailOption {
|
|
27
27
|
rail: BillingRail;
|
|
@@ -29,7 +29,7 @@ export interface BillingRailOption {
|
|
|
29
29
|
/** The rail a request that names none is served by: the first configured. */
|
|
30
30
|
default: boolean;
|
|
31
31
|
/** Whether `createTaxQuote` is answered for this rail. */
|
|
32
|
-
|
|
32
|
+
tax_quotes: boolean;
|
|
33
33
|
/** `automatic`: the provider charges each period. `payer_initiated`: each
|
|
34
34
|
* period is an explicit payment through `renewSubscription`. */
|
|
35
35
|
renewal: 'automatic' | 'payer_initiated';
|
|
@@ -40,8 +40,8 @@ export interface BillingRailList {
|
|
|
40
40
|
data: BillingRailOption[];
|
|
41
41
|
}
|
|
42
42
|
export interface EnsureBillingCustomerParams {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
store_id: string;
|
|
44
|
+
store_name: string;
|
|
45
45
|
/** The payer's chosen rail. Omitted: the merchant's default rail. A customer
|
|
46
46
|
* belongs to one rail, and its checkouts and subscriptions follow it. */
|
|
47
47
|
rail?: BillingRail;
|
|
@@ -51,41 +51,41 @@ export interface CreateBillingCheckoutParams {
|
|
|
51
51
|
rail?: BillingRail;
|
|
52
52
|
/** Opt-in fiscal checkout. The full signed quote is immutable and single-use.
|
|
53
53
|
* Requires a trusted Peable adapter capable of applying these exact amounts. */
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
tax_quote?: BillingTaxQuote;
|
|
55
|
+
provider_customer_id: string;
|
|
56
|
+
provider_price_id: string;
|
|
57
|
+
trial_days: number;
|
|
58
|
+
return_url: string;
|
|
59
|
+
store_id: string;
|
|
60
|
+
plan_id: string;
|
|
61
61
|
}
|
|
62
62
|
export interface CreateBillingPortalParams {
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
provider_customer_id: string;
|
|
64
|
+
return_url: string;
|
|
65
65
|
}
|
|
66
66
|
/** Sensitive owner-only URL. The gateway refuses replay after expiresAt. */
|
|
67
67
|
export interface BillingHostedSession {
|
|
68
68
|
url: string;
|
|
69
|
-
|
|
69
|
+
expires_at: number;
|
|
70
70
|
}
|
|
71
71
|
/** Provider observations only. Consumers own plan/status/entitlement interpretation. */
|
|
72
72
|
export interface BillingSubscription {
|
|
73
|
-
|
|
73
|
+
provider_subscription_id: string;
|
|
74
74
|
/** Discovery only; invoice must still be read and proven paid. */
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
latest_invoice_id?: string | null;
|
|
76
|
+
provider_customer_id: string;
|
|
77
|
+
provider_price_id: string;
|
|
78
|
+
store_id: string;
|
|
79
|
+
plan_id: string;
|
|
80
80
|
livemode: boolean;
|
|
81
81
|
status: BillingSubscriptionStatus;
|
|
82
82
|
interval: 'month' | 'year';
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
cancel_at_period_end: boolean;
|
|
84
|
+
current_period_start: number;
|
|
85
|
+
current_period_end: number;
|
|
86
|
+
trial_ends_at: number | null;
|
|
87
|
+
cancel_at: number | null;
|
|
88
|
+
cancelled_at: number | null;
|
|
89
89
|
}
|
|
90
90
|
/** Owned recurring checkout correlation; completing checkout is not paid evidence. */
|
|
91
91
|
export interface BillingCheckoutSession extends BillingHostedSession {
|
|
@@ -93,101 +93,101 @@ export interface BillingCheckoutSession extends BillingHostedSession {
|
|
|
93
93
|
}
|
|
94
94
|
export interface BillingCheckoutObservation {
|
|
95
95
|
/** Immutable subscription_create invoice proven for this exact checkout. Discovery only, never paid authority. */
|
|
96
|
-
|
|
96
|
+
initial_invoice_id: string | null;
|
|
97
97
|
id: string;
|
|
98
98
|
status: 'open' | 'complete' | 'expired';
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
store_id: string;
|
|
100
|
+
plan_id: string;
|
|
101
|
+
provider_customer_id: string;
|
|
102
|
+
provider_price_id: string;
|
|
103
103
|
subscription: BillingSubscription | null;
|
|
104
104
|
}
|
|
105
105
|
/** Authenticated authoritative read, one settled full non-prorated line only.
|
|
106
106
|
* Tax figures are provider observations, not a tax quote or seller configuration. */
|
|
107
107
|
export interface BillingInvoiceState extends BillingPaidInvoice {
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
charge_id: string;
|
|
109
|
+
amount_refunded: string;
|
|
110
110
|
state: 'paid' | 'fully_refunded' | 'partially_refunded';
|
|
111
111
|
}
|
|
112
112
|
export interface BillingPaidInvoice {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
113
|
+
invoice_id: string;
|
|
114
|
+
line_id: string;
|
|
115
|
+
payment_intent_id: string;
|
|
116
|
+
provider_subscription_id: string;
|
|
117
|
+
provider_customer_id: string;
|
|
118
|
+
provider_price_id: string;
|
|
119
|
+
store_id: string;
|
|
120
|
+
plan_id: string;
|
|
121
121
|
livemode: boolean;
|
|
122
122
|
currency: string;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
amount_paid: string;
|
|
124
|
+
net_amount: string | null;
|
|
125
|
+
tax_amount: string | null;
|
|
126
|
+
period_start: number;
|
|
127
|
+
period_end: number;
|
|
128
|
+
paid_at: number;
|
|
129
|
+
observed_at: number;
|
|
130
130
|
}
|
|
131
131
|
/** Provider-independent fiscal evidence. Values come from the configured authority,
|
|
132
132
|
* never from invoice amounts, merchant metadata, or an application tax guess. */
|
|
133
133
|
export interface BillingInvoiceAuthoritySource {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
invoice_id: string;
|
|
135
|
+
payment_intent_id: string;
|
|
136
|
+
customer_id: string;
|
|
137
|
+
subscription_id: string;
|
|
138
|
+
price_id: string;
|
|
139
|
+
plan_id: string;
|
|
140
|
+
merchant_id: string;
|
|
141
|
+
app_id: string;
|
|
142
142
|
mode: 'test' | 'live';
|
|
143
143
|
environment: 'development' | 'staging' | 'production';
|
|
144
144
|
}
|
|
145
145
|
export interface BillingFinalInvoice {
|
|
146
146
|
platform: 'peable';
|
|
147
147
|
currency: string;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
148
|
+
gross_minor_units: number;
|
|
149
|
+
net_minor_units: number;
|
|
150
|
+
tax_minor_units: number;
|
|
151
|
+
merchant_fee_minor_units: number;
|
|
152
|
+
tax_treatment: 'inclusive' | 'exclusive';
|
|
153
|
+
seller_id: string;
|
|
154
|
+
invoice_issuer_id: string;
|
|
155
|
+
tax_quote_id: string;
|
|
156
|
+
customer_location_evidence_id: string;
|
|
157
|
+
tax_rate_evidence_id: string;
|
|
158
158
|
context: {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
159
|
+
payer_account_id: string;
|
|
160
|
+
beneficiary_account_id: string;
|
|
161
|
+
provider_subscription_id: string;
|
|
162
|
+
offer_id: string;
|
|
163
|
+
offer_version: number;
|
|
164
|
+
period_start: number;
|
|
165
|
+
period_end: number;
|
|
166
166
|
mode: 'test' | 'live';
|
|
167
167
|
environment: 'development' | 'staging' | 'production';
|
|
168
168
|
};
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
issued_at: number;
|
|
170
|
+
expires_at: number;
|
|
171
|
+
faircoin_quote?: {
|
|
172
172
|
id: string;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
amount_base_units: string;
|
|
174
|
+
quoted_at: number;
|
|
175
|
+
expires_at: number;
|
|
176
|
+
rounding_evidence_id: string;
|
|
177
177
|
};
|
|
178
178
|
/** Present only when requested (`include: ['tax_lines']`): the frozen
|
|
179
179
|
* Peable Tax lines behind `taxMinorUnits`, covered by the same signature. */
|
|
180
|
-
|
|
180
|
+
tax_lines?: BillingInvoiceTaxLine[];
|
|
181
181
|
}
|
|
182
182
|
export interface BillingFinalInvoiceAuthority {
|
|
183
|
-
|
|
183
|
+
schema_version: 2;
|
|
184
184
|
source: BillingInvoiceAuthoritySource;
|
|
185
185
|
invoice: BillingFinalInvoice;
|
|
186
186
|
method: 'card' | 'faircoin';
|
|
187
187
|
/** Versioned canonical payload: source, invoice and method after strict schema parsing. */
|
|
188
188
|
signature: {
|
|
189
189
|
algorithm: 'Ed25519';
|
|
190
|
-
|
|
190
|
+
key_id: string;
|
|
191
191
|
value: string;
|
|
192
192
|
};
|
|
193
193
|
}
|
|
@@ -202,87 +202,87 @@ export type BillingFaircoinRenewalChoice = {
|
|
|
202
202
|
consent: BillingFaircoinRenewalConsent;
|
|
203
203
|
};
|
|
204
204
|
export interface BillingFaircoinRenewalConsent {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
205
|
+
authorization_id: string;
|
|
206
|
+
payer_account_id: string;
|
|
207
|
+
merchant_id: string;
|
|
208
|
+
app_id: string;
|
|
209
|
+
subscription_id: string;
|
|
210
|
+
plan_id: string;
|
|
211
211
|
mode: 'test' | 'live';
|
|
212
212
|
environment: 'development' | 'staging' | 'production';
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
explicit_consent: true;
|
|
214
|
+
consent_evidence_id: string;
|
|
215
|
+
maximum_amount_base_units: string;
|
|
216
216
|
interval: 'month';
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
interval_count: 1;
|
|
218
|
+
starts_at: number;
|
|
219
|
+
expires_at: number;
|
|
220
|
+
accepted_at: number;
|
|
221
221
|
}
|
|
222
222
|
export interface BillingFaircoinRenewalRevocation {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
223
|
+
authorization_id: string;
|
|
224
|
+
revoked_at: number;
|
|
225
|
+
revocation_evidence_id: string;
|
|
226
226
|
}
|
|
227
227
|
/** A merchant asks Peable to quote a registered product. Monetary/fiscal
|
|
228
228
|
* configuration is resolved inside Peable, never supplied by a consumer. */
|
|
229
229
|
export interface CreateBillingTaxQuoteParams {
|
|
230
230
|
/** Omitted: the first of the merchant's rails that answers tax quotes. */
|
|
231
231
|
rail?: BillingRail;
|
|
232
|
-
|
|
233
|
-
|
|
232
|
+
store_id: string;
|
|
233
|
+
plan_id: string;
|
|
234
234
|
/** Selects one offer when a plan is sold at several prices. */
|
|
235
|
-
|
|
235
|
+
provider_price_id?: string;
|
|
236
236
|
/** A `tax.location_evidence` id (`taxloc_…`) recorded for this `storeId`. */
|
|
237
|
-
|
|
237
|
+
customer_location_evidence_id: string;
|
|
238
238
|
}
|
|
239
239
|
export interface BillingTaxQuote {
|
|
240
|
-
|
|
240
|
+
schema_version: 2;
|
|
241
241
|
source: {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
242
|
+
merchant_id: string;
|
|
243
|
+
app_id: string;
|
|
244
|
+
store_id: string;
|
|
245
|
+
plan_id: string;
|
|
246
246
|
mode: 'test' | 'live';
|
|
247
247
|
environment: 'development' | 'staging' | 'production';
|
|
248
248
|
};
|
|
249
249
|
quote: {
|
|
250
250
|
id: string;
|
|
251
251
|
currency: string;
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
252
|
+
gross_minor_units: number;
|
|
253
|
+
net_minor_units: number;
|
|
254
|
+
tax_minor_units: number;
|
|
255
|
+
tax_treatment: 'inclusive' | 'exclusive';
|
|
256
|
+
seller_id: string;
|
|
257
|
+
invoice_issuer_id: string;
|
|
258
|
+
tax_remitter_id: string;
|
|
259
|
+
tax_service_ref: string;
|
|
260
260
|
country: string;
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
261
|
+
coverage_evidence_id: string;
|
|
262
|
+
tax_rate_evidence_id: string;
|
|
263
|
+
customer_location_evidence_id: string;
|
|
264
|
+
quoted_at: number;
|
|
265
|
+
expires_at: number;
|
|
266
266
|
};
|
|
267
267
|
signature: {
|
|
268
268
|
algorithm: 'Ed25519';
|
|
269
|
-
|
|
269
|
+
key_id: string;
|
|
270
270
|
value: string;
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
273
|
/** Read-only recovery of one previously attempted recurring checkout. Neither
|
|
274
274
|
* absence nor uncertainty permits cancellation or another financial operation. */
|
|
275
275
|
export interface RetrieveBillingCheckoutOperationParams {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
276
|
+
idempotency_key: string;
|
|
277
|
+
provider_customer_id: string;
|
|
278
|
+
provider_price_id: string;
|
|
279
|
+
store_id: string;
|
|
280
|
+
plan_id: string;
|
|
281
281
|
}
|
|
282
282
|
export interface BillingCheckoutOperationSource extends RetrieveBillingCheckoutOperationParams {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
283
|
+
tax_quote_id: string | null;
|
|
284
|
+
merchant_id: string;
|
|
285
|
+
app_id: string;
|
|
286
286
|
mode: 'test' | 'live';
|
|
287
287
|
environment: 'development' | 'staging' | 'production';
|
|
288
288
|
}
|
|
@@ -294,19 +294,19 @@ export type BillingCheckoutOperationRecovery = {
|
|
|
294
294
|
source: BillingCheckoutOperationSource;
|
|
295
295
|
checkout: {
|
|
296
296
|
id: string;
|
|
297
|
-
|
|
297
|
+
expires_at: number;
|
|
298
298
|
url?: string;
|
|
299
299
|
};
|
|
300
300
|
};
|
|
301
301
|
export interface BillingFaircoinFxQuote {
|
|
302
302
|
id: string;
|
|
303
303
|
currency: 'USD';
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
304
|
+
gross_minor_units: number;
|
|
305
|
+
amount_base_units: string;
|
|
306
|
+
usd_per_fair: string;
|
|
307
307
|
source: string;
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
308
|
+
observed_at: number;
|
|
309
|
+
quoted_at: number;
|
|
310
|
+
expires_at: number;
|
|
311
311
|
rounding: 'ceil_to_base_unit';
|
|
312
312
|
}
|
|
@@ -7,9 +7,9 @@ import type { PaymentIntent, PaymentIntentRail } from './paymentIntent';
|
|
|
7
7
|
export interface CheckoutSession {
|
|
8
8
|
id: string;
|
|
9
9
|
object: 'checkout_session';
|
|
10
|
-
|
|
10
|
+
payment_intent_id: string;
|
|
11
11
|
/** The wrapped intent's `client_secret`, returned to the merchant on create. */
|
|
12
|
-
|
|
12
|
+
client_secret: string;
|
|
13
13
|
amount: string;
|
|
14
14
|
currency: CurrencyCode;
|
|
15
15
|
rail: PaymentIntentRail;
|
|
@@ -19,14 +19,14 @@ export interface CheckoutSession {
|
|
|
19
19
|
* The seller the wrapped payment is made on behalf of (`ca_…`), or `null`
|
|
20
20
|
* (ADR 0012 D5). Optional in the type for older fixtures; always sent.
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
connected_account_id?: string | null;
|
|
23
23
|
metadata: Record<string, string>;
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
success_url?: string;
|
|
25
|
+
cancel_url?: string;
|
|
26
26
|
/** Canonical `checkout.peable.to/c/<id>` URL. */
|
|
27
27
|
url: string;
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
created: number;
|
|
29
|
+
updated_at: number;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* What the checkout page loads at `/c/:id`, authorized by possession of the
|
|
@@ -36,13 +36,13 @@ export interface CheckoutSession {
|
|
|
36
36
|
*/
|
|
37
37
|
export interface CheckoutSessionPublic {
|
|
38
38
|
/** Frozen commercial USD price and exact FAIR settlement quote; no payer metadata. */
|
|
39
|
-
|
|
39
|
+
billing_quote?: BillingFaircoinFxQuote;
|
|
40
40
|
id: string;
|
|
41
41
|
object: 'checkout_session';
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
success_url?: string;
|
|
43
|
+
cancel_url?: string;
|
|
44
44
|
merchant: MerchantDisplay;
|
|
45
|
-
|
|
45
|
+
payment_intent: PaymentIntent;
|
|
46
46
|
}
|
|
47
47
|
export interface CreateCheckoutSessionParams {
|
|
48
48
|
amount: string;
|
|
@@ -53,8 +53,8 @@ export interface CreateCheckoutSessionParams {
|
|
|
53
53
|
/** Defaults to `'FAIR'` on the faircoin rail; required on the card rail. */
|
|
54
54
|
currency?: CurrencyCode;
|
|
55
55
|
metadata?: Record<string, string>;
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
success_url?: string;
|
|
57
|
+
cancel_url?: string;
|
|
58
58
|
/** Pay this seller (`ca_…`) rather than the merchant — see `CreatePaymentIntentParams.connectedAccount`. */
|
|
59
|
-
|
|
59
|
+
connected_account?: string;
|
|
60
60
|
}
|
package/dist/types/connect.d.ts
CHANGED
|
@@ -4,15 +4,15 @@ import type { NetworkType } from './network';
|
|
|
4
4
|
export interface ConnectOnboarding {
|
|
5
5
|
object: 'connect_onboarding';
|
|
6
6
|
/** The `ca_…` being onboarded. */
|
|
7
|
-
|
|
7
|
+
account_id: string;
|
|
8
8
|
/** Who is asking — the PLATFORM's public display, as a payer would see it. */
|
|
9
9
|
platform: MerchantDisplay;
|
|
10
10
|
/** The chain the seller will be paid on. Their key must be for this network. */
|
|
11
11
|
network: NetworkType;
|
|
12
12
|
/** When this link stops working. */
|
|
13
|
-
|
|
13
|
+
expires_at: number;
|
|
14
14
|
/** Where to send the seller once the key is registered. */
|
|
15
|
-
|
|
15
|
+
return_url: string;
|
|
16
16
|
}
|
|
17
17
|
/** `POST /v1/connect/onboarding/:token/faircoin` — the seller's watch-only ACCOUNT xpub. */
|
|
18
18
|
export interface RegisterFaircoinKeyParams {
|
|
@@ -22,9 +22,9 @@ export interface RegisterFaircoinKeyParams {
|
|
|
22
22
|
/** The answer to a successful registration. */
|
|
23
23
|
export interface ConnectOnboardingComplete {
|
|
24
24
|
object: 'connect_onboarding';
|
|
25
|
-
|
|
25
|
+
account_id: string;
|
|
26
26
|
status: 'active';
|
|
27
|
-
|
|
27
|
+
return_url: string;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* A FairCoin onboarding link, as the platform receives it from
|
|
@@ -35,5 +35,5 @@ export interface ConnectOnboardingComplete {
|
|
|
35
35
|
export interface AccountLink {
|
|
36
36
|
object: 'account_link';
|
|
37
37
|
url: string;
|
|
38
|
-
|
|
38
|
+
expires_at: number;
|
|
39
39
|
}
|
package/dist/types/dispute.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export interface Dispute {
|
|
|
26
26
|
id: string;
|
|
27
27
|
object: 'dispute';
|
|
28
28
|
/** The PUBLIC `pi_…` id, which is what every other contract here calls `id`. */
|
|
29
|
-
|
|
29
|
+
payment_intent_id: string;
|
|
30
30
|
/**
|
|
31
31
|
* Amount in the currency's smallest unit as a canonical integer string —
|
|
32
32
|
* the same encoding every other money field on these contracts uses.
|
|
@@ -47,15 +47,15 @@ export interface Dispute {
|
|
|
47
47
|
*/
|
|
48
48
|
reason: string | null;
|
|
49
49
|
/**
|
|
50
|
-
* When the network stops accepting evidence,
|
|
50
|
+
* When the network stops accepting evidence, Unix seconds.
|
|
51
51
|
*
|
|
52
52
|
* `null` once the dispute is closed — there is no deadline for a decision
|
|
53
53
|
* already made, and a closed dispute still showing one would put a response
|
|
54
54
|
* in front of a merchant that can no longer be given.
|
|
55
55
|
*/
|
|
56
|
-
|
|
56
|
+
evidence_due_at: number | null;
|
|
57
57
|
/**
|
|
58
|
-
* When the merchant's response reached the network,
|
|
58
|
+
* When the merchant's response reached the network, Unix seconds. `null` while
|
|
59
59
|
* none has been submitted.
|
|
60
60
|
*
|
|
61
61
|
* The timestamp and nothing else: the evidence itself is forwarded to the
|
|
@@ -66,9 +66,9 @@ export interface Dispute {
|
|
|
66
66
|
* Together with `evidenceDueAt` it answers the only two questions a merchant
|
|
67
67
|
* has about a live dispute: whether they still owe a response, and by when.
|
|
68
68
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
evidence_submitted_at: number | null;
|
|
70
|
+
created: number;
|
|
71
|
+
updated_at: number;
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* A merchant's response to a dispute — the whole field set, declared once.
|
|
@@ -104,21 +104,21 @@ export interface Dispute {
|
|
|
104
104
|
* forgotten. What is recorded is `evidenceSubmittedAt` and nothing more.
|
|
105
105
|
*/
|
|
106
106
|
export interface DisputeEvidence {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
107
|
+
product_description?: string;
|
|
108
|
+
customer_name?: string;
|
|
109
|
+
customer_email_address?: string;
|
|
110
|
+
customer_purchase_ip?: string;
|
|
111
|
+
billing_address?: string;
|
|
112
|
+
shipping_address?: string;
|
|
113
|
+
shipping_carrier?: string;
|
|
114
|
+
shipping_date?: string;
|
|
115
|
+
shipping_tracking_number?: string;
|
|
116
|
+
service_date?: string;
|
|
117
|
+
access_activity_log?: string;
|
|
118
|
+
cancellation_policy_disclosure?: string;
|
|
119
|
+
cancellation_rebuttal?: string;
|
|
120
|
+
duplicate_charge_explanation?: string;
|
|
121
|
+
refund_policy_disclosure?: string;
|
|
122
|
+
refund_refusal_explanation?: string;
|
|
123
|
+
uncategorized_text?: string;
|
|
124
124
|
}
|