@delopay/sdk 0.78.0 → 0.80.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/index.d.ts CHANGED
@@ -474,8 +474,17 @@ interface PaymentAttemptsListResponse {
474
474
  /** Every attempt made on this payment, including failed retries across connectors. */
475
475
  data: PaymentAttemptResponse[];
476
476
  }
477
- /** Which entity a status-history event belongs to. */
478
- type PaymentStatusHistoryEntityType = 'payment' | 'attempt' | 'refund' | 'dispute';
477
+ /**
478
+ * Which entity a status-history event belongs to.
479
+ *
480
+ * `risk` and `checkout` are timeline events with no underlying status change:
481
+ * `risk` carries a processor risk signal (early fraud warning, manual review)
482
+ * and `checkout` a buyer-side checkout event (native-pane selection, external
483
+ * tab opened/blocked, abandonment). For both, `status` holds the event name
484
+ * rather than a payment state, and `entity_id` names what it is about (the
485
+ * processor's signal id, or the native-pane method key).
486
+ */
487
+ type PaymentStatusHistoryEntityType = 'payment' | 'attempt' | 'refund' | 'dispute' | 'risk' | 'checkout';
479
488
  /**
480
489
  * One event on a payment's status timeline: the creation of, or a status
481
490
  * transition on, the payment intent or one of its attempts / refunds /
@@ -1291,6 +1300,44 @@ interface ConnectorWebhookListResponse {
1291
1300
  connector: string;
1292
1301
  webhooks: ConnectorWebhookEntry[];
1293
1302
  }
1303
+ /**
1304
+ * Body for
1305
+ * `POST /account/{merchantId}/connectors/{connectorId}/stripe/payment-method-domains`.
1306
+ *
1307
+ * Registers the hosts of `urls` as Stripe *payment method domains* on the
1308
+ * connector's credential set for `environment`, so Apple Pay renders on those
1309
+ * pages (Stripe hides the button silently on unregistered domains). Call once
1310
+ * per environment to cover both Stripe modes. Stripe connectors only.
1311
+ */
1312
+ interface StripePaymentMethodDomainsRegisterRequest {
1313
+ /** Credential set to register with. Defaults to `'live'`. */
1314
+ environment?: WebhookRegistrationEnvironment;
1315
+ /**
1316
+ * Absolute URLs (or bare hostnames) whose hosts are registered — the hosted
1317
+ * checkout origin first, plus any of the merchant's own shop URLs. At most
1318
+ * 10 per request; duplicates by resolved host are collapsed server-side but
1319
+ * still receive their own result row.
1320
+ */
1321
+ urls: string[];
1322
+ }
1323
+ /** Outcome of registering one URL as a Stripe payment method domain. */
1324
+ type StripePaymentMethodDomainStatus = 'registered' | 'already_registered' | 'invalid_url' | 'failed';
1325
+ /** Per-URL outcome of a {@link StripePaymentMethodDomainsRegisterRequest}. */
1326
+ interface StripePaymentMethodDomainResult {
1327
+ /** The URL exactly as sent. */
1328
+ url: string;
1329
+ /** Host actually registered with Stripe; absent when the URL failed to parse. */
1330
+ domain?: string | null;
1331
+ status: StripePaymentMethodDomainStatus;
1332
+ /** Stripe's `apple_pay.status` for the domain (`active`, `inactive`), when reported. */
1333
+ apple_pay_status?: string | null;
1334
+ /** Human-readable failure or duplicate detail. Never contains credentials. */
1335
+ message?: string | null;
1336
+ }
1337
+ interface StripePaymentMethodDomainsRegisterResponse {
1338
+ environment: WebhookRegistrationEnvironment;
1339
+ results: StripePaymentMethodDomainResult[];
1340
+ }
1294
1341
  interface PaymentLinkBackgroundImageConfig {
1295
1342
  url: string;
1296
1343
  position?: 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | null;
@@ -3682,6 +3729,17 @@ declare class Connectors {
3682
3729
  * to a single event.
3683
3730
  */
3684
3731
  registerWebhook(merchantId: string, connectorId: string, params?: ConnectorWebhookRegisterRequest): Promise<ConnectorWebhookRegisterResponse>;
3732
+ /**
3733
+ * Register checkout/shop domains as Stripe payment method domains, so Apple
3734
+ * Pay renders on those pages.
3735
+ * `POST /account/{merchantId}/connectors/{connectorId}/stripe/payment-method-domains`
3736
+ *
3737
+ * Stripe connectors only. One call registers against a single credential set
3738
+ * (`environment`, default `'live'`) — call twice to cover live and sandbox.
3739
+ * Per-URL outcomes come back in `results`; a missing sandbox credential set
3740
+ * is a request-level 400.
3741
+ */
3742
+ registerStripePaymentMethodDomains(merchantId: string, connectorId: string, params: StripePaymentMethodDomainsRegisterRequest): Promise<StripePaymentMethodDomainsRegisterResponse>;
3685
3743
  /** Get registered webhooks for a connector. `GET /account/{merchantId}/connectors/webhooks/{connectorId}` */
3686
3744
  getWebhook(merchantId: string, connectorId: string): Promise<ConnectorWebhookListResponse>;
3687
3745
  /** List available payment methods. `GET /account/payment-methods` */
@@ -6196,4 +6254,233 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
6196
6254
  declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
6197
6255
  declare function shadowFor(style: SurfaceStyle): string;
6198
6256
 
6199
- export { ALL_CUSTOM_FIELD_CONDITION_SOURCES, ALL_CUSTOM_FIELD_OPERATORS, ALL_CUSTOM_FIELD_TYPES, type AddUserRequest, type AddUserResponse, type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, type AmountRange, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsMethodSlice, type AnalyticsScopeRequest, type AnalyticsScopeResponse, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BankCodeResponse, type BankDebitTypes, type BankTransferTypes, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CHECKBOX_CHECKED, CHECKBOX_UNCHECKED, CUSTOM_CSS_MAX_LENGTH, CUSTOM_FIELDS_MAX, CUSTOM_FIELD_CONDITIONS_MAX, CUSTOM_FIELD_KEY_PATTERN, CUSTOM_FIELD_OPERATORS_BY_SOURCE, CUSTOM_FIELD_VALUELESS_OPERATORS, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, type CardNetworkTypes, Cards, type ChangePasswordRequest, type CheckoutBranding, type CheckoutCustomField, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorSelection, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CurrencyRevenue, type CustomFieldCondition, type CustomFieldConditionSource, type CustomFieldContext, type CustomFieldOperator, type CustomFieldOption, type CustomFieldTranslations, type CustomFieldType, type CustomFieldVisibility, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceBlock, type DisputeEvidenceRequest, type DisputeEvidenceType, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EuclidComparison, type EuclidComparisonType, type EuclidIfStatement, type EuclidValue, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, FeeProgramBuilder, type FeeRuleConditions, type FeeRuleInput, type FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type ListUsersInLineageParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type MethodSurcharge, type MinimalRoleInfo, type NonPillRadius, type OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentExperienceTypes, type PaymentIdFormatConfig, type PaymentIdStyle, type PaymentIntentStateMetadata, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodAmountLimits, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodDisplayInfo, type PaymentMethodListInstallmentAmountDetails, type PaymentMethodListInstallmentOption, type PaymentMethodListInstallmentPlan, type PaymentMethodListIntentData, type PaymentMethodListParams, type PaymentMethodListResponse, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentStatusHistoryEntityType, type PaymentStatusHistoryEvent, type PaymentStatusHistoryResponse, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PerMethodSurchargeItem, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PlatformFeeKind, type PlatformFeeOutput, type PlatformFeeProgram, type PlatformFeeRule, type PlatformFeeRuleInput, type PlatformFeeRuleOutput, type PlatformFeeRuleRecord, type PlatformFeeRuleRequest, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileDeniedConnectorsResponse, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProgramConnectorSelection, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundAggregateResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type RequiredFieldInfo, type ResetPasswordRequest, type ResponsePaymentMethodTypes, type ResponsePaymentMethodsEnabled, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, type RuleConnectorSelection, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopStatsResponse, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StatsPeriod, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurchargeDetailsResponse, type SurchargeResponse, type SurchargeRuleRequest, type SurchargeRuleResponse, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UpdateUserRoleRequest, type UserInLineage, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, cloneCustomField, customFieldContextFromMetadata, customFieldIsTextLike, customFieldOperatorTakesValue, customFieldOptionLabel, customFieldText, decodeBadges, decodeBranding, decodeCustomFields, defaultBranding, defaultCustomFieldVisibility, defaultOperatorForSource, encodeBadges, encodeBranding, encodeCustomFields, evaluateCustomFieldCondition, evaluateCustomFieldVisibility, feeProgram, fontStack, fontWeightValue, inputPadValue, isCheckboxChecked, isDarkSurface, isHexColor, leaf, logoDimensions, parseCustomFieldsLoose, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue, visibleCustomFields };
6257
+ /**
6258
+ * How the focused external checkout charges a paned method. Decided
6259
+ * server-side; the browser never picks.
6260
+ *
6261
+ * - `wallet` — the method rides inside Stripe's `card` rail (Apple Pay, Google
6262
+ * Pay, Link). The focused view charges the **same** PaymentIntent the
6263
+ * embedded checkout already holds, so no second intent is ever created.
6264
+ * - `redirect` — the method has its own `payment_method_types[]` entry. The
6265
+ * focused view confirms through the standard `/payments/{id}/confirm` rail
6266
+ * and follows `next_action.redirect_to_url`.
6267
+ */
6268
+ type NativePaneRail = 'wallet' | 'redirect';
6269
+ /**
6270
+ * Where a pane's tile is offered. Wallet rail only — a redirect pane is
6271
+ * suppressed server-side, before any render knows whether it is framed, so
6272
+ * `embedded_only` there would leave the method unpayable at top level and the
6273
+ * router forces it back to `always`.
6274
+ */
6275
+ type NativePaneVisibility = 'always' | 'embedded_only';
6276
+ /**
6277
+ * How the embedded checkout opens a pane's focused view: a new browser tab
6278
+ * (`tab`, the historical behaviour) or a centred popup window (`popup`).
6279
+ * Only meaningful when the checkout renders inside an iframe — a top-level
6280
+ * render always navigates in place. Browsers that refuse popup windows fall
6281
+ * back to a tab on their own.
6282
+ */
6283
+ type NativePaneOpenTarget = 'tab' | 'popup';
6284
+ /**
6285
+ * One native pane exactly as the merchant configures it. Persisted (JSON) under
6286
+ * `metadata.native_panes` on the Stripe merchant connector account.
6287
+ *
6288
+ * Field names are the wire contract — renaming one is a migration. The router
6289
+ * decodes strictly row by row: a row that fails strict decoding (e.g. a
6290
+ * wrong-typed field like `display_order: "3"`) is dropped whole with a server
6291
+ * log, and the remaining rows still render. This SDK's
6292
+ * {@link decodeNativePanes} is additionally per-property tolerant — including
6293
+ * clamping `display_order` into the router's `i32` range — so a decode→encode
6294
+ * round-trip through the SDK repairs a blob the router would partially drop.
6295
+ */
6296
+ interface StripeNativePane {
6297
+ /** Catalog key of the promoted method — see {@link STRIPE_NATIVE_PANE_METHODS}. */
6298
+ method: string;
6299
+ /** Disabled rows keep their tuning but never reach a buyer. */
6300
+ enabled: boolean;
6301
+ /** Default-language tile label. Empty falls back to the catalog name. */
6302
+ label: string;
6303
+ /** Per-locale overrides of `label`, keyed by checkout locale (`de`, `de-AT`). */
6304
+ labelTranslations: Record<string, string>;
6305
+ /**
6306
+ * Secondary line under the label. `null` means "use the catalog default";
6307
+ * an empty string means the merchant deliberately hid the line. That
6308
+ * distinction is the whole reason this is nullable and `label` is not.
6309
+ */
6310
+ sublabel: string | null;
6311
+ /** Per-locale overrides of `sublabel`. */
6312
+ sublabelTranslations: Record<string, string>;
6313
+ /** Section the tile groups under. Empty falls back to the catalog category. */
6314
+ category: string;
6315
+ /** Built-in icon key — see {@link NATIVE_PANE_ICON_KEYS}. */
6316
+ icon: string;
6317
+ /** Custom inline SVG. Sanitized server-side before it reaches a buyer; a
6318
+ * rejected payload falls back to the built-in `icon`. */
6319
+ iconSvg: string;
6320
+ /** Lower renders first; ties break on catalog order. */
6321
+ displayOrder: number;
6322
+ /** `embedded_only` keeps the wallet inside Stripe's form at top level. */
6323
+ visibility: NativePaneVisibility;
6324
+ /** How the embedded checkout opens the focused view — see {@link NativePaneOpenTarget}. */
6325
+ openIn: NativePaneOpenTarget;
6326
+ }
6327
+ /**
6328
+ * One resolved native pane as the buyer-facing checkout receives it on the
6329
+ * payment-link payload (`native_panes`). Labels are already localized for the
6330
+ * render's locale and icons already sanitized — snake_case because this is the
6331
+ * API wire shape, not the editor's.
6332
+ */
6333
+ interface NativePaneView {
6334
+ method: string;
6335
+ rail: NativePaneRail;
6336
+ label: string;
6337
+ sublabel: string;
6338
+ category: string;
6339
+ icon?: string | null;
6340
+ icon_svg?: string | null;
6341
+ display_order: number;
6342
+ /** Redirect rail only — echo verbatim on confirm, never derive. */
6343
+ payment_method?: string | null;
6344
+ /** Redirect rail only — echo verbatim on confirm, never derive. */
6345
+ payment_method_type?: string | null;
6346
+ /** Redirect rail only — echo verbatim on confirm, never derive. */
6347
+ payment_method_data?: Record<string, unknown> | null;
6348
+ /**
6349
+ * The confirm body needs the buyer's country: merged into
6350
+ * `billing.address.country` and echoed into the single `payment_method_data`
6351
+ * variant's `billing_country`.
6352
+ */
6353
+ requires_billing_country?: boolean;
6354
+ /** `true` when the tile is only offered inside an iframe. Wallet rail only. */
6355
+ embedded_only?: boolean;
6356
+ /**
6357
+ * How the embedded checkout opens this tile's focused view. Absent on
6358
+ * payloads from older backends — treat as `tab`.
6359
+ */
6360
+ open_in?: NativePaneOpenTarget;
6361
+ }
6362
+ /**
6363
+ * Methods that may be promoted to a native pane.
6364
+ *
6365
+ * **The router owns this list** — `core::payment_link::native_panes::CATALOG` in
6366
+ * delopay-backend. This is a mirror so SDK consumers can validate or offer the
6367
+ * promotable methods without a round-trip; keep it in sync when the router's
6368
+ * catalog changes (the control-center keeps its own copy in
6369
+ * `native-panes.model.ts`). Drift is safe in one direction only: the backend
6370
+ * silently drops a key it does not know, so a stale entry here produces a row
6371
+ * that never renders rather than a broken checkout.
6372
+ */
6373
+ interface NativePaneMethodInfo {
6374
+ key: string;
6375
+ rail: NativePaneRail;
6376
+ /** Catalog default label, shown as the editor's placeholder. */
6377
+ defaultLabel: string;
6378
+ /** Catalog default sub-text. */
6379
+ defaultSublabel: string;
6380
+ /** Catalog default section. */
6381
+ defaultCategory: string;
6382
+ /** Catalog default icon key. */
6383
+ defaultIcon: string;
6384
+ }
6385
+ declare const STRIPE_NATIVE_PANE_METHODS: readonly NativePaneMethodInfo[];
6386
+ /** Built-in tile icon keys the buyer-facing checkout ships a glyph for. */
6387
+ declare const NATIVE_PANE_ICON_KEYS: readonly string[];
6388
+ /** Section keys the checkout knows a translated header for. */
6389
+ declare const NATIVE_PANE_CATEGORY_KEYS: readonly string[];
6390
+ /**
6391
+ * Mirror of the router's per-connector cap. Counted differently on each side:
6392
+ * {@link decodeNativePanes} stops after 12 *decoded* rows (entries with a
6393
+ * usable, non-duplicate `method` — junk and duplicate entries don't consume a
6394
+ * slot), while the router caps *accepted* panes (enabled, known,
6395
+ * deduplicated) at 12 — so an oversized hand-written blob may render a pane
6396
+ * this decoder drops. Blobs the SDK itself encodes never exceed the cap.
6397
+ */
6398
+ declare const NATIVE_PANES_MAX = 12;
6399
+ declare function nativePaneMethodInfo(method: string): NativePaneMethodInfo | undefined;
6400
+ declare function defaultNativePane(method: string): StripeNativePane;
6401
+ declare function cloneNativePane(pane: StripeNativePane): StripeNativePane;
6402
+ /**
6403
+ * Decode the stored `metadata.native_panes` blob into editor rows.
6404
+ *
6405
+ * Tolerant like the branding codecs: anything malformed falls back per
6406
+ * property, rows without a usable `method` are dropped, duplicates keep the
6407
+ * first occurrence — except that an enabled row wins over an earlier disabled
6408
+ * one for the same method, because that is the row the router renders — and
6409
+ * decoding stops after {@link NATIVE_PANES_MAX} decoded
6410
+ * rows (dropped junk/duplicate entries don't consume a slot). That is more
6411
+ * forgiving than the router, which drops a strict-decode-failing row whole
6412
+ * (keeping the rest) and caps accepted panes rather than decoded rows — see
6413
+ * {@link StripeNativePane} and {@link NATIVE_PANES_MAX}. Returns `null` when
6414
+ * the input is not an array so the caller can distinguish "never configured"
6415
+ * from "cleared".
6416
+ */
6417
+ declare function decodeNativePanes(raw: unknown): StripeNativePane[] | null;
6418
+ /**
6419
+ * Encode editor rows back into the snake_case blob the connector account
6420
+ * stores. Empty optional strings are omitted so the metadata stays small and a
6421
+ * merchant who typed nothing round-trips as "use the catalog default" rather
6422
+ * than as an explicit empty override.
6423
+ *
6424
+ * `sublabel` is the exception: an explicitly-empty value is preserved (as `""`)
6425
+ * because that is how a merchant hides the second line.
6426
+ */
6427
+ declare function encodeNativePanes(panes: StripeNativePane[]): Record<string, unknown>[];
6428
+ interface FocusedCheckoutUrlParams {
6429
+ /** Base URL of the DeloPay hosted checkout, e.g. `https://checkout.delopay.net`. */
6430
+ checkoutBaseUrl: string;
6431
+ merchantId: string;
6432
+ paymentId: string;
6433
+ /** Native-pane method key to focus on (`apple_pay`, `klarna`, …). */
6434
+ method: string;
6435
+ /** Optional buyer locale, forwarded as `?locale=`. */
6436
+ locale?: string;
6437
+ /**
6438
+ * Set when the merchant's checkout-custom-field answers are already
6439
+ * persisted on the payment — forwarded as `cf=1` so the focused view skips
6440
+ * asking a second time. Purely a UI hint: the values live on the intent
6441
+ * either way, and the backend only accepts the merchant's configured field
6442
+ * keys from a client, so a wrongly-set flag can at worst skip an
6443
+ * informational prompt. This is the same hint the embedded pane sets when
6444
+ * it opens the focused view.
6445
+ */
6446
+ customFieldsCollected?: boolean;
6447
+ }
6448
+ /**
6449
+ * Build the link to the **focused single-method checkout**: the DeloPay hosted
6450
+ * checkout rendered with one payment method, one button, no picker.
6451
+ *
6452
+ * Two callers:
6453
+ * - the embedded checkout, which opens this in a new tab when a buyer clicks
6454
+ * a native pane tile, and
6455
+ * - a merchant running their own checkout, who puts it behind their own
6456
+ * button — the same mechanism without an iframe.
6457
+ *
6458
+ * `method` is not limited to configured native panes. A configured Stripe
6459
+ * native pane gets the focused one-button view; `card`, `paypal`,
6460
+ * `crypto_currency` and the local-methods catalogs (by method key or vendor
6461
+ * code) open the checkout pinned to that method. Methods that exist only as a
6462
+ * tab inside Stripe's Payment Element — iDEAL, Bancontact, P24 and the like,
6463
+ * unless promoted to a native pane — cannot be isolated, because Stripe owns
6464
+ * that surface. An unknown or unavailable method is never a dead end: the
6465
+ * checkout shows a notice with a visible "show all payment methods" action.
6466
+ *
6467
+ * Open it **at the top level** (a new tab or a full-page navigation). The whole
6468
+ * point is that the top-level domain is the registered payment method domain;
6469
+ * rendering it in an iframe puts you back where you started.
6470
+ *
6471
+ * If you open it with `window.open`, call that **synchronously inside the click
6472
+ * handler** or the popup blocker will eat it, and make sure any iframe you
6473
+ * render DeloPay in permits popups (`allow-popups`, plus
6474
+ * `allow-popups-to-escape-sandbox` under a restrictive `sandbox`).
6475
+ */
6476
+ declare function focusedCheckoutUrl(params: FocusedCheckoutUrlParams): string;
6477
+ /**
6478
+ * The closed vocabulary of buyer-side checkout events recorded on the payment's
6479
+ * status timeline. Written through
6480
+ * `POST /payment-link/{merchant_id}/{payment_id}/checkout-events`, authorized
6481
+ * with the payment's `client_secret` as a bearer token.
6482
+ */
6483
+ declare const CHECKOUT_EVENT_KINDS: readonly ["native_pane_selected", "native_pane_tab_opened", "native_pane_tab_blocked", "native_pane_abandoned", "native_pane_returned"];
6484
+ type CheckoutEventKind = (typeof CHECKOUT_EVENT_KINDS)[number];
6485
+
6486
+ export { ALL_CUSTOM_FIELD_CONDITION_SOURCES, ALL_CUSTOM_FIELD_OPERATORS, ALL_CUSTOM_FIELD_TYPES, type AddUserRequest, type AddUserResponse, type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, type AmountRange, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsMethodSlice, type AnalyticsScopeRequest, type AnalyticsScopeResponse, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BankCodeResponse, type BankDebitTypes, type BankTransferTypes, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CHECKBOX_CHECKED, CHECKBOX_UNCHECKED, CHECKOUT_EVENT_KINDS, CUSTOM_CSS_MAX_LENGTH, CUSTOM_FIELDS_MAX, CUSTOM_FIELD_CONDITIONS_MAX, CUSTOM_FIELD_KEY_PATTERN, CUSTOM_FIELD_OPERATORS_BY_SOURCE, CUSTOM_FIELD_VALUELESS_OPERATORS, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, type CardNetworkTypes, Cards, type ChangePasswordRequest, type CheckoutBranding, type CheckoutCustomField, type CheckoutEventKind, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorSelection, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CurrencyRevenue, type CustomFieldCondition, type CustomFieldConditionSource, type CustomFieldContext, type CustomFieldOperator, type CustomFieldOption, type CustomFieldTranslations, type CustomFieldType, type CustomFieldVisibility, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceBlock, type DisputeEvidenceRequest, type DisputeEvidenceType, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EuclidComparison, type EuclidComparisonType, type EuclidIfStatement, type EuclidValue, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, FeeProgramBuilder, type FeeRuleConditions, type FeeRuleInput, type FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FocusedCheckoutUrlParams, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type ListUsersInLineageParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type MethodSurcharge, type MinimalRoleInfo, NATIVE_PANES_MAX, NATIVE_PANE_CATEGORY_KEYS, NATIVE_PANE_ICON_KEYS, type NativePaneMethodInfo, type NativePaneOpenTarget, type NativePaneRail, type NativePaneView, type NativePaneVisibility, type NonPillRadius, type OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentExperienceTypes, type PaymentIdFormatConfig, type PaymentIdStyle, type PaymentIntentStateMetadata, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodAmountLimits, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodDisplayInfo, type PaymentMethodListInstallmentAmountDetails, type PaymentMethodListInstallmentOption, type PaymentMethodListInstallmentPlan, type PaymentMethodListIntentData, type PaymentMethodListParams, type PaymentMethodListResponse, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentStatusHistoryEntityType, type PaymentStatusHistoryEvent, type PaymentStatusHistoryResponse, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PerMethodSurchargeItem, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PlatformFeeKind, type PlatformFeeOutput, type PlatformFeeProgram, type PlatformFeeRule, type PlatformFeeRuleInput, type PlatformFeeRuleOutput, type PlatformFeeRuleRecord, type PlatformFeeRuleRequest, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileDeniedConnectorsResponse, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProgramConnectorSelection, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundAggregateResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type RequiredFieldInfo, type ResetPasswordRequest, type ResponsePaymentMethodTypes, type ResponsePaymentMethodsEnabled, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, type RuleConnectorSelection, STRIPE_NATIVE_PANE_METHODS, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopStatsResponse, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StatsPeriod, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type StripeNativePane, type StripePaymentMethodDomainResult, type StripePaymentMethodDomainStatus, type StripePaymentMethodDomainsRegisterRequest, type StripePaymentMethodDomainsRegisterResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurchargeDetailsResponse, type SurchargeResponse, type SurchargeRuleRequest, type SurchargeRuleResponse, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UpdateUserRoleRequest, type UserInLineage, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, cloneCustomField, cloneNativePane, customFieldContextFromMetadata, customFieldIsTextLike, customFieldOperatorTakesValue, customFieldOptionLabel, customFieldText, decodeBadges, decodeBranding, decodeCustomFields, decodeNativePanes, defaultBranding, defaultCustomFieldVisibility, defaultNativePane, defaultOperatorForSource, encodeBadges, encodeBranding, encodeCustomFields, encodeNativePanes, evaluateCustomFieldCondition, evaluateCustomFieldVisibility, feeProgram, focusedCheckoutUrl, fontStack, fontWeightValue, inputPadValue, isCheckboxChecked, isDarkSurface, isHexColor, leaf, logoDimensions, nativePaneMethodInfo, parseCustomFieldsLoose, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue, visibleCustomFields };
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ import {
9
9
  BRANDING_EXPORT_VERSION,
10
10
  CHECKBOX_CHECKED,
11
11
  CHECKBOX_UNCHECKED,
12
+ CHECKOUT_EVENT_KINDS,
12
13
  CUSTOM_CSS_MAX_LENGTH,
13
14
  CUSTOM_FIELDS_MAX,
14
15
  CUSTOM_FIELD_CONDITIONS_MAX,
@@ -28,7 +29,11 @@ import {
28
29
  FeeProgramBuilder,
29
30
  Files,
30
31
  Forex,
32
+ NATIVE_PANES_MAX,
33
+ NATIVE_PANE_CATEGORY_KEYS,
34
+ NATIVE_PANE_ICON_KEYS,
31
35
  Regions,
36
+ STRIPE_NATIVE_PANE_METHODS,
32
37
  Search,
33
38
  Subscriptions,
34
39
  Webhooks,
@@ -39,6 +44,7 @@ import {
39
44
  buttonPadValue,
40
45
  cloneBranding,
41
46
  cloneCustomField,
47
+ cloneNativePane,
42
48
  customFieldContextFromMetadata,
43
49
  customFieldIsTextLike,
44
50
  customFieldOperatorTakesValue,
@@ -47,15 +53,19 @@ import {
47
53
  decodeBadges,
48
54
  decodeBranding,
49
55
  decodeCustomFields,
56
+ decodeNativePanes,
50
57
  defaultBranding,
51
58
  defaultCustomFieldVisibility,
59
+ defaultNativePane,
52
60
  defaultOperatorForSource,
53
61
  encodeBadges,
54
62
  encodeBranding,
55
63
  encodeCustomFields,
64
+ encodeNativePanes,
56
65
  evaluateCustomFieldCondition,
57
66
  evaluateCustomFieldVisibility,
58
67
  feeProgram,
68
+ focusedCheckoutUrl,
59
69
  fontStack,
60
70
  fontWeightValue,
61
71
  inputPadValue,
@@ -64,6 +74,7 @@ import {
64
74
  isHexColor,
65
75
  leaf,
66
76
  logoDimensions,
77
+ nativePaneMethodInfo,
67
78
  parseCustomFieldsLoose,
68
79
  parseImportedBranding,
69
80
  programToTree,
@@ -74,7 +85,7 @@ import {
74
85
  surfacePadValue,
75
86
  verticalGapValue,
76
87
  visibleCustomFields
77
- } from "./chunk-MX26LF5P.js";
88
+ } from "./chunk-PHKXFVHZ.js";
78
89
  export {
79
90
  ALL_CUSTOM_FIELD_CONDITION_SOURCES,
80
91
  ALL_CUSTOM_FIELD_OPERATORS,
@@ -86,6 +97,7 @@ export {
86
97
  BRANDING_EXPORT_VERSION,
87
98
  CHECKBOX_CHECKED,
88
99
  CHECKBOX_UNCHECKED,
100
+ CHECKOUT_EVENT_KINDS,
89
101
  CUSTOM_CSS_MAX_LENGTH,
90
102
  CUSTOM_FIELDS_MAX,
91
103
  CUSTOM_FIELD_CONDITIONS_MAX,
@@ -105,7 +117,11 @@ export {
105
117
  FeeProgramBuilder,
106
118
  Files,
107
119
  Forex,
120
+ NATIVE_PANES_MAX,
121
+ NATIVE_PANE_CATEGORY_KEYS,
122
+ NATIVE_PANE_ICON_KEYS,
108
123
  Regions,
124
+ STRIPE_NATIVE_PANE_METHODS,
109
125
  Search,
110
126
  Subscriptions,
111
127
  Webhooks,
@@ -116,6 +132,7 @@ export {
116
132
  buttonPadValue,
117
133
  cloneBranding,
118
134
  cloneCustomField,
135
+ cloneNativePane,
119
136
  customFieldContextFromMetadata,
120
137
  customFieldIsTextLike,
121
138
  customFieldOperatorTakesValue,
@@ -124,15 +141,19 @@ export {
124
141
  decodeBadges,
125
142
  decodeBranding,
126
143
  decodeCustomFields,
144
+ decodeNativePanes,
127
145
  defaultBranding,
128
146
  defaultCustomFieldVisibility,
147
+ defaultNativePane,
129
148
  defaultOperatorForSource,
130
149
  encodeBadges,
131
150
  encodeBranding,
132
151
  encodeCustomFields,
152
+ encodeNativePanes,
133
153
  evaluateCustomFieldCondition,
134
154
  evaluateCustomFieldVisibility,
135
155
  feeProgram,
156
+ focusedCheckoutUrl,
136
157
  fontStack,
137
158
  fontWeightValue,
138
159
  inputPadValue,
@@ -141,6 +162,7 @@ export {
141
162
  isHexColor,
142
163
  leaf,
143
164
  logoDimensions,
165
+ nativePaneMethodInfo,
144
166
  parseCustomFieldsLoose,
145
167
  parseImportedBranding,
146
168
  programToTree,