@peable.to/shared-types 0.3.3-oxy-one.0 → 0.3.4

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.
@@ -53,6 +53,8 @@ export interface BillingCheckoutSession extends BillingHostedSession {
53
53
  id: string;
54
54
  }
55
55
  export interface BillingCheckoutObservation {
56
+ /** Immutable subscription_create invoice proven for this exact checkout. Discovery only, never paid authority. */
57
+ initialInvoiceId: string | null;
56
58
  id: string;
57
59
  status: 'open' | 'complete' | 'expired';
58
60
  storeId: string;
@@ -221,3 +223,43 @@ export interface BillingTaxQuote {
221
223
  value: string;
222
224
  };
223
225
  }
226
+ /** Read-only recovery of one previously attempted recurring checkout. Neither
227
+ * absence nor uncertainty permits cancellation or another financial operation. */
228
+ export interface RetrieveBillingCheckoutOperationParams {
229
+ idempotencyKey: string;
230
+ providerCustomerId: string;
231
+ providerPriceId: string;
232
+ storeId: string;
233
+ planId: string;
234
+ }
235
+ export interface BillingCheckoutOperationSource extends RetrieveBillingCheckoutOperationParams {
236
+ taxQuoteId: string | null;
237
+ merchantId: string;
238
+ appId: string;
239
+ mode: 'test' | 'live';
240
+ environment: 'development' | 'staging' | 'production';
241
+ }
242
+ export type BillingCheckoutOperationRecovery = {
243
+ state: 'not_found' | 'pending' | 'indeterminate';
244
+ source: BillingCheckoutOperationSource;
245
+ } | {
246
+ state: 'succeeded';
247
+ source: BillingCheckoutOperationSource;
248
+ checkout: {
249
+ id: string;
250
+ expiresAt: string;
251
+ url?: string;
252
+ };
253
+ };
254
+ export interface BillingFaircoinFxQuote {
255
+ id: string;
256
+ currency: 'USD';
257
+ grossMinorUnits: number;
258
+ amountBaseUnits: string;
259
+ usdPerFair: string;
260
+ source: string;
261
+ observedAt: string;
262
+ quotedAt: string;
263
+ expiresAt: string;
264
+ rounding: 'ceil_to_base_unit';
265
+ }
@@ -1,3 +1,4 @@
1
+ import type { BillingFaircoinFxQuote } from './billing';
1
2
  import type { CurrencyCode } from './money';
2
3
  import type { NetworkType } from './network';
3
4
  import type { MerchantDisplay } from './merchantDisplay';
