@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.
@@ -25,7 +25,7 @@ function encode(value) {
25
25
  }
26
26
  function canonicalBillingAuthority(authority) {
27
27
  return encode({
28
- schemaVersion: authority.schemaVersion,
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
- schemaVersion: authority.schemaVersion,
36
+ schema_version: authority.schema_version,
37
37
  source: authority.source,
38
38
  quote: authority.quote,
39
39
  });
@@ -1,17 +1,2 @@
1
1
  "use strict";
2
- /**
3
- * A dispute — the card network holding a settled payment's money while a
4
- * cardholder contests it.
5
- *
6
- * Published because `payment_intent.disputed` and `payment_intent.dispute_closed`
7
- * carry it as their `data.object`. It was route-local at first, with the webhook
8
- * carrying the PaymentIntent and the detail reachable only through
9
- * `GET /v1/payment_intents/:id/disputes`. That was inconsistent with the reason
10
- * those two events exist: `disputed` is a DEADLINE, and a merchant who has to
11
- * make a second call to learn when evidence is due is a merchant who can miss it
12
- * while their integration is working exactly as documented.
13
- *
14
- * It is also what the provider does. Stripe's `charge.dispute.created` carries
15
- * the dispute, not the charge — the parity was half-applied.
16
- */
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // The one list contract (ADR 0014 D1), for every list endpoint.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/cjs/tax.js CHANGED
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TAX_LOCATION_EVIDENCE_TYPES = exports.TAX_REGISTRATION_SCHEMES = void 0;
2
4
  /**
3
5
  * Peable Tax — the wire contract.
4
6
  *
@@ -11,8 +13,6 @@
11
13
  *
12
14
  * Amounts are integers in the currency's minor unit, like the billing quote.
13
15
  */
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.TAX_LOCATION_EVIDENCE_TYPES = exports.TAX_REGISTRATION_SCHEMES = void 0;
16
16
  /** How a registration lets the seller collect. `standard`/`simplified` cover
17
17
  * one country; the EU One-Stop-Shop schemes cover every EU member state from
18
18
  * one identification state; the US is per state; Canadian PST/QST is per
@@ -20,7 +20,7 @@ function encode(value) {
20
20
  }
21
21
  export function canonicalBillingAuthority(authority) {
22
22
  return encode({
23
- schemaVersion: authority.schemaVersion,
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
- schemaVersion: authority.schemaVersion,
31
+ schema_version: authority.schema_version,
32
32
  source: authority.source,
33
33
  quote: authority.quote,
34
34
  });
@@ -1,16 +1 @@
1
- /**
2
- * A dispute — the card network holding a settled payment's money while a
3
- * cardholder contests it.
4
- *
5
- * Published because `payment_intent.disputed` and `payment_intent.dispute_closed`
6
- * carry it as their `data.object`. It was route-local at first, with the webhook
7
- * carrying the PaymentIntent and the detail reachable only through
8
- * `GET /v1/payment_intents/:id/disputes`. That was inconsistent with the reason
9
- * those two events exist: `disputed` is a DEADLINE, and a merchant who has to
10
- * make a second call to learn when evidence is due is a merchant who can miss it
11
- * while their integration is working exactly as documented.
12
- *
13
- * It is also what the provider does. Stripe's `charge.dispute.created` carries
14
- * the dispute, not the charge — the parity was half-applied.
15
- */
16
1
  export {};
@@ -0,0 +1,2 @@
1
+ // The one list contract (ADR 0014 D1), for every list endpoint.
2
+ export {};
@@ -1,6 +1,6 @@
1
1
  import type { BillingFinalInvoiceAuthority, BillingTaxQuote } from './billing';
2
- export declare function canonicalBillingAuthority(authority: Pick<BillingFinalInvoiceAuthority, 'schemaVersion' | 'source' | 'invoice' | 'method'>): string;
3
- export declare function canonicalBillingTaxQuote(authority: Pick<BillingTaxQuote, 'schemaVersion' | 'source' | 'quote'>): string;
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.
@@ -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
- providerCustomerId: string;
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
- providerPriceId: string;
20
- planId: string;
19
+ provider_price_id: string;
20
+ plan_id: string;
21
21
  interval: 'month' | 'year';
22
22
  currency: string;
23
- grossMinorUnits: number;
24
- taxTreatment: 'inclusive' | 'exclusive';
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
- taxQuotes: boolean;
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
- storeId: string;
44
- storeName: string;
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
- taxQuote?: BillingTaxQuote;
55
- providerCustomerId: string;
56
- providerPriceId: string;
57
- trialDays: number;
58
- returnUrl: string;
59
- storeId: string;
60
- planId: string;
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
- providerCustomerId: string;
64
- returnUrl: string;
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
- expiresAt: string;
69
+ expires_at: number;
70
70
  }
71
71
  /** Provider observations only. Consumers own plan/status/entitlement interpretation. */
