@peable.to/shared-types 0.7.0 → 0.9.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/types/billing.d.ts +42 -0
- package/dist/types/checkoutSession.d.ts +10 -0
- package/dist/types/connect.d.ts +5 -0
- package/dist/types/dispute.d.ts +5 -0
- package/dist/types/event.d.ts +4 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/merchant.d.ts +5 -0
- package/dist/types/paymentIntent.d.ts +5 -0
- package/dist/types/paymentLink.d.ts +10 -0
- package/dist/types/settlement.d.ts +25 -0
- package/dist/types/webhookDelivery.d.ts +5 -0
- package/package.json +1 -1
package/dist/types/billing.d.ts
CHANGED
|
@@ -310,3 +310,45 @@ export interface BillingFaircoinFxQuote {
|
|
|
310
310
|
expires_at: number;
|
|
311
311
|
rounding: 'ceil_to_base_unit';
|
|
312
312
|
}
|
|
313
|
+
/** Durable embedded-session reference. Provider secrets are never persisted in it. */
|
|
314
|
+
export interface BillingEmbeddedCheckoutSession {
|
|
315
|
+
id: string;
|
|
316
|
+
presentation: 'embedded';
|
|
317
|
+
expires_at: number;
|
|
318
|
+
}
|
|
319
|
+
/** Ephemeral processor capability released only to the authenticated owning workload. */
|
|
320
|
+
export interface BillingEmbeddedCheckoutAction {
|
|
321
|
+
kind: 'checkout_session';
|
|
322
|
+
provider: 'stripe';
|
|
323
|
+
session_id: string;
|
|
324
|
+
client_secret: string;
|
|
325
|
+
publishable_key: string;
|
|
326
|
+
amount_minor_units: number;
|
|
327
|
+
currency: string;
|
|
328
|
+
}
|
|
329
|
+
export interface BillingEmbeddedCheckoutScope {
|
|
330
|
+
merchant_id: string;
|
|
331
|
+
app_id: string;
|
|
332
|
+
environment: 'development' | 'staging' | 'production';
|
|
333
|
+
mode: 'test' | 'live';
|
|
334
|
+
}
|
|
335
|
+
export interface BillingEmbeddedCheckoutConfiguration {
|
|
336
|
+
scope: BillingEmbeddedCheckoutScope;
|
|
337
|
+
publishable_key: string;
|
|
338
|
+
payment_methods: {
|
|
339
|
+
id: 'card';
|
|
340
|
+
available: boolean;
|
|
341
|
+
}[];
|
|
342
|
+
}
|
|
343
|
+
export interface BillingEmbeddedCheckoutBinding {
|
|
344
|
+
status: 'open' | 'complete' | 'expired';
|
|
345
|
+
action: BillingEmbeddedCheckoutAction | null;
|
|
346
|
+
scope: BillingEmbeddedCheckoutScope & {
|
|
347
|
+
store_id: string;
|
|
348
|
+
plan_id: string;
|
|
349
|
+
provider_customer_id: string;
|
|
350
|
+
provider_price_id: string;
|
|
351
|
+
};
|
|
352
|
+
tax_quote: BillingTaxQuote;
|
|
353
|
+
expires_at: number;
|
|
354
|
+
}
|
|
@@ -8,6 +8,11 @@ import type { ConnectedAccount } from './settlement';
|
|
|
8
8
|
export interface CheckoutSession {
|
|
9
9
|
id: string;
|
|
10
10
|
object: 'checkout_session';
|
|
11
|
+
/**
|
|
12
|
+
* Which of the provider's two worlds this object belongs to (ADR 0017):
|
|
13
|
+
* `true` for a `production` merchant, `false` for every other environment.
|
|
14
|
+
*/
|
|
15
|
+
livemode: boolean;
|
|
11
16
|
/** The wrapped payment's `pi_…`, or the {@link PaymentIntent} with `expand[]=payment_intent`. */
|
|
12
17
|
payment_intent: string | PaymentIntent;
|
|
13
18
|
/** The wrapped intent's `client_secret`, returned to the merchant on create. */
|
|
@@ -41,6 +46,11 @@ export interface CheckoutSessionPublic {
|
|
|
41
46
|
billing_quote?: BillingFaircoinFxQuote;
|
|
42
47
|
id: string;
|
|
43
48
|
object: 'checkout_session';
|
|
49
|
+
/**
|
|
50
|
+
* Which of the provider's two worlds this object belongs to (ADR 0017):
|
|
51
|
+
* `true` for a `production` merchant, `false` for every other environment.
|
|
52
|
+
*/
|
|
53
|
+
livemode: boolean;
|
|
44
54
|
success_url?: string;
|
|
45
55
|
cancel_url?: string;
|
|
46
56
|
merchant: MerchantDisplay;
|
package/dist/types/connect.d.ts
CHANGED
|
@@ -34,6 +34,11 @@ export interface ConnectOnboardingComplete {
|
|
|
34
34
|
*/
|
|
35
35
|
export interface AccountLink {
|
|
36
36
|
object: 'account_link';
|
|
37
|
+
/**
|
|
38
|
+
* Which of the provider's two worlds this object belongs to (ADR 0017):
|
|
39
|
+
* `true` for a `production` merchant, `false` for every other environment.
|
|
40
|
+
*/
|
|
41
|
+
livemode: boolean;
|
|
37
42
|
url: string;
|
|
38
43
|
expires_at: number;
|
|
39
44
|
}
|
package/dist/types/dispute.d.ts
CHANGED
|
@@ -26,6 +26,11 @@ export type DisputeStatus = 'needs_response' | 'under_review' | 'won' | 'lost';
|
|
|
26
26
|
export interface Dispute {
|
|
27
27
|
id: string;
|
|
28
28
|
object: 'dispute';
|
|
29
|
+
/**
|
|
30
|
+
* Which of the provider's two worlds this object belongs to (ADR 0017):
|
|
31
|
+
* `true` for a `production` merchant, `false` for every other environment.
|
|
32
|
+
*/
|
|
33
|
+
livemode: boolean;
|
|
29
34
|
/** The disputed payment's `pi_…`, or the {@link PaymentIntent} with `expand[]=payment_intent`. */
|
|
30
35
|
payment_intent: string | PaymentIntent;
|
|
31
36
|
/**
|
package/dist/types/event.d.ts
CHANGED
|
@@ -71,6 +71,8 @@ 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
|
+
/** The mode of the billing cohort observed (ADR 0017). */
|
|
75
|
+
livemode: boolean;
|
|
74
76
|
resource_kind: 'subscription' | 'invoice';
|
|
75
77
|
resource_id: string;
|
|
76
78
|
revision: number;
|
|
@@ -115,6 +117,8 @@ export type WebhookEvent<K extends WebhookEventType = WebhookEventType> = {
|
|
|
115
117
|
[T in K]: {
|
|
116
118
|
id: string;
|
|
117
119
|
object: 'event';
|
|
120
|
+
/** The mode of the merchant it was sent to, and of the object it carries (ADR 0017). */
|
|
121
|
+
livemode: boolean;
|
|
118
122
|
type: T;
|
|
119
123
|
created: number;
|
|
120
124
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type { AccountLink, ConnectOnboarding, ConnectOnboardingComplete, Registe
|
|
|
13
13
|
export type { PaymentLink, PublicPaymentLink, CreatePaymentLinkParams, UpdatePaymentLinkParams, } from './paymentLink';
|
|
14
14
|
export type { CheckoutSession, CheckoutSessionPublic, CreateCheckoutSessionParams, UpdateCheckoutSessionParams, } from './checkoutSession';
|
|
15
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';
|
|
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
|
+
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 BillingEmbeddedCheckoutSession, type BillingEmbeddedCheckoutConfiguration, type BillingEmbeddedCheckoutBinding, type BillingEmbeddedCheckoutAction, type BillingEmbeddedCheckoutScope, 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';
|
|
17
17
|
export { canonicalBillingAuthority, canonicalBillingTaxQuote, PEABLE_BILLING_AUTHORITY_KEYS, } from './billing-authority';
|
|
18
18
|
export type { BillingFaircoinFxQuote } from './billing';
|
|
19
19
|
export { TAX_REGISTRATION_SCHEMES, TAX_LOCATION_EVIDENCE_TYPES, type TaxRegistrationScheme, type TaxLocationEvidenceType, type TaxBehavior, type TaxAddress, type TaxCode, type TaxCalculationAccount, type TaxSettings, type UpdateTaxSettingsParams, type TaxRegistration, type CreateTaxRegistrationParams, type TaxProductCode, type TaxLocationEvidenceItem, type CreateTaxLocationEvidenceParams, type TaxLocationEvidence, type TaxLineItemParams, type CreateTaxCalculationParams, type TaxBreakdownEntry, type TaxCalculationLineItem, type TaxCalculation, type TaxTransaction, type TaxTransactionList, type TaxTransactionReversal, type CreateTaxReversalParams, type ListTaxTransactionsParams, type TaxReportRow, type TaxReport, type BillingInvoiceTaxLine, } from './tax';
|
package/dist/types/merchant.d.ts
CHANGED
|
@@ -4,6 +4,11 @@ export type MerchantEnvironment = (typeof MERCHANT_ENVIRONMENTS)[number];
|
|
|
4
4
|
export interface Merchant {
|
|
5
5
|
id: string;
|
|
6
6
|
object: 'merchant';
|
|
7
|
+
/**
|
|
8
|
+
* Which of the provider's two worlds this object belongs to (ADR 0017):
|
|
9
|
+
* `true` for a `production` merchant, `false` for every other environment.
|
|
10
|
+
*/
|
|
11
|
+
livemode: boolean;
|
|
7
12
|
oxy_app_id: string;
|
|
8
13
|
environment: MerchantEnvironment;
|
|
9
14
|
/**
|
|
@@ -73,6 +73,11 @@ export declare function canExpire(status: PaymentIntentStatus): boolean;
|
|
|
73
73
|
export interface PaymentIntent {
|
|
74
74
|
id: string;
|
|
75
75
|
object: 'payment_intent';
|
|
76
|
+
/**
|
|
77
|
+
* Which of the provider's two worlds this object belongs to (ADR 0017):
|
|
78
|
+
* `true` for a `production` merchant, `false` for every other environment.
|
|
79
|
+
*/
|
|
80
|
+
livemode: boolean;
|
|
76
81
|
status: PaymentIntentStatus;
|
|
77
82
|
/** Which rail moves this payment. Decides which fields below are populated. */
|
|
78
83
|
rail: PaymentIntentRail;
|
|
@@ -7,6 +7,11 @@ import type { PaymentIntentRail } from './paymentIntent';
|
|
|
7
7
|
export interface PaymentLink {
|
|
8
8
|
id: string;
|
|
9
9
|
object: 'payment_link';
|
|
10
|
+
/**
|
|
11
|
+
* Which of the provider's two worlds this object belongs to (ADR 0017):
|
|
12
|
+
* `true` for a `production` merchant, `false` for every other environment.
|
|
13
|
+
*/
|
|
14
|
+
livemode: boolean;
|
|
10
15
|
contribution?: ContributionDetails;
|
|
11
16
|
/**
|
|
12
17
|
* Amount in the currency's smallest unit, as a canonical integer string.
|
|
@@ -30,6 +35,11 @@ export interface PaymentLink {
|
|
|
30
35
|
export interface PublicPaymentLink {
|
|
31
36
|
id: string;
|
|
32
37
|
object: 'payment_link';
|
|
38
|
+
/**
|
|
39
|
+
* Which of the provider's two worlds this object belongs to (ADR 0017):
|
|
40
|
+
* `true` for a `production` merchant, `false` for every other environment.
|
|
41
|
+
*/
|
|
42
|
+
livemode: boolean;
|
|
33
43
|
contribution?: ContributionDetails;
|
|
34
44
|
amount: string;
|
|
35
45
|
currency: CurrencyCode;
|
|
@@ -43,6 +43,11 @@ export interface ConnectedAccountFaircoin {
|
|
|
43
43
|
export interface ConnectedAccount {
|
|
44
44
|
id: string;
|
|
45
45
|
object: 'connected_account';
|
|
46
|
+
/**
|
|
47
|
+
* Which of the provider's two worlds this object belongs to (ADR 0017):
|
|
48
|
+
* `true` for a `production` merchant, `false` for every other environment.
|
|
49
|
+
*/
|
|
50
|
+
livemode: boolean;
|
|
46
51
|
/** The merchant's OWN id for this seller — how they address it. */
|
|
47
52
|
external_ref: string;
|
|
48
53
|
/** Which halves this account has. Never empty. */
|
|
@@ -97,6 +102,11 @@ export interface ConnectedAccount {
|
|
|
97
102
|
export interface Transfer {
|
|
98
103
|
id: string;
|
|
99
104
|
object: 'transfer';
|
|
105
|
+
/**
|
|
106
|
+
* Which of the provider's two worlds this object belongs to (ADR 0017):
|
|
107
|
+
* `true` for a `production` merchant, `false` for every other environment.
|
|
108
|
+
*/
|
|
109
|
+
livemode: boolean;
|
|
100
110
|
/** The merchant's OWN id for what this settles. Their idempotency. */
|
|
101
111
|
external_ref: string;
|
|
102
112
|
/** The seller's `ca_…` — never their account id at the provider — or the object, expanded. */
|
|
@@ -128,6 +138,11 @@ export interface Transfer {
|
|
|
128
138
|
export interface TransferReversal {
|
|
129
139
|
id: string;
|
|
130
140
|
object: 'transfer_reversal';
|
|
141
|
+
/**
|
|
142
|
+
* Which of the provider's two worlds this object belongs to (ADR 0017):
|
|
143
|
+
* `true` for a `production` merchant, `false` for every other environment.
|
|
144
|
+
*/
|
|
145
|
+
livemode: boolean;
|
|
131
146
|
/** The merchant's own id for this reversal — their `Idempotency-Key`. */
|
|
132
147
|
external_ref: string;
|
|
133
148
|
amount: string;
|
|
@@ -164,6 +179,11 @@ export interface TransferWithReversal extends Transfer {
|
|
|
164
179
|
*/
|
|
165
180
|
export interface Settlement {
|
|
166
181
|
object: 'settlement';
|
|
182
|
+
/**
|
|
183
|
+
* Which of the provider's two worlds this object belongs to (ADR 0017):
|
|
184
|
+
* `true` for a `production` merchant, `false` for every other environment.
|
|
185
|
+
*/
|
|
186
|
+
livemode: boolean;
|
|
167
187
|
/** The `pi_…` this describes, or the {@link PaymentIntent} with `expand[]=payment_intent`. */
|
|
168
188
|
payment_intent: string | PaymentIntent;
|
|
169
189
|
/**
|
|
@@ -196,6 +216,11 @@ export type RefundOrigin = 'merchant' | 'provider';
|
|
|
196
216
|
export interface Refund {
|
|
197
217
|
id: string;
|
|
198
218
|
object: 'refund';
|
|
219
|
+
/**
|
|
220
|
+
* Which of the provider's two worlds this object belongs to (ADR 0017):
|
|
221
|
+
* `true` for a `production` merchant, `false` for every other environment.
|
|
222
|
+
*/
|
|
223
|
+
livemode: boolean;
|
|
199
224
|
/** `null` on an IMPORTED refund; see {@link RefundOrigin}. */
|
|
200
225
|
external_ref: string | null;
|
|
201
226
|
origin: RefundOrigin;
|
|
@@ -22,6 +22,11 @@ export type WebhookDeliveryStatus = 'pending' | 'delivered' | 'failed' | 'dead';
|
|
|
22
22
|
export interface WebhookDelivery {
|
|
23
23
|
id: string;
|
|
24
24
|
object: 'webhook_delivery';
|
|
25
|
+
/**
|
|
26
|
+
* Which of the provider's two worlds this object belongs to (ADR 0017):
|
|
27
|
+
* `true` for a `production` merchant, `false` for every other environment.
|
|
28
|
+
*/
|
|
29
|
+
livemode: boolean;
|
|
25
30
|
merchant_id: string;
|
|
26
31
|
/**
|
|
27
32
|
* The `pi_…` this delivery is about — `null` when the event is not about a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peable.to/shared-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Shared TypeScript types for the Peable Gateway — the wire contract shared by the backend, SDK, and frontend.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|