@@ -29,6 +30,8 @@ export interface CheckoutSession {
29
30
  * `clientSecret`, which the page needs to open the socket and to `submit_tx`.
30
31
  */
31
32
  export interface CheckoutSessionPublic {
33
+ /** Frozen commercial USD price and exact FAIR settlement quote; no payer metadata. */
34
+ billingQuote?: BillingFaircoinFxQuote;
32
35
  id: string;
33
36
  object: 'checkout_session';
34
37
  successUrl?: string;
@@ -1,15 +1,16 @@
1
1
  export { UNITS_PER_COIN, isBaseUnitString, type CurrencyCode, CURRENCY_CODES, CURRENCY_DECIMALS, decimalsFor, isCurrencyCode, } from './money';
2
- export { type NetworkType } from './network';
2
+ export type { NetworkType } from './network';
3
3
  export { type PaymentIntentStatus, type PaymentIntentRail, type PaymentIntent, type CreatePaymentIntentParams, isValidStatusTransition, canStillBePaid, reachesSettlementFromPayer, POST_SETTLEMENT_STATUSES, PAYMENT_INTENT_STATUSES, PAYMENT_INTENT_RAILS, CHAIN_ONLY_STATUSES, CARD_ONLY_STATUSES, } from './paymentIntent';
4
- export { type WebhookEventType, type WebhookEvent, type WebhookEventPayload, type BillingObservation, } from './event';
5
- export { type Dispute, type DisputeEvidence, type DisputeStatus } from './dispute';
6
- export { type CapabilityStatus, type ConnectedAccount, type Refund, type RefundOrigin, type RefundStatus, type Settlement, type Transfer, type TransferReversal, type TransferReversalStatus, type TransferStatus, type TransferWithReversal, } from './settlement';
7
- export { type WebhookDelivery, type WebhookDeliveryStatus, } from './webhookDelivery';
4
+ export type { WebhookEventType, WebhookEvent, WebhookEventPayload, BillingObservation, } from './event';
5
+ export type { Dispute, DisputeEvidence, DisputeStatus } from './dispute';
6
+ export type { CapabilityStatus, ConnectedAccount, Refund, RefundOrigin, RefundStatus, Settlement, Transfer, TransferReversal, TransferReversalStatus, TransferStatus, TransferWithReversal, } from './settlement';
7
+ export type { WebhookDelivery, WebhookDeliveryStatus, } from './webhookDelivery';
8
8
  export { signWebhook, verifyWebhook } from './webhookSigner';
9
9
  export { type MerchantEnvironment, type Merchant, MERCHANT_ENVIRONMENTS, } from './merchant';
10
- export { type MerchantDisplay } from './merchantDisplay';
11
- export { type PaymentLink, type PublicPaymentLink, type CreatePaymentLinkParams, } from './paymentLink';
12
- export { type CheckoutSession, type CheckoutSessionPublic, type CreateCheckoutSessionParams, } from './checkoutSession';
10
+ export type { MerchantDisplay } from './merchantDisplay';
11
+ export type { PaymentLink, PublicPaymentLink, CreatePaymentLinkParams, } from './paymentLink';
12
+ export type { CheckoutSession, CheckoutSessionPublic, CreateCheckoutSessionParams, } from './checkoutSession';
13
13
  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';
14
- 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 BillingPaidInvoice, type BillingInvoiceState, type BillingCustomer, type EnsureBillingCustomerParams, type CreateBillingCheckoutParams, type CreateBillingPortalParams, type BillingHostedSession, type BillingSubscription, } from './billing';
14
+ 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 EnsureBillingCustomerParams, type CreateBillingCheckoutParams, type CreateBillingPortalParams, type BillingHostedSession, type BillingSubscription, } from './billing';
15
15
  export { canonicalBillingAuthority, canonicalBillingTaxQuote } from './billing-authority';
16
+ export type { BillingFaircoinFxQuote } from './billing';
@@ -1,3 +1,4 @@
1
+ import type { ContributionDetails } from '@peable.to/contracts';
1
2
  import type { CurrencyCode } from './money';
2
3
  import type { NetworkType } from './network';
3
4
  import type { MerchantDisplay } from './merchantDisplay';
@@ -6,6 +7,7 @@ import type { PaymentIntentRail } from './paymentIntent';
6
7
  export interface PaymentLink {
7
8
  id: string;
8
9
  object: 'payment_link';
10
+ contribution?: ContributionDetails;
9
11
  /**
10
12
  * Amount in the currency's smallest unit, as a canonical integer string.
11
13
  * Never a float, and never interpretable without `currency`.
@@ -28,6 +30,7 @@ export interface PaymentLink {
28
30
  export interface PublicPaymentLink {
29
31
  id: string;
30
32
  object: 'payment_link';
33
+ contribution?: ContributionDetails;
31
34
  amount: string;
32
35
  currency: CurrencyCode;
33
36
  rail: PaymentIntentRail;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peable.to/shared-types",
3
- "version": "0.3.3-oxy-one.0",
3
+ "version": "0.3.4",
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",
@@ -9,8 +9,7 @@
9
9
  "sideEffects": false,
10
10
  "publishConfig": {
11
11
  "access": "public",
12
- "registry": "https://registry.npmjs.org/",
13
- "tag": "oxy-one"
12
+ "registry": "https://registry.npmjs.org/"
14
13
  },
15
14
  "exports": {
16
15
  ".": {
@@ -62,5 +61,8 @@
62
61
  "typescript": "~5.9.2",
63
62
  "@types/node": "^20.0.0",
64
63
  "@types/bun": "latest"
64
+ },
65
+ "dependencies": {
66
+ "@peable.to/contracts": "0.1.0"
65
67
  }
66
68
  }