@peable.to/shared-types 0.7.0 → 0.8.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.
@@ -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;
@@ -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
  }
@@ -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
  /**
@@ -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
  /**
@@ -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.7.0",
3
+ "version": "0.8.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",