72
72
  export interface BillingSubscription {
73
- providerSubscriptionId: string;
73
+ provider_subscription_id: string;
74
74
  /** Discovery only; invoice must still be read and proven paid. */
75
- latestInvoiceId?: string | null;
76
- providerCustomerId: string;
77
- providerPriceId: string;
78
- storeId: string;
79
- planId: string;
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
- cancelAtPeriodEnd: boolean;
84
- currentPeriodStart: string;
85
- currentPeriodEnd: string;
86
- trialEndsAt: string | null;
87
- cancelAt: string | null;
88
- cancelledAt: string | null;
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
- initialInvoiceId: string | null;
96
+ initial_invoice_id: string | null;
97
97
  id: string;
98
98
  status: 'open' | 'complete' | 'expired';
99
- storeId: string;
100
- planId: string;
101
- providerCustomerId: string;
102
- providerPriceId: string;
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
- chargeId: string;
109
- amountRefunded: string;
108
+ charge_id: string;
109
+ amount_refunded: string;
110
110
  state: 'paid' | 'fully_refunded' | 'partially_refunded';
111
111
  }
112
112
  export interface BillingPaidInvoice {
113
- invoiceId: string;
114
- lineId: string;
115
- paymentIntentId: string;
116
- providerSubscriptionId: string;
117
- providerCustomerId: string;
118
- providerPriceId: string;
119
- storeId: string;
120
- planId: string;
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
- amountPaid: string;
124
- netAmount: string | null;
125
- taxAmount: string | null;
126
- periodStart: string;
127
- periodEnd: string;
128
- paidAt: string;
129
- observedAt: string;
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
- invoiceId: string;
135
- paymentIntentId: string;
136
- customerId: string;
137
- subscriptionId: string;
138
- priceId: string;
139
- planId: string;
140
- merchantId: string;
141
- appId: string;
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
- grossMinorUnits: number;
149
- netMinorUnits: number;
150
- taxMinorUnits: number;
151
- merchantFeeMinorUnits: number;
152
- taxTreatment: 'inclusive' | 'exclusive';
153
- sellerId: string;
154
- invoiceIssuerId: string;
155
- taxQuoteId: string;
156
- customerLocationEvidenceId: string;
157
- taxRateEvidenceId: string;
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
- payerAccountId: string;
160
- beneficiaryAccountId: string;
161
- providerSubscriptionId: string;
162
- offerId: string;
163
- offerVersion: number;
164
- periodStart: string;
165
- periodEnd: string;
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
- issuedAt: string;
170
- expiresAt: string;
171
- faircoinQuote?: {
169
+ issued_at: number;
170
+ expires_at: number;
171
+ faircoin_quote?: {
172
172
  id: string;
173
- amountBaseUnits: string;
174
- quotedAt: string;
175
- expiresAt: string;
176
- roundingEvidenceId: string;
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
- taxLines?: BillingInvoiceTaxLine[];
180
+ tax_lines?: BillingInvoiceTaxLine[];
181
181
  }
182
182
  export interface BillingFinalInvoiceAuthority {
183
- schemaVersion: 1;
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
- keyId: string;
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
- authorizationId: string;
206
- payerAccountId: string;
207
- merchantId: string;
208
- appId: string;
209
- subscriptionId: string;
210
- planId: string;
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
- explicitConsent: true;
214
- consentEvidenceId: string;
215
- maximumAmountBaseUnits: string;
213
+ explicit_consent: true;
214
+ consent_evidence_id: string;
215
+ maximum_amount_base_units: string;
216
216
  interval: 'month';
217
- intervalCount: 1;
218
- startsAt: string;
219
- expiresAt: string;
220
- acceptedAt: string;
217
+ interval_count: 1;
218
+ starts_at: number;
219
+ expires_at: number;
220
+ accepted_at: number;
221
221
  }
222
222
  export interface BillingFaircoinRenewalRevocation {
223
- authorizationId: string;
224
- revokedAt: string;
225
- revocationEvidenceId: string;
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
- storeId: string;
233
- planId: string;
232
+ store_id: string;
233
+ plan_id: string;
234
234
  /** Selects one offer when a plan is sold at several prices. */
235
- providerPriceId?: string;
235
+ provider_price_id?: string;
236
236
  /** A `tax.location_evidence` id (`taxloc_…`) recorded for this `storeId`. */
237
- customerLocationEvidenceId: string;
237
+ customer_location_evidence_id: string;
238
238
  }
239
239
  export interface BillingTaxQuote {
240
- schemaVersion: 1;
240
+ schema_version: 2;
241
241
  source: {
242
- merchantId: string;
243
- appId: string;
244
- storeId: string;
245
- planId: string;
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
- grossMinorUnits: number;
253
- netMinorUnits: number;
254
- taxMinorUnits: number;
255
- taxTreatment: 'inclusive' | 'exclusive';
256
- sellerId: string;
257
- invoiceIssuerId: string;
258
- taxRemitterId: string;
259
- taxServiceRef: string;
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
- coverageEvidenceId: string;
262
- taxRateEvidenceId: string;
263
- customerLocationEvidenceId: string;
264
- quotedAt: string;
265
- expiresAt: string;
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
- keyId: string;
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
- idempotencyKey: string;
277
- providerCustomerId: string;
278
- providerPriceId: string;
279
- storeId: string;
280
- planId: string;
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
- taxQuoteId: string | null;
284
- merchantId: string;
285
- appId: string;
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
- expiresAt: string;
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
- grossMinorUnits: number;
305
- amountBaseUnits: string;
306
- usdPerFair: string;
304
+ gross_minor_units: number;
305
+ amount_base_units: string;
306
+ usd_per_fair: string;
307
307
  source: string;
308
- observedAt: string;
309
- quotedAt: string;
310
- expiresAt: string;
308
+ observed_at: number;
309
+ quoted_at: number;
310
+ expires_at: number;
311
311
  rounding: 'ceil_to_base_unit';
312
312
  }
@@ -3,30 +3,32 @@ import type { CurrencyCode } from './money';
3
3
  import type { NetworkType } from './network';
4
4
  import type { MerchantDisplay } from './merchantDisplay';
5
5
  import type { PaymentIntent, PaymentIntentRail } from './paymentIntent';
6
+ import type { ConnectedAccount } from './settlement';
6
7
  /** The merchant/SDK-facing DTO — returned on create and by merchant retrieve. */
7
8
  export interface CheckoutSession {
8
9
  id: string;
9
10
  object: 'checkout_session';
10
- paymentIntentId: string;
11
+ /** The wrapped payment's `pi_…`, or the {@link PaymentIntent} with `expand[]=payment_intent`. */
12
+ payment_intent: string | PaymentIntent;
11
13
  /** The wrapped intent's `client_secret`, returned to the merchant on create. */
12
- clientSecret: string;
14
+ client_secret: string;
13
15
  amount: string;
14
16
  currency: CurrencyCode;
15
17
  rail: PaymentIntentRail;
16
18
  /** FairCoin rail only; `null` on a card session. */
17
19
  network: NetworkType | null;
18
20
  /**
19
- * The seller the wrapped payment is made on behalf of (`ca_…`), or `null`
20
- * (ADR 0012 D5). Optional in the type for older fixtures; always sent.
21
+ * The seller the wrapped payment is made on behalf of (`ca_…`, or the
22
+ * object with `expand[]=connected_account`), or `null` (ADR 0012 D5).
21
23
  */
22
- connectedAccountId?: string | null;
24
+ connected_account: string | ConnectedAccount | null;
23
25
  metadata: Record<string, string>;
24
- successUrl?: string;
25
- cancelUrl?: string;
26
+ success_url?: string;
27
+ cancel_url?: string;
26
28
  /** Canonical `checkout.peable.to/c/<id>` URL. */
27
29
  url: string;
28
- createdAt: string;
29
- updatedAt: string;
30
+ created: number;
31
+ updated_at: number;
30
32
  }
31
33
  /**
32
34
  * What the checkout page loads at `/c/:id`, authorized by possession of the
@@ -36,13 +38,13 @@ export interface CheckoutSession {
36
38
  */
37
39
  export interface CheckoutSessionPublic {
38
40
  /** Frozen commercial USD price and exact FAIR settlement quote; no payer metadata. */
39
- billingQuote?: BillingFaircoinFxQuote;
41
+ billing_quote?: BillingFaircoinFxQuote;
40
42
  id: string;
41
43
  object: 'checkout_session';
42
- successUrl?: string;
43
- cancelUrl?: string;
44
+ success_url?: string;
45
+ cancel_url?: string;
44
46
  merchant: MerchantDisplay;
45
- paymentIntent: PaymentIntent;
47
+ payment_intent: PaymentIntent;
46
48
  }
47
49
  export interface CreateCheckoutSessionParams {
48
50
  amount: string;
@@ -53,8 +55,12 @@ export interface CreateCheckoutSessionParams {
53
55
  /** Defaults to `'FAIR'` on the faircoin rail; required on the card rail. */
54
56
  currency?: CurrencyCode;
55
57
  metadata?: Record<string, string>;
56
- successUrl?: string;
57
- cancelUrl?: string;
58
+ success_url?: string;
59
+ cancel_url?: string;
58
60
  /** Pay this seller (`ca_…`) rather than the merchant — see `CreatePaymentIntentParams.connectedAccount`. */
59
- connectedAccount?: string;
61
+ connected_account?: string;
62
+ }
63
+ /** `POST /v1/checkout_sessions/:id` — the merchant's `metadata`, as a patch. */
64
+ export interface UpdateCheckoutSessionParams {
65
+ metadata?: Record<string, string>;
60
66
  }
@@ -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
- accountId: string;
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
- expiresAt: string;
13
+ expires_at: number;
14
14
  /** Where to send the seller once the key is registered. */
15
- returnUrl: string;
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
- accountId: string;
25
+ account_id: string;
26
26
  status: 'active';
27
- returnUrl: string;
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
- expiresAt: string;
38
+ expires_at: number;
39
39
  }