@delopay/sdk 0.35.1 → 0.36.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.cts CHANGED
@@ -1009,6 +1009,103 @@ interface FeeScheduleResponse {
1009
1009
  max_fee_amount?: number | null;
1010
1010
  description?: string | null;
1011
1011
  }
1012
+ /** Euclid comparison operator. */
1013
+ type EuclidComparisonType = 'equal' | 'not_equal' | 'less_than' | 'less_than_equal' | 'greater_than' | 'greater_than_equal';
1014
+ /** A tagged Euclid value. Enum conditions use `enum_variant`; amount uses `number`. */
1015
+ type EuclidValue = {
1016
+ type: 'number';
1017
+ value: number;
1018
+ } | {
1019
+ type: 'enum_variant';
1020
+ value: string;
1021
+ } | {
1022
+ type: 'str_value';
1023
+ value: string;
1024
+ } | {
1025
+ type: 'number_array';
1026
+ value: number[];
1027
+ } | {
1028
+ type: 'enum_variant_array';
1029
+ value: string[];
1030
+ } | {
1031
+ type: 'metadata_variant';
1032
+ value: {
1033
+ key: string;
1034
+ value: string;
1035
+ };
1036
+ } | {
1037
+ type: 'number_comparison_array';
1038
+ value: {
1039
+ comparisonType: EuclidComparisonType;
1040
+ number: number;
1041
+ }[];
1042
+ };
1043
+ /**
1044
+ * A single condition. `lhs` is a backend dimension key — e.g. `payment_method`,
1045
+ * `connector`, `currency`, `card_network`, `amount`, or a payment-method-type key
1046
+ * (`crypto`, `wallet`, `bank_redirect`, …). camelCase on the wire.
1047
+ */
1048
+ interface EuclidComparison {
1049
+ lhs: string;
1050
+ comparison: EuclidComparisonType;
1051
+ value: EuclidValue;
1052
+ metadata: Record<string, unknown>;
1053
+ }
1054
+ /** An IF block; all comparisons in `condition` are ANDed. camelCase on the wire. */
1055
+ interface EuclidIfStatement {
1056
+ condition: EuclidComparison[];
1057
+ nested?: EuclidIfStatement[] | null;
1058
+ }
1059
+ /** How a matched rule prices the transaction. snake_case on the wire. */
1060
+ type PlatformFeeKind = 'percentage' | 'flat' | 'combined';
1061
+ interface PlatformFeeOutput {
1062
+ fee_type: PlatformFeeKind;
1063
+ /** Percentage fee, e.g. `2.5` means 2.5%. */
1064
+ percentage_fee?: number | null;
1065
+ /** Flat fee in minor units. */
1066
+ flat_fee_amount?: number | null;
1067
+ flat_fee_currency?: string | null;
1068
+ min_fee_amount?: number | null;
1069
+ max_fee_amount?: number | null;
1070
+ }
1071
+ /** The Euclid program output `O`: a matched branch may set a concrete `fee`. */
1072
+ interface PlatformFeeRuleOutput {
1073
+ fee?: PlatformFeeOutput | null;
1074
+ }
1075
+ /** A single fee rule (`Rule<PlatformFeeRules>`). camelCase on the wire. */
1076
+ interface PlatformFeeRule {
1077
+ name: string;
1078
+ connectorSelection: PlatformFeeRuleOutput;
1079
+ statements: EuclidIfStatement[];
1080
+ }
1081
+ /** The fee-rule program (`Program<PlatformFeeRules>`). camelCase on the wire. */
1082
+ interface PlatformFeeProgram {
1083
+ defaultSelection: PlatformFeeRuleOutput;
1084
+ rules: PlatformFeeRule[];
1085
+ /** Required on the wire — send `{}` when empty. */
1086
+ metadata: Record<string, unknown>;
1087
+ }
1088
+ /** Full request body. `fee_owner` is injected by the SDK per surface. */
1089
+ interface PlatformFeeRuleRequest {
1090
+ algorithm: PlatformFeeProgram;
1091
+ name?: string | null;
1092
+ profile_id?: string | null;
1093
+ fee_owner: FeeOwner;
1094
+ /** RFC3339 timestamp; defaults to now server-side. */
1095
+ valid_from?: string | null;
1096
+ /** RFC3339 timestamp; open-ended when unset. */
1097
+ valid_until?: string | null;
1098
+ }
1099
+ /** User-facing input; the resource method adds `fee_owner`. */
1100
+ type PlatformFeeRuleInput = Omit<PlatformFeeRuleRequest, 'fee_owner'>;
1101
+ /** The stored program. `created_at`/`modified_at` are unix-second integers. */
1102
+ interface PlatformFeeRuleRecord {
1103
+ name: string;
1104
+ fee_owner: FeeOwner;
1105
+ algorithm: PlatformFeeProgram;
1106
+ created_at: number;
1107
+ modified_at: number;
1108
+ }
1012
1109
  interface ProjectCreateRequest {
1013
1110
  project_name: string;
1014
1111
  description?: string | null;
@@ -2579,9 +2676,15 @@ declare class Events {
2579
2676
  * specific shop (via `shop_id`). Merchants can CRUD their own fee
2580
2677
  * overrides; platform-wide fee programs are administered by Delopay and
2581
2678
  * not exposed here.
2679
+ *
2680
+ * `fees.rules` manages the merchant-owned Euclid fee-rule program (a single
2681
+ * active program per merchant), which takes precedence over the flat schedules
2682
+ * above. Build the program with the `feeProgram()` helper.
2582
2683
  */
2583
2684
  declare class Fees {
2584
2685
  private readonly request;
2686
+ /** Merchant-owned Euclid fee-rule program (`/merchant-fees/rules`). */
2687
+ readonly rules: FeeRulesManager;
2585
2688
  constructor(request: RequestFn);
2586
2689
  /**
2587
2690
  * Create a merchant-scoped fee schedule (optionally per-shop).
@@ -2610,6 +2713,35 @@ declare class Fees {
2610
2713
  */
2611
2714
  delete(feeId: string): Promise<FeeScheduleResponse>;
2612
2715
  }
2716
+ /**
2717
+ * Manages a merchant's single active Euclid fee-rule program. Build the
2718
+ * `algorithm` with `feeProgram()`. The SDK injects `fee_owner: 'merchant'`.
2719
+ */
2720
+ declare class FeeRulesManager {
2721
+ private readonly request;
2722
+ constructor(request: RequestFn);
2723
+ /**
2724
+ * Create or replace the merchant's fee-rule program (a new active version;
2725
+ * the previous version is deactivated server-side).
2726
+ *
2727
+ * @param params - The program plus optional name / shop scope / validity window.
2728
+ * @param merchantId - The merchant account ID.
2729
+ */
2730
+ upsert(params: PlatformFeeRuleInput, merchantId: string): Promise<PlatformFeeRuleRecord>;
2731
+ /**
2732
+ * Retrieve the merchant's active fee-rule program, or `null` if none.
2733
+ *
2734
+ * @param merchantId - The merchant account ID.
2735
+ */
2736
+ retrieve(merchantId: string): Promise<PlatformFeeRuleRecord | null>;
2737
+ /**
2738
+ * Deactivate the merchant's active fee-rule program (falls back to the flat
2739
+ * fee schedules / volume tier). Idempotent.
2740
+ *
2741
+ * @param merchantId - The merchant account ID.
2742
+ */
2743
+ delete(merchantId: string): Promise<void>;
2744
+ }
2613
2745
 
2614
2746
  /** View and revoke recurring payment mandates. */
2615
2747
  declare class Mandates {
@@ -4098,6 +4230,81 @@ declare const Webhooks: {
4098
4230
  verify(rawBody: string | Uint8Array, signatureHeader: string, secret: string): Promise<WebhookEvent>;
4099
4231
  };
4100
4232
 
4233
+ /**
4234
+ * How a rule (or the default) prices a transaction. `fee_type` is inferred:
4235
+ * percentage-only → `percentage`, flat-only → `flat`, both → `combined`.
4236
+ */
4237
+ interface FeeSpecInput {
4238
+ /** Percentage fee, e.g. `2.5` means 2.5%. */
4239
+ percentage?: number;
4240
+ /** Flat fee in minor units. */
4241
+ flat?: number;
4242
+ /** ISO 4217 currency for the flat fee. */
4243
+ flatCurrency?: string;
4244
+ /** Clamp floor in minor units. */
4245
+ min?: number;
4246
+ /** Clamp ceiling in minor units. */
4247
+ max?: number;
4248
+ }
4249
+ /**
4250
+ * Friendly conditions for a rule. Every provided key becomes one condition and
4251
+ * they are ANDed together. For dimensions not covered here (payment-method-type
4252
+ * keys like `crypto`/`wallet`, metadata, value arrays) use `rawConditions`.
4253
+ */
4254
+ interface FeeRuleConditions {
4255
+ paymentMethod?: PaymentMethod;
4256
+ connector?: Connector;
4257
+ currency?: Currency;
4258
+ cardNetwork?: string;
4259
+ /** `amount == n` (minor units). */
4260
+ amountEquals?: number;
4261
+ /** `amount > n` (minor units). */
4262
+ amountGreaterThan?: number;
4263
+ /** `amount < n` (minor units). */
4264
+ amountLessThan?: number;
4265
+ }
4266
+ interface FeeRuleInput {
4267
+ name: string;
4268
+ /** Friendly conditions (ANDed). Omit for an always-matching rule (prefer `otherwise`). */
4269
+ when?: FeeRuleConditions;
4270
+ /** Extra raw conditions ANDed in, for dimensions `when` does not cover. */
4271
+ rawConditions?: EuclidComparison[];
4272
+ fee: FeeSpecInput;
4273
+ }
4274
+ /**
4275
+ * Fluent builder for a platform fee-rule program. Emits the exact Euclid wire
4276
+ * shape (camelCase tree, tagged values, `metadata: {}` everywhere) so callers
4277
+ * never hand-write the AST. Rules are evaluated in order; the first match wins,
4278
+ * else `otherwise` (the default selection).
4279
+ *
4280
+ * @example
4281
+ * ```ts
4282
+ * const algorithm = feeProgram()
4283
+ * .rule({ name: 'crypto', when: { paymentMethod: 'crypto' }, fee: { percentage: 1.0 } })
4284
+ * .rule({
4285
+ * name: 'card_on_cryptomus',
4286
+ * when: { paymentMethod: 'card', connector: 'cryptomus' },
4287
+ * fee: { percentage: 2.0 },
4288
+ * })
4289
+ * .otherwise({ percentage: 3.0 })
4290
+ * .build();
4291
+ *
4292
+ * await delopay.fees.rules.upsert({ algorithm }, merchantId);
4293
+ * ```
4294
+ */
4295
+ declare class FeeProgramBuilder {
4296
+ private readonly rules;
4297
+ private defaultFee;
4298
+ /** Append a rule. Provided `when`/`rawConditions` are ANDed. */
4299
+ rule(input: FeeRuleInput): this;
4300
+ /** Set the default selection (applied when no rule matches). */
4301
+ otherwise(fee: FeeSpecInput): this;
4302
+ /** Produce the wire-ready program. */
4303
+ build(): PlatformFeeProgram;
4304
+ }
4305
+ /** Start building a platform fee-rule program. See {@link FeeProgramBuilder}. */
4306
+ declare function feeProgram(): FeeProgramBuilder;
4307
+
4101
4308
  type CornerRadius = 'square' | 'small' | 'medium' | 'large' | 'pill';
4102
4309
  type NonPillRadius = Exclude<CornerRadius, 'pill'>;
4103
4310
  type SpacingScale = 'compact' | 'comfortable' | 'spacious';
@@ -4236,4 +4443,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
4236
4443
  declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
4237
4444
  declare function shadowFor(style: SurfaceStyle): string;
4238
4445
 
4239
- export { type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, AnalyticsDashboard, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, 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 CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, 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 IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, 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 NonPillRadius, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCreateRequest, type RegionResponse, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, 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 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 UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, logoDimensions, parseImportedBranding, radiusValue, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
4446
+ export { type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, AnalyticsDashboard, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, 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 CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, 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 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 IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, 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 NonPillRadius, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, 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 ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCreateRequest, type RegionResponse, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, 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 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 UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, logoDimensions, parseImportedBranding, radiusValue, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
package/dist/index.d.ts CHANGED
@@ -1009,6 +1009,103 @@ interface FeeScheduleResponse {
1009
1009
  max_fee_amount?: number | null;
1010
1010
  description?: string | null;
1011
1011
  }
1012
+ /** Euclid comparison operator. */
1013
+ type EuclidComparisonType = 'equal' | 'not_equal' | 'less_than' | 'less_than_equal' | 'greater_than' | 'greater_than_equal';
1014
+ /** A tagged Euclid value. Enum conditions use `enum_variant`; amount uses `number`. */
1015
+ type EuclidValue = {
1016
+ type: 'number';
1017
+ value: number;
1018
+ } | {
1019
+ type: 'enum_variant';
1020
+ value: string;
1021
+ } | {
1022
+ type: 'str_value';
1023
+ value: string;
1024
+ } | {
1025
+ type: 'number_array';
1026
+ value: number[];
1027
+ } | {
1028
+ type: 'enum_variant_array';
1029
+ value: string[];
1030
+ } | {
1031
+ type: 'metadata_variant';
1032
+ value: {
1033
+ key: string;
1034
+ value: string;
1035
+ };
1036
+ } | {
1037
+ type: 'number_comparison_array';
1038
+ value: {
1039
+ comparisonType: EuclidComparisonType;
1040
+ number: number;
1041
+ }[];
1042
+ };
1043
+ /**
1044
+ * A single condition. `lhs` is a backend dimension key — e.g. `payment_method`,
1045
+ * `connector`, `currency`, `card_network`, `amount`, or a payment-method-type key
1046
+ * (`crypto`, `wallet`, `bank_redirect`, …). camelCase on the wire.
1047
+ */
1048
+ interface EuclidComparison {
1049
+ lhs: string;
1050
+ comparison: EuclidComparisonType;
1051
+ value: EuclidValue;
1052
+ metadata: Record<string, unknown>;
1053
+ }
1054
+ /** An IF block; all comparisons in `condition` are ANDed. camelCase on the wire. */
1055
+ interface EuclidIfStatement {
1056
+ condition: EuclidComparison[];
1057
+ nested?: EuclidIfStatement[] | null;
1058
+ }
1059
+ /** How a matched rule prices the transaction. snake_case on the wire. */
1060
+ type PlatformFeeKind = 'percentage' | 'flat' | 'combined';
1061
+ interface PlatformFeeOutput {
1062
+ fee_type: PlatformFeeKind;
1063
+ /** Percentage fee, e.g. `2.5` means 2.5%. */
1064
+ percentage_fee?: number | null;
1065
+ /** Flat fee in minor units. */
1066
+ flat_fee_amount?: number | null;
1067
+ flat_fee_currency?: string | null;
1068
+ min_fee_amount?: number | null;
1069
+ max_fee_amount?: number | null;
1070
+ }
1071
+ /** The Euclid program output `O`: a matched branch may set a concrete `fee`. */
1072
+ interface PlatformFeeRuleOutput {
1073
+ fee?: PlatformFeeOutput | null;
1074
+ }
1075
+ /** A single fee rule (`Rule<PlatformFeeRules>`). camelCase on the wire. */
1076
+ interface PlatformFeeRule {
1077
+ name: string;
1078
+ connectorSelection: PlatformFeeRuleOutput;
1079
+ statements: EuclidIfStatement[];
1080
+ }
1081
+ /** The fee-rule program (`Program<PlatformFeeRules>`). camelCase on the wire. */
1082
+ interface PlatformFeeProgram {
1083
+ defaultSelection: PlatformFeeRuleOutput;
1084
+ rules: PlatformFeeRule[];
1085
+ /** Required on the wire — send `{}` when empty. */
1086
+ metadata: Record<string, unknown>;
1087
+ }
1088
+ /** Full request body. `fee_owner` is injected by the SDK per surface. */
1089
+ interface PlatformFeeRuleRequest {
1090
+ algorithm: PlatformFeeProgram;
1091
+ name?: string | null;
1092
+ profile_id?: string | null;
1093
+ fee_owner: FeeOwner;
1094
+ /** RFC3339 timestamp; defaults to now server-side. */
1095
+ valid_from?: string | null;
1096
+ /** RFC3339 timestamp; open-ended when unset. */
1097
+ valid_until?: string | null;
1098
+ }
1099
+ /** User-facing input; the resource method adds `fee_owner`. */
1100
+ type PlatformFeeRuleInput = Omit<PlatformFeeRuleRequest, 'fee_owner'>;
1101
+ /** The stored program. `created_at`/`modified_at` are unix-second integers. */
1102
+ interface PlatformFeeRuleRecord {
1103
+ name: string;
1104
+ fee_owner: FeeOwner;
1105
+ algorithm: PlatformFeeProgram;
1106
+ created_at: number;
1107
+ modified_at: number;
1108
+ }
1012
1109
  interface ProjectCreateRequest {
1013
1110
  project_name: string;
1014
1111
  description?: string | null;
@@ -2579,9 +2676,15 @@ declare class Events {
2579
2676
  * specific shop (via `shop_id`). Merchants can CRUD their own fee
2580
2677
  * overrides; platform-wide fee programs are administered by Delopay and
2581
2678
  * not exposed here.
2679
+ *
2680
+ * `fees.rules` manages the merchant-owned Euclid fee-rule program (a single
2681
+ * active program per merchant), which takes precedence over the flat schedules
2682
+ * above. Build the program with the `feeProgram()` helper.
2582
2683
  */
2583
2684
  declare class Fees {
2584
2685
  private readonly request;
2686
+ /** Merchant-owned Euclid fee-rule program (`/merchant-fees/rules`). */
2687
+ readonly rules: FeeRulesManager;
2585
2688
  constructor(request: RequestFn);
2586
2689
  /**
2587
2690
  * Create a merchant-scoped fee schedule (optionally per-shop).
@@ -2610,6 +2713,35 @@ declare class Fees {
2610
2713
  */
2611
2714
  delete(feeId: string): Promise<FeeScheduleResponse>;
2612
2715
  }
2716
+ /**
2717
+ * Manages a merchant's single active Euclid fee-rule program. Build the
2718
+ * `algorithm` with `feeProgram()`. The SDK injects `fee_owner: 'merchant'`.
2719
+ */
2720
+ declare class FeeRulesManager {
2721
+ private readonly request;
2722
+ constructor(request: RequestFn);
2723
+ /**
2724
+ * Create or replace the merchant's fee-rule program (a new active version;
2725
+ * the previous version is deactivated server-side).
2726
+ *
2727
+ * @param params - The program plus optional name / shop scope / validity window.
2728
+ * @param merchantId - The merchant account ID.
2729
+ */
2730
+ upsert(params: PlatformFeeRuleInput, merchantId: string): Promise<PlatformFeeRuleRecord>;
2731
+ /**
2732
+ * Retrieve the merchant's active fee-rule program, or `null` if none.
2733
+ *
2734
+ * @param merchantId - The merchant account ID.
2735
+ */
2736
+ retrieve(merchantId: string): Promise<PlatformFeeRuleRecord | null>;
2737
+ /**
2738
+ * Deactivate the merchant's active fee-rule program (falls back to the flat
2739
+ * fee schedules / volume tier). Idempotent.
2740
+ *
2741
+ * @param merchantId - The merchant account ID.
2742
+ */
2743
+ delete(merchantId: string): Promise<void>;
2744
+ }
2613
2745
 
2614
2746
  /** View and revoke recurring payment mandates. */
2615
2747
  declare class Mandates {
@@ -4098,6 +4230,81 @@ declare const Webhooks: {
4098
4230
  verify(rawBody: string | Uint8Array, signatureHeader: string, secret: string): Promise<WebhookEvent>;
4099
4231
  };
4100
4232
 
4233
+ /**
4234
+ * How a rule (or the default) prices a transaction. `fee_type` is inferred:
4235
+ * percentage-only → `percentage`, flat-only → `flat`, both → `combined`.
4236
+ */
4237
+ interface FeeSpecInput {
4238
+ /** Percentage fee, e.g. `2.5` means 2.5%. */
4239
+ percentage?: number;
4240
+ /** Flat fee in minor units. */
4241
+ flat?: number;
4242
+ /** ISO 4217 currency for the flat fee. */
4243
+ flatCurrency?: string;
4244
+ /** Clamp floor in minor units. */
4245
+ min?: number;
4246
+ /** Clamp ceiling in minor units. */
4247
+ max?: number;
4248
+ }
4249
+ /**
4250
+ * Friendly conditions for a rule. Every provided key becomes one condition and
4251
+ * they are ANDed together. For dimensions not covered here (payment-method-type
4252
+ * keys like `crypto`/`wallet`, metadata, value arrays) use `rawConditions`.
4253
+ */
4254
+ interface FeeRuleConditions {
4255
+ paymentMethod?: PaymentMethod;
4256
+ connector?: Connector;
4257
+ currency?: Currency;
4258
+ cardNetwork?: string;
4259
+ /** `amount == n` (minor units). */
4260
+ amountEquals?: number;
4261
+ /** `amount > n` (minor units). */
4262
+ amountGreaterThan?: number;
4263
+ /** `amount < n` (minor units). */
4264
+ amountLessThan?: number;
4265
+ }
4266
+ interface FeeRuleInput {
4267
+ name: string;
4268
+ /** Friendly conditions (ANDed). Omit for an always-matching rule (prefer `otherwise`). */
4269
+ when?: FeeRuleConditions;
4270
+ /** Extra raw conditions ANDed in, for dimensions `when` does not cover. */
4271
+ rawConditions?: EuclidComparison[];
4272
+ fee: FeeSpecInput;
4273
+ }
4274
+ /**
4275
+ * Fluent builder for a platform fee-rule program. Emits the exact Euclid wire
4276
+ * shape (camelCase tree, tagged values, `metadata: {}` everywhere) so callers
4277
+ * never hand-write the AST. Rules are evaluated in order; the first match wins,
4278
+ * else `otherwise` (the default selection).
4279
+ *
4280
+ * @example
4281
+ * ```ts
4282
+ * const algorithm = feeProgram()
4283
+ * .rule({ name: 'crypto', when: { paymentMethod: 'crypto' }, fee: { percentage: 1.0 } })
4284
+ * .rule({
4285
+ * name: 'card_on_cryptomus',
4286
+ * when: { paymentMethod: 'card', connector: 'cryptomus' },
4287
+ * fee: { percentage: 2.0 },
4288
+ * })
4289
+ * .otherwise({ percentage: 3.0 })
4290
+ * .build();
4291
+ *
4292
+ * await delopay.fees.rules.upsert({ algorithm }, merchantId);
4293
+ * ```
4294
+ */
4295
+ declare class FeeProgramBuilder {
4296
+ private readonly rules;
4297
+ private defaultFee;
4298
+ /** Append a rule. Provided `when`/`rawConditions` are ANDed. */
4299
+ rule(input: FeeRuleInput): this;
4300
+ /** Set the default selection (applied when no rule matches). */
4301
+ otherwise(fee: FeeSpecInput): this;
4302
+ /** Produce the wire-ready program. */
4303
+ build(): PlatformFeeProgram;
4304
+ }
4305
+ /** Start building a platform fee-rule program. See {@link FeeProgramBuilder}. */
4306
+ declare function feeProgram(): FeeProgramBuilder;
4307
+
4101
4308
  type CornerRadius = 'square' | 'small' | 'medium' | 'large' | 'pill';
4102
4309
  type NonPillRadius = Exclude<CornerRadius, 'pill'>;
4103
4310
  type SpacingScale = 'compact' | 'comfortable' | 'spacious';
@@ -4236,4 +4443,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
4236
4443
  declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
4237
4444
  declare function shadowFor(style: SurfaceStyle): string;
4238
4445
 
4239
- export { type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, AnalyticsDashboard, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, 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 CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, 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 IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, 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 NonPillRadius, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCreateRequest, type RegionResponse, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, 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 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 UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, logoDimensions, parseImportedBranding, radiusValue, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
4446
+ export { type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, AnalyticsDashboard, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, 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 CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, 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 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 IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, 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 NonPillRadius, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, 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 ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCreateRequest, type RegionResponse, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, 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 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 UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, logoDimensions, parseImportedBranding, radiusValue, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ import {
14
14
  DelopayError,
15
15
  Export,
16
16
  FeatureMatrix,
17
+ FeeProgramBuilder,
17
18
  Files,
18
19
  Forex,
19
20
  Regions,
@@ -29,6 +30,7 @@ import {
29
30
  defaultBranding,
30
31
  encodeBadges,
31
32
  encodeBranding,
33
+ feeProgram,
32
34
  fontStack,
33
35
  fontWeightValue,
34
36
  inputPadValue,
@@ -41,7 +43,7 @@ import {
41
43
  shadowFor,
42
44
  surfacePadValue,
43
45
  verticalGapValue
44
- } from "./chunk-45OPT3EW.js";
46
+ } from "./chunk-ZS7ALFE7.js";
45
47
  export {
46
48
  Analytics,
47
49
  AnalyticsDashboard,
@@ -58,6 +60,7 @@ export {
58
60
  DelopayError,
59
61
  Export,
60
62
  FeatureMatrix,
63
+ FeeProgramBuilder,
61
64
  Files,
62
65
  Forex,
63
66
  Regions,
@@ -73,6 +76,7 @@ export {
73
76
  defaultBranding,
74
77
  encodeBadges,
75
78
  encodeBranding,
79
+ feeProgram,
76
80
  fontStack,
77
81
  fontWeightValue,
78
82
  inputPadValue,