@delopay/sdk 0.41.0 → 0.43.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/{chunk-DMNCVY25.js → chunk-235UFV7Z.js} +61 -1
- package/dist/chunk-235UFV7Z.js.map +1 -0
- package/dist/index.cjs +60 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +113 -1
- package/dist/index.d.ts +113 -1
- package/dist/index.js +1 -1
- package/dist/internal.cjs +60 -0
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DMNCVY25.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1296,6 +1296,65 @@ interface RoutingDictionaryRecord {
|
|
|
1296
1296
|
algorithm_for: TransactionType | null;
|
|
1297
1297
|
decision_engine_routing_id?: string | null;
|
|
1298
1298
|
}
|
|
1299
|
+
/** Response for `GET /routing/connector-restrictions/{profileId}`. */
|
|
1300
|
+
interface ProfileDeniedConnectorsResponse {
|
|
1301
|
+
/** Connector names not routed for this shop (e.g. "paypal"). */
|
|
1302
|
+
denied_connectors: string[];
|
|
1303
|
+
}
|
|
1304
|
+
/**
|
|
1305
|
+
* A buyer-facing surcharge added to the checkout amount (issue #195).
|
|
1306
|
+
*
|
|
1307
|
+
* Either a flat amount in minor units, or a percentage of the order amount.
|
|
1308
|
+
*/
|
|
1309
|
+
type MethodSurcharge = {
|
|
1310
|
+
fixed: {
|
|
1311
|
+
amount: number;
|
|
1312
|
+
};
|
|
1313
|
+
} | {
|
|
1314
|
+
rate: {
|
|
1315
|
+
percent: number;
|
|
1316
|
+
};
|
|
1317
|
+
};
|
|
1318
|
+
/** One per-payment-method surcharge entry. */
|
|
1319
|
+
interface PerMethodSurchargeItem {
|
|
1320
|
+
/** e.g. "card", "crypto", "wallet". */
|
|
1321
|
+
payment_method: string;
|
|
1322
|
+
/** Optional finer scope (e.g. a specific wallet/crypto). Not valid for cards — use `card_network`. */
|
|
1323
|
+
payment_method_type?: string | null;
|
|
1324
|
+
/** Optional card-network scope (card only), e.g. "Visa". */
|
|
1325
|
+
card_network?: string | null;
|
|
1326
|
+
surcharge: MethodSurcharge;
|
|
1327
|
+
/** Optional tax on the surcharge, as a percentage of the surcharge amount. */
|
|
1328
|
+
tax_on_surcharge_percent?: number | null;
|
|
1329
|
+
}
|
|
1330
|
+
/** Request for `PUT /routing/surcharge/rules`. */
|
|
1331
|
+
interface SurchargeRuleRequest {
|
|
1332
|
+
name?: string | null;
|
|
1333
|
+
/** Shop scope. Omit/null = merchant-wide. */
|
|
1334
|
+
profile_id?: string | null;
|
|
1335
|
+
/** Per-method surcharges, evaluated top-to-bottom (first match wins). */
|
|
1336
|
+
surcharges?: PerMethodSurchargeItem[];
|
|
1337
|
+
/** Applied when no per-method entry matches. Omit/null = no surcharge. */
|
|
1338
|
+
default_surcharge?: MethodSurcharge | null;
|
|
1339
|
+
show_surcharge_breakup_screen?: boolean | null;
|
|
1340
|
+
/** RFC3339; defaults to now when omitted. */
|
|
1341
|
+
valid_from?: string | null;
|
|
1342
|
+
/** RFC3339; omit = open-ended. */
|
|
1343
|
+
valid_until?: string | null;
|
|
1344
|
+
}
|
|
1345
|
+
/** Response for `GET/PUT /routing/surcharge/rules` (the structured config + metadata). */
|
|
1346
|
+
interface SurchargeRuleResponse {
|
|
1347
|
+
name: string;
|
|
1348
|
+
profile_id: string | null;
|
|
1349
|
+
surcharges?: PerMethodSurchargeItem[];
|
|
1350
|
+
default_surcharge?: MethodSurcharge | null;
|
|
1351
|
+
show_surcharge_breakup_screen?: boolean | null;
|
|
1352
|
+
version: number;
|
|
1353
|
+
/** RFC3339. */
|
|
1354
|
+
valid_from: string;
|
|
1355
|
+
/** RFC3339, or null when open-ended. */
|
|
1356
|
+
valid_until: string | null;
|
|
1357
|
+
}
|
|
1299
1358
|
/** Full routing config returned by `GET /routing/{id}`. */
|
|
1300
1359
|
interface MerchantRoutingAlgorithm {
|
|
1301
1360
|
id: string;
|
|
@@ -3422,6 +3481,8 @@ declare class Relay {
|
|
|
3422
3481
|
declare class Routing {
|
|
3423
3482
|
private readonly request;
|
|
3424
3483
|
readonly decision: RoutingDecisionManager;
|
|
3484
|
+
/** Merchant-friendly, per-payment-method surcharge rules (no Euclid DSL). */
|
|
3485
|
+
readonly surchargeRules: SurchargeRules;
|
|
3425
3486
|
constructor(request: RequestFn);
|
|
3426
3487
|
/**
|
|
3427
3488
|
* Create a new routing algorithm.
|
|
@@ -3471,6 +3532,13 @@ declare class Routing {
|
|
|
3471
3532
|
* @returns The routing dictionary (records + currently active id).
|
|
3472
3533
|
*/
|
|
3473
3534
|
list(): Promise<RoutingDictionary>;
|
|
3535
|
+
/**
|
|
3536
|
+
* Connector names denied at routing for a shop (explicit denies plus
|
|
3537
|
+
* whitelist-implied exclusions). Read-only; surfaced in the routing builder.
|
|
3538
|
+
*
|
|
3539
|
+
* `GET /routing/connector-restrictions/{profileId}`
|
|
3540
|
+
*/
|
|
3541
|
+
connectorRestrictions(profileId: string): Promise<ProfileDeniedConnectorsResponse>;
|
|
3474
3542
|
/** Get active routing config. `GET /routing/active` */
|
|
3475
3543
|
getActive(): Promise<LinkedRoutingConfigRetrieveResponse>;
|
|
3476
3544
|
/** Update default routing config. `POST /routing/default` */
|
|
@@ -3506,6 +3574,50 @@ declare class RoutingDecisionManager {
|
|
|
3506
3574
|
/** Delete surcharge decision config. `DELETE /routing/decision/surcharge` */
|
|
3507
3575
|
deleteSurcharge(): Promise<Record<string, unknown>>;
|
|
3508
3576
|
}
|
|
3577
|
+
/**
|
|
3578
|
+
* Merchant-friendly surcharge rules: configure a per-payment-method surcharge
|
|
3579
|
+
* (fixed or %) added to the amount the buyer pays — without hand-writing the
|
|
3580
|
+
* Euclid DSL. Scope to a shop via `profile_id` (omit for merchant-wide).
|
|
3581
|
+
*
|
|
3582
|
+
* Distinct from the platform fee (a balance deduction): a surcharge changes what
|
|
3583
|
+
* the buyer is charged.
|
|
3584
|
+
*/
|
|
3585
|
+
declare class SurchargeRules {
|
|
3586
|
+
private readonly request;
|
|
3587
|
+
constructor(request: RequestFn);
|
|
3588
|
+
/**
|
|
3589
|
+
* Create or replace the surcharge program for a scope.
|
|
3590
|
+
*
|
|
3591
|
+
* `PUT /routing/surcharge/rules`
|
|
3592
|
+
*
|
|
3593
|
+
* @example
|
|
3594
|
+
* ```typescript
|
|
3595
|
+
* await delopay.routing.surchargeRules.upsert({
|
|
3596
|
+
* surcharges: [
|
|
3597
|
+
* { payment_method: 'crypto', surcharge: { rate: { percent: 1.0 } } },
|
|
3598
|
+
* { payment_method: 'card', surcharge: { fixed: { amount: 35 } } },
|
|
3599
|
+
* ],
|
|
3600
|
+
* });
|
|
3601
|
+
* ```
|
|
3602
|
+
*/
|
|
3603
|
+
upsert(params: SurchargeRuleRequest): Promise<SurchargeRuleResponse>;
|
|
3604
|
+
/**
|
|
3605
|
+
* Retrieve the active surcharge program for a scope, or `null` when none is set.
|
|
3606
|
+
*
|
|
3607
|
+
* `GET /routing/surcharge/rules?profile_id={profileId}`
|
|
3608
|
+
*
|
|
3609
|
+
* @param profileId - Shop scope. Omit for the merchant-wide rule.
|
|
3610
|
+
*/
|
|
3611
|
+
retrieve(profileId?: string): Promise<SurchargeRuleResponse | null>;
|
|
3612
|
+
/**
|
|
3613
|
+
* Deactivate the active surcharge program for a scope.
|
|
3614
|
+
*
|
|
3615
|
+
* `DELETE /routing/surcharge/rules?profile_id={profileId}`
|
|
3616
|
+
*
|
|
3617
|
+
* @param profileId - Shop scope. Omit for the merchant-wide rule.
|
|
3618
|
+
*/
|
|
3619
|
+
delete(profileId?: string): Promise<void>;
|
|
3620
|
+
}
|
|
3509
3621
|
|
|
3510
3622
|
/** Index discriminator returned for each search result group. */
|
|
3511
3623
|
type SearchIndex = 'payment_attempts' | 'payment_intents' | 'refunds' | 'disputes' | 'payouts' | 'sessionizer_payment_attempts' | 'sessionizer_payment_intents' | 'sessionizer_refunds' | 'sessionizer_disputes' | 'routing_rules' | 'webhook_events' | 'audit_logs' | 'subscriptions';
|
|
@@ -4565,4 +4677,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
|
|
|
4565
4677
|
declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
|
|
4566
4678
|
declare function shadowFor(style: SurfaceStyle): string;
|
|
4567
4679
|
|
|
4568
|
-
export { type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, 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 BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, 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 };
|
|
4680
|
+
export { type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, 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 BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, 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 MethodSurcharge, 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 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 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 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 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
|
@@ -1296,6 +1296,65 @@ interface RoutingDictionaryRecord {
|
|
|
1296
1296
|
algorithm_for: TransactionType | null;
|
|
1297
1297
|
decision_engine_routing_id?: string | null;
|
|
1298
1298
|
}
|
|
1299
|
+
/** Response for `GET /routing/connector-restrictions/{profileId}`. */
|
|
1300
|
+
interface ProfileDeniedConnectorsResponse {
|
|
1301
|
+
/** Connector names not routed for this shop (e.g. "paypal"). */
|
|
1302
|
+
denied_connectors: string[];
|
|
1303
|
+
}
|
|
1304
|
+
/**
|
|
1305
|
+
* A buyer-facing surcharge added to the checkout amount (issue #195).
|
|
1306
|
+
*
|
|
1307
|
+
* Either a flat amount in minor units, or a percentage of the order amount.
|
|
1308
|
+
*/
|
|
1309
|
+
type MethodSurcharge = {
|
|
1310
|
+
fixed: {
|
|
1311
|
+
amount: number;
|
|
1312
|
+
};
|
|
1313
|
+
} | {
|
|
1314
|
+
rate: {
|
|
1315
|
+
percent: number;
|
|
1316
|
+
};
|
|
1317
|
+
};
|
|
1318
|
+
/** One per-payment-method surcharge entry. */
|
|
1319
|
+
interface PerMethodSurchargeItem {
|
|
1320
|
+
/** e.g. "card", "crypto", "wallet". */
|
|
1321
|
+
payment_method: string;
|
|
1322
|
+
/** Optional finer scope (e.g. a specific wallet/crypto). Not valid for cards — use `card_network`. */
|
|
1323
|
+
payment_method_type?: string | null;
|
|
1324
|
+
/** Optional card-network scope (card only), e.g. "Visa". */
|
|
1325
|
+
card_network?: string | null;
|
|
1326
|
+
surcharge: MethodSurcharge;
|
|
1327
|
+
/** Optional tax on the surcharge, as a percentage of the surcharge amount. */
|
|
1328
|
+
tax_on_surcharge_percent?: number | null;
|
|
1329
|
+
}
|
|
1330
|
+
/** Request for `PUT /routing/surcharge/rules`. */
|
|
1331
|
+
interface SurchargeRuleRequest {
|
|
1332
|
+
name?: string | null;
|
|
1333
|
+
/** Shop scope. Omit/null = merchant-wide. */
|
|
1334
|
+
profile_id?: string | null;
|
|
1335
|
+
/** Per-method surcharges, evaluated top-to-bottom (first match wins). */
|
|
1336
|
+
surcharges?: PerMethodSurchargeItem[];
|
|
1337
|
+
/** Applied when no per-method entry matches. Omit/null = no surcharge. */
|
|
1338
|
+
default_surcharge?: MethodSurcharge | null;
|
|
1339
|
+
show_surcharge_breakup_screen?: boolean | null;
|
|
1340
|
+
/** RFC3339; defaults to now when omitted. */
|
|
1341
|
+
valid_from?: string | null;
|
|
1342
|
+
/** RFC3339; omit = open-ended. */
|
|
1343
|
+
valid_until?: string | null;
|
|
1344
|
+
}
|
|
1345
|
+
/** Response for `GET/PUT /routing/surcharge/rules` (the structured config + metadata). */
|
|
1346
|
+
interface SurchargeRuleResponse {
|
|
1347
|
+
name: string;
|
|
1348
|
+
profile_id: string | null;
|
|
1349
|
+
surcharges?: PerMethodSurchargeItem[];
|
|
1350
|
+
default_surcharge?: MethodSurcharge | null;
|
|
1351
|
+
show_surcharge_breakup_screen?: boolean | null;
|
|
1352
|
+
version: number;
|
|
1353
|
+
/** RFC3339. */
|
|
1354
|
+
valid_from: string;
|
|
1355
|
+
/** RFC3339, or null when open-ended. */
|
|
1356
|
+
valid_until: string | null;
|
|
1357
|
+
}
|
|
1299
1358
|
/** Full routing config returned by `GET /routing/{id}`. */
|
|
1300
1359
|
interface MerchantRoutingAlgorithm {
|
|
1301
1360
|
id: string;
|
|
@@ -3422,6 +3481,8 @@ declare class Relay {
|
|
|
3422
3481
|
declare class Routing {
|
|
3423
3482
|
private readonly request;
|
|
3424
3483
|
readonly decision: RoutingDecisionManager;
|
|
3484
|
+
/** Merchant-friendly, per-payment-method surcharge rules (no Euclid DSL). */
|
|
3485
|
+
readonly surchargeRules: SurchargeRules;
|
|
3425
3486
|
constructor(request: RequestFn);
|
|
3426
3487
|
/**
|
|
3427
3488
|
* Create a new routing algorithm.
|
|
@@ -3471,6 +3532,13 @@ declare class Routing {
|
|
|
3471
3532
|
* @returns The routing dictionary (records + currently active id).
|
|
3472
3533
|
*/
|
|
3473
3534
|
list(): Promise<RoutingDictionary>;
|
|
3535
|
+
/**
|
|
3536
|
+
* Connector names denied at routing for a shop (explicit denies plus
|
|
3537
|
+
* whitelist-implied exclusions). Read-only; surfaced in the routing builder.
|
|
3538
|
+
*
|
|
3539
|
+
* `GET /routing/connector-restrictions/{profileId}`
|
|
3540
|
+
*/
|
|
3541
|
+
connectorRestrictions(profileId: string): Promise<ProfileDeniedConnectorsResponse>;
|
|
3474
3542
|
/** Get active routing config. `GET /routing/active` */
|
|
3475
3543
|
getActive(): Promise<LinkedRoutingConfigRetrieveResponse>;
|
|
3476
3544
|
/** Update default routing config. `POST /routing/default` */
|
|
@@ -3506,6 +3574,50 @@ declare class RoutingDecisionManager {
|
|
|
3506
3574
|
/** Delete surcharge decision config. `DELETE /routing/decision/surcharge` */
|
|
3507
3575
|
deleteSurcharge(): Promise<Record<string, unknown>>;
|
|
3508
3576
|
}
|
|
3577
|
+
/**
|
|
3578
|
+
* Merchant-friendly surcharge rules: configure a per-payment-method surcharge
|
|
3579
|
+
* (fixed or %) added to the amount the buyer pays — without hand-writing the
|
|
3580
|
+
* Euclid DSL. Scope to a shop via `profile_id` (omit for merchant-wide).
|
|
3581
|
+
*
|
|
3582
|
+
* Distinct from the platform fee (a balance deduction): a surcharge changes what
|
|
3583
|
+
* the buyer is charged.
|
|
3584
|
+
*/
|
|
3585
|
+
declare class SurchargeRules {
|
|
3586
|
+
private readonly request;
|
|
3587
|
+
constructor(request: RequestFn);
|
|
3588
|
+
/**
|
|
3589
|
+
* Create or replace the surcharge program for a scope.
|
|
3590
|
+
*
|
|
3591
|
+
* `PUT /routing/surcharge/rules`
|
|
3592
|
+
*
|
|
3593
|
+
* @example
|
|
3594
|
+
* ```typescript
|
|
3595
|
+
* await delopay.routing.surchargeRules.upsert({
|
|
3596
|
+
* surcharges: [
|
|
3597
|
+
* { payment_method: 'crypto', surcharge: { rate: { percent: 1.0 } } },
|
|
3598
|
+
* { payment_method: 'card', surcharge: { fixed: { amount: 35 } } },
|
|
3599
|
+
* ],
|
|
3600
|
+
* });
|
|
3601
|
+
* ```
|
|
3602
|
+
*/
|
|
3603
|
+
upsert(params: SurchargeRuleRequest): Promise<SurchargeRuleResponse>;
|
|
3604
|
+
/**
|
|
3605
|
+
* Retrieve the active surcharge program for a scope, or `null` when none is set.
|
|
3606
|
+
*
|
|
3607
|
+
* `GET /routing/surcharge/rules?profile_id={profileId}`
|
|
3608
|
+
*
|
|
3609
|
+
* @param profileId - Shop scope. Omit for the merchant-wide rule.
|
|
3610
|
+
*/
|
|
3611
|
+
retrieve(profileId?: string): Promise<SurchargeRuleResponse | null>;
|
|
3612
|
+
/**
|
|
3613
|
+
* Deactivate the active surcharge program for a scope.
|
|
3614
|
+
*
|
|
3615
|
+
* `DELETE /routing/surcharge/rules?profile_id={profileId}`
|
|
3616
|
+
*
|
|
3617
|
+
* @param profileId - Shop scope. Omit for the merchant-wide rule.
|
|
3618
|
+
*/
|
|
3619
|
+
delete(profileId?: string): Promise<void>;
|
|
3620
|
+
}
|
|
3509
3621
|
|
|
3510
3622
|
/** Index discriminator returned for each search result group. */
|
|
3511
3623
|
type SearchIndex = 'payment_attempts' | 'payment_intents' | 'refunds' | 'disputes' | 'payouts' | 'sessionizer_payment_attempts' | 'sessionizer_payment_intents' | 'sessionizer_refunds' | 'sessionizer_disputes' | 'routing_rules' | 'webhook_events' | 'audit_logs' | 'subscriptions';
|
|
@@ -4565,4 +4677,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
|
|
|
4565
4677
|
declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
|
|
4566
4678
|
declare function shadowFor(style: SurfaceStyle): string;
|
|
4567
4679
|
|
|
4568
|
-
export { type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, 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 BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, 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 };
|
|
4680
|
+
export { type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, 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 BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, 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 MethodSurcharge, 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 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 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 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 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
package/dist/internal.cjs
CHANGED
|
@@ -1694,6 +1694,7 @@ var Routing = class {
|
|
|
1694
1694
|
constructor(request) {
|
|
1695
1695
|
this.request = request;
|
|
1696
1696
|
this.decision = new RoutingDecisionManager(request);
|
|
1697
|
+
this.surchargeRules = new SurchargeRules(request);
|
|
1697
1698
|
}
|
|
1698
1699
|
/**
|
|
1699
1700
|
* Create a new routing algorithm.
|
|
@@ -1755,6 +1756,18 @@ var Routing = class {
|
|
|
1755
1756
|
async list() {
|
|
1756
1757
|
return this.request("GET", "/routing");
|
|
1757
1758
|
}
|
|
1759
|
+
/**
|
|
1760
|
+
* Connector names denied at routing for a shop (explicit denies plus
|
|
1761
|
+
* whitelist-implied exclusions). Read-only; surfaced in the routing builder.
|
|
1762
|
+
*
|
|
1763
|
+
* `GET /routing/connector-restrictions/{profileId}`
|
|
1764
|
+
*/
|
|
1765
|
+
async connectorRestrictions(profileId) {
|
|
1766
|
+
return this.request(
|
|
1767
|
+
"GET",
|
|
1768
|
+
`/routing/connector-restrictions/${encodeURIComponent(profileId)}`
|
|
1769
|
+
);
|
|
1770
|
+
}
|
|
1758
1771
|
// --- Advanced operations (Task 3.4) ---
|
|
1759
1772
|
/** Get active routing config. `GET /routing/active` */
|
|
1760
1773
|
async getActive() {
|
|
@@ -1824,6 +1837,53 @@ var RoutingDecisionManager = class {
|
|
|
1824
1837
|
return this.request("DELETE", "/routing/decision/surcharge");
|
|
1825
1838
|
}
|
|
1826
1839
|
};
|
|
1840
|
+
var SurchargeRules = class {
|
|
1841
|
+
constructor(request) {
|
|
1842
|
+
this.request = request;
|
|
1843
|
+
}
|
|
1844
|
+
/**
|
|
1845
|
+
* Create or replace the surcharge program for a scope.
|
|
1846
|
+
*
|
|
1847
|
+
* `PUT /routing/surcharge/rules`
|
|
1848
|
+
*
|
|
1849
|
+
* @example
|
|
1850
|
+
* ```typescript
|
|
1851
|
+
* await delopay.routing.surchargeRules.upsert({
|
|
1852
|
+
* surcharges: [
|
|
1853
|
+
* { payment_method: 'crypto', surcharge: { rate: { percent: 1.0 } } },
|
|
1854
|
+
* { payment_method: 'card', surcharge: { fixed: { amount: 35 } } },
|
|
1855
|
+
* ],
|
|
1856
|
+
* });
|
|
1857
|
+
* ```
|
|
1858
|
+
*/
|
|
1859
|
+
async upsert(params) {
|
|
1860
|
+
return this.request("PUT", "/routing/surcharge/rules", { body: params });
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Retrieve the active surcharge program for a scope, or `null` when none is set.
|
|
1864
|
+
*
|
|
1865
|
+
* `GET /routing/surcharge/rules?profile_id={profileId}`
|
|
1866
|
+
*
|
|
1867
|
+
* @param profileId - Shop scope. Omit for the merchant-wide rule.
|
|
1868
|
+
*/
|
|
1869
|
+
async retrieve(profileId) {
|
|
1870
|
+
return this.request("GET", "/routing/surcharge/rules", {
|
|
1871
|
+
query: { profile_id: profileId }
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
/**
|
|
1875
|
+
* Deactivate the active surcharge program for a scope.
|
|
1876
|
+
*
|
|
1877
|
+
* `DELETE /routing/surcharge/rules?profile_id={profileId}`
|
|
1878
|
+
*
|
|
1879
|
+
* @param profileId - Shop scope. Omit for the merchant-wide rule.
|
|
1880
|
+
*/
|
|
1881
|
+
async delete(profileId) {
|
|
1882
|
+
return this.request("DELETE", "/routing/surcharge/rules", {
|
|
1883
|
+
query: { profile_id: profileId }
|
|
1884
|
+
});
|
|
1885
|
+
}
|
|
1886
|
+
};
|
|
1827
1887
|
|
|
1828
1888
|
// src/resources/search.ts
|
|
1829
1889
|
var Search = class {
|