@delopay/sdk 0.62.0 → 0.63.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/README.md +430 -430
- package/dist/{chunk-2OWZIFZO.js → chunk-JCO4CHY7.js} +43 -1
- package/dist/chunk-JCO4CHY7.js.map +1 -0
- package/dist/index.cjs +42 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +128 -3
- package/dist/index.d.ts +128 -3
- package/dist/index.js +1 -1
- package/dist/internal.cjs +42 -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/dist/internal.js.map +1 -1
- package/package.json +63 -64
- package/dist/chunk-2OWZIFZO.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -767,6 +767,25 @@ interface MandateRevokedResponse {
|
|
|
767
767
|
error_code?: string | null;
|
|
768
768
|
error_message?: string | null;
|
|
769
769
|
}
|
|
770
|
+
/** Charset of the random body of a custom-format payment id. */
|
|
771
|
+
type PaymentIdStyle = 'numeric' | 'alphanumeric' | 'alphanumeric_uppercase';
|
|
772
|
+
/**
|
|
773
|
+
* Merchant-configurable format for generated payment ids (cloaking),
|
|
774
|
+
* e.g. `ORD-74219807`. Applied per shop (business profile): payments
|
|
775
|
+
* created without an explicit `payment_id` get `<prefix><random body>`.
|
|
776
|
+
*/
|
|
777
|
+
interface PaymentIdFormatConfig {
|
|
778
|
+
/**
|
|
779
|
+
* Static prefix, e.g. `ORD-`. May be empty. Max 16 chars; allowed
|
|
780
|
+
* characters: ascii alphanumerics, `-`, `_`. Internal prefixes
|
|
781
|
+
* (`pay`, `cus`, ...) are rejected.
|
|
782
|
+
*/
|
|
783
|
+
prefix: string;
|
|
784
|
+
/** Charset used for the random body of the id. */
|
|
785
|
+
style: PaymentIdStyle;
|
|
786
|
+
/** Length of the random body (6..=32). */
|
|
787
|
+
length: number;
|
|
788
|
+
}
|
|
770
789
|
interface ShopCreateRequest {
|
|
771
790
|
shop_name: string;
|
|
772
791
|
return_url?: string | null;
|
|
@@ -788,6 +807,11 @@ interface ShopUpdateRequest {
|
|
|
788
807
|
* clickjacking defense. Example: `["https://shop.acme.com"]`.
|
|
789
808
|
*/
|
|
790
809
|
iframe_allowed_origins?: string[] | null;
|
|
810
|
+
/**
|
|
811
|
+
* Custom format for generated payment ids (cloaking), e.g.
|
|
812
|
+
* `ORD-74219807`. `null` = default `pay_<random>` ids.
|
|
813
|
+
*/
|
|
814
|
+
payment_id_format?: PaymentIdFormatConfig | null;
|
|
791
815
|
}
|
|
792
816
|
interface ShopResponse {
|
|
793
817
|
shop_id: string;
|
|
@@ -804,6 +828,11 @@ interface ShopResponse {
|
|
|
804
828
|
* See {@link ShopUpdateRequest.iframe_allowed_origins}.
|
|
805
829
|
*/
|
|
806
830
|
iframe_allowed_origins?: string[] | null;
|
|
831
|
+
/**
|
|
832
|
+
* Custom format for generated payment ids (cloaking), e.g.
|
|
833
|
+
* `ORD-74219807`. `null` = default `pay_<random>` ids.
|
|
834
|
+
*/
|
|
835
|
+
payment_id_format?: PaymentIdFormatConfig | null;
|
|
807
836
|
}
|
|
808
837
|
/** Branding and behavior overrides for a shop's hosted checkout. */
|
|
809
838
|
interface BusinessPaymentLinkConfig {
|
|
@@ -1406,7 +1435,8 @@ interface PaymentLinkListResponse {
|
|
|
1406
1435
|
interface RoutingConfigCreateRequest {
|
|
1407
1436
|
name?: string | null;
|
|
1408
1437
|
description?: string | null;
|
|
1409
|
-
|
|
1438
|
+
/** Prefer `StaticRoutingAlgorithm`; the raw-record escape hatch is kept for forward compat. */
|
|
1439
|
+
algorithm?: StaticRoutingAlgorithm | Record<string, unknown> | null;
|
|
1410
1440
|
profile_id?: string | null;
|
|
1411
1441
|
transaction_type?: TransactionType | null;
|
|
1412
1442
|
}
|
|
@@ -1429,8 +1459,46 @@ interface RoutableConnectorChoice {
|
|
|
1429
1459
|
}
|
|
1430
1460
|
interface ConnectorVolumeSplit {
|
|
1431
1461
|
connector: RoutableConnectorChoice;
|
|
1462
|
+
/** Percentage weight. All splits in one selection must sum to exactly 100 (server-validated). */
|
|
1432
1463
|
split: number;
|
|
1433
1464
|
}
|
|
1465
|
+
/**
|
|
1466
|
+
* Connector-selection leaf of an advanced routing rule: an ordered priority
|
|
1467
|
+
* list or a weighted volume split. snake_case `{type, data}` on the wire.
|
|
1468
|
+
*
|
|
1469
|
+
* Volume splits are drawn per payment via weighted random — the ratio converges
|
|
1470
|
+
* statistically over volume; it is not an exact quota.
|
|
1471
|
+
*/
|
|
1472
|
+
type ConnectorSelection = {
|
|
1473
|
+
type: 'priority';
|
|
1474
|
+
data: RoutableConnectorChoice[];
|
|
1475
|
+
} | {
|
|
1476
|
+
type: 'volume_split';
|
|
1477
|
+
data: ConnectorVolumeSplit[];
|
|
1478
|
+
};
|
|
1479
|
+
/**
|
|
1480
|
+
* A single advanced-routing rule (`Rule<ConnectorSelection>`). camelCase on the
|
|
1481
|
+
* wire, like the fee-rule tree (see the note above `EuclidComparisonType`).
|
|
1482
|
+
* Conditions use the Euclid dimension keys, e.g. `payment_method`, `amount`
|
|
1483
|
+
* (minor units), `currency`, `card_network`.
|
|
1484
|
+
*/
|
|
1485
|
+
interface RuleConnectorSelection {
|
|
1486
|
+
name: string;
|
|
1487
|
+
connectorSelection: ConnectorSelection;
|
|
1488
|
+
statements: EuclidIfStatement[];
|
|
1489
|
+
}
|
|
1490
|
+
/**
|
|
1491
|
+
* The advanced-routing program (`Program<ConnectorSelection>`) carried by
|
|
1492
|
+
* `{ type: 'advanced' }`. Rules are evaluated top-down, first match wins;
|
|
1493
|
+
* `defaultSelection` applies when no rule matches. Every referenced connector
|
|
1494
|
+
* must be an enabled connector (MCA) of the target profile.
|
|
1495
|
+
*/
|
|
1496
|
+
interface ProgramConnectorSelection {
|
|
1497
|
+
defaultSelection: ConnectorSelection;
|
|
1498
|
+
rules: RuleConnectorSelection[];
|
|
1499
|
+
/** Required on the wire — send `{}` when empty. */
|
|
1500
|
+
metadata: Record<string, unknown>;
|
|
1501
|
+
}
|
|
1434
1502
|
/** Static routing algorithm shape: `{type, data}` adjacently-tagged enum. */
|
|
1435
1503
|
type StaticRoutingAlgorithm = {
|
|
1436
1504
|
type: 'single';
|
|
@@ -1443,7 +1511,7 @@ type StaticRoutingAlgorithm = {
|
|
|
1443
1511
|
data: ConnectorVolumeSplit[];
|
|
1444
1512
|
} | {
|
|
1445
1513
|
type: 'advanced';
|
|
1446
|
-
data:
|
|
1514
|
+
data: ProgramConnectorSelection;
|
|
1447
1515
|
} | {
|
|
1448
1516
|
type: 'three_ds_decision_rule';
|
|
1449
1517
|
data: Record<string, unknown>;
|
|
@@ -2056,6 +2124,11 @@ interface ProfileCreateRequest {
|
|
|
2056
2124
|
* Billing / PayPal) that owns this profile's native subscriptions.
|
|
2057
2125
|
*/
|
|
2058
2126
|
billing_processor_id?: string | null;
|
|
2127
|
+
/**
|
|
2128
|
+
* Custom format for generated payment ids (cloaking), e.g.
|
|
2129
|
+
* `ORD-74219807`. `null` = default `pay_<random>` ids.
|
|
2130
|
+
*/
|
|
2131
|
+
payment_id_format?: PaymentIdFormatConfig | null;
|
|
2059
2132
|
}
|
|
2060
2133
|
interface ProfileUpdateRequest {
|
|
2061
2134
|
profile_name?: string | null;
|
|
@@ -2076,6 +2149,11 @@ interface ProfileUpdateRequest {
|
|
|
2076
2149
|
* Billing / PayPal) that owns this profile's native subscriptions.
|
|
2077
2150
|
*/
|
|
2078
2151
|
billing_processor_id?: string | null;
|
|
2152
|
+
/**
|
|
2153
|
+
* Custom format for generated payment ids (cloaking), e.g.
|
|
2154
|
+
* `ORD-74219807`. `null` = default `pay_<random>` ids.
|
|
2155
|
+
*/
|
|
2156
|
+
payment_id_format?: PaymentIdFormatConfig | null;
|
|
2079
2157
|
}
|
|
2080
2158
|
interface ProfileResponse {
|
|
2081
2159
|
merchant_id: string;
|
|
@@ -2104,6 +2182,11 @@ interface ProfileResponse {
|
|
|
2104
2182
|
* Billing / PayPal) that owns this profile's native subscriptions.
|
|
2105
2183
|
*/
|
|
2106
2184
|
billing_processor_id?: string | null;
|
|
2185
|
+
/**
|
|
2186
|
+
* Custom format for generated payment ids (cloaking), e.g.
|
|
2187
|
+
* `ORD-74219807`. `null` = default `pay_<random>` ids.
|
|
2188
|
+
*/
|
|
2189
|
+
payment_id_format?: PaymentIdFormatConfig | null;
|
|
2107
2190
|
[key: string]: unknown;
|
|
2108
2191
|
}
|
|
2109
2192
|
type BlocklistAddRequest = {
|
|
@@ -3962,6 +4045,48 @@ declare class Routing {
|
|
|
3962
4045
|
* algorithm: { type: 'priority', data: [{ connector: 'stripe' }] },
|
|
3963
4046
|
* });
|
|
3964
4047
|
* ```
|
|
4048
|
+
*
|
|
4049
|
+
* @example Conditional volume split (advanced): cards → 90% epayouts / 10% stripe.
|
|
4050
|
+
* Rules run top-down (first match wins); `defaultSelection` is the fallback.
|
|
4051
|
+
* Splits must sum to 100; `amount` conditions are in minor units.
|
|
4052
|
+
* ```typescript
|
|
4053
|
+
* const config = await delopay.routing.create({
|
|
4054
|
+
* name: 'Card split 90/10',
|
|
4055
|
+
* profile_id: 'pro_...',
|
|
4056
|
+
* algorithm: {
|
|
4057
|
+
* type: 'advanced',
|
|
4058
|
+
* data: {
|
|
4059
|
+
* defaultSelection: { type: 'priority', data: [{ connector: 'stripe' }] },
|
|
4060
|
+
* rules: [
|
|
4061
|
+
* {
|
|
4062
|
+
* name: 'cards',
|
|
4063
|
+
* connectorSelection: {
|
|
4064
|
+
* type: 'volume_split',
|
|
4065
|
+
* data: [
|
|
4066
|
+
* { connector: { connector: 'epayouts' }, split: 90 },
|
|
4067
|
+
* { connector: { connector: 'stripe' }, split: 10 },
|
|
4068
|
+
* ],
|
|
4069
|
+
* },
|
|
4070
|
+
* statements: [
|
|
4071
|
+
* {
|
|
4072
|
+
* condition: [
|
|
4073
|
+
* {
|
|
4074
|
+
* lhs: 'payment_method',
|
|
4075
|
+
* comparison: 'equal',
|
|
4076
|
+
* value: { type: 'enum_variant', value: 'card' },
|
|
4077
|
+
* metadata: {},
|
|
4078
|
+
* },
|
|
4079
|
+
* ],
|
|
4080
|
+
* },
|
|
4081
|
+
* ],
|
|
4082
|
+
* },
|
|
4083
|
+
* ],
|
|
4084
|
+
* metadata: {},
|
|
4085
|
+
* },
|
|
4086
|
+
* },
|
|
4087
|
+
* });
|
|
4088
|
+
* await delopay.routing.activate(config.id);
|
|
4089
|
+
* ```
|
|
3965
4090
|
*/
|
|
3966
4091
|
create(params: RoutingConfigCreateRequest): Promise<RoutingDictionaryRecord>;
|
|
3967
4092
|
/**
|
|
@@ -5342,4 +5467,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
|
|
|
5342
5467
|
declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
|
|
5343
5468
|
declare function shadowFor(style: SurfaceStyle): string;
|
|
5344
5469
|
|
|
5345
|
-
export { type AddUserRequest, type AddUserResponse, 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 ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, 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, type DeleteUserRoleRequest, 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 FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type 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 OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type 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 RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type 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 UpdateUserRoleRequest, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
|
|
5470
|
+
export { type AddUserRequest, type AddUserResponse, 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 ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorSelection, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type 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 FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type 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 OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentIdFormatConfig, type PaymentIdStyle, 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 ProgramConnectorSelection, 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 RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, type RuleConnectorSelection, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type 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 UpdateUserRoleRequest, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -767,6 +767,25 @@ interface MandateRevokedResponse {
|
|
|
767
767
|
error_code?: string | null;
|
|
768
768
|
error_message?: string | null;
|
|
769
769
|
}
|
|
770
|
+
/** Charset of the random body of a custom-format payment id. */
|
|
771
|
+
type PaymentIdStyle = 'numeric' | 'alphanumeric' | 'alphanumeric_uppercase';
|
|
772
|
+
/**
|
|
773
|
+
* Merchant-configurable format for generated payment ids (cloaking),
|
|
774
|
+
* e.g. `ORD-74219807`. Applied per shop (business profile): payments
|
|
775
|
+
* created without an explicit `payment_id` get `<prefix><random body>`.
|
|
776
|
+
*/
|
|
777
|
+
interface PaymentIdFormatConfig {
|
|
778
|
+
/**
|
|
779
|
+
* Static prefix, e.g. `ORD-`. May be empty. Max 16 chars; allowed
|
|
780
|
+
* characters: ascii alphanumerics, `-`, `_`. Internal prefixes
|
|
781
|
+
* (`pay`, `cus`, ...) are rejected.
|
|
782
|
+
*/
|
|
783
|
+
prefix: string;
|
|
784
|
+
/** Charset used for the random body of the id. */
|
|
785
|
+
style: PaymentIdStyle;
|
|
786
|
+
/** Length of the random body (6..=32). */
|
|
787
|
+
length: number;
|
|
788
|
+
}
|
|
770
789
|
interface ShopCreateRequest {
|
|
771
790
|
shop_name: string;
|
|
772
791
|
return_url?: string | null;
|
|
@@ -788,6 +807,11 @@ interface ShopUpdateRequest {
|
|
|
788
807
|
* clickjacking defense. Example: `["https://shop.acme.com"]`.
|
|
789
808
|
*/
|
|
790
809
|
iframe_allowed_origins?: string[] | null;
|
|
810
|
+
/**
|
|
811
|
+
* Custom format for generated payment ids (cloaking), e.g.
|
|
812
|
+
* `ORD-74219807`. `null` = default `pay_<random>` ids.
|
|
813
|
+
*/
|
|
814
|
+
payment_id_format?: PaymentIdFormatConfig | null;
|
|
791
815
|
}
|
|
792
816
|
interface ShopResponse {
|
|
793
817
|
shop_id: string;
|
|
@@ -804,6 +828,11 @@ interface ShopResponse {
|
|
|
804
828
|
* See {@link ShopUpdateRequest.iframe_allowed_origins}.
|
|
805
829
|
*/
|
|
806
830
|
iframe_allowed_origins?: string[] | null;
|
|
831
|
+
/**
|
|
832
|
+
* Custom format for generated payment ids (cloaking), e.g.
|
|
833
|
+
* `ORD-74219807`. `null` = default `pay_<random>` ids.
|
|
834
|
+
*/
|
|
835
|
+
payment_id_format?: PaymentIdFormatConfig | null;
|
|
807
836
|
}
|
|
808
837
|
/** Branding and behavior overrides for a shop's hosted checkout. */
|
|
809
838
|
interface BusinessPaymentLinkConfig {
|
|
@@ -1406,7 +1435,8 @@ interface PaymentLinkListResponse {
|
|
|
1406
1435
|
interface RoutingConfigCreateRequest {
|
|
1407
1436
|
name?: string | null;
|
|
1408
1437
|
description?: string | null;
|
|
1409
|
-
|
|
1438
|
+
/** Prefer `StaticRoutingAlgorithm`; the raw-record escape hatch is kept for forward compat. */
|
|
1439
|
+
algorithm?: StaticRoutingAlgorithm | Record<string, unknown> | null;
|
|
1410
1440
|
profile_id?: string | null;
|
|
1411
1441
|
transaction_type?: TransactionType | null;
|
|
1412
1442
|
}
|
|
@@ -1429,8 +1459,46 @@ interface RoutableConnectorChoice {
|
|
|
1429
1459
|
}
|
|
1430
1460
|
interface ConnectorVolumeSplit {
|
|
1431
1461
|
connector: RoutableConnectorChoice;
|
|
1462
|
+
/** Percentage weight. All splits in one selection must sum to exactly 100 (server-validated). */
|
|
1432
1463
|
split: number;
|
|
1433
1464
|
}
|
|
1465
|
+
/**
|
|
1466
|
+
* Connector-selection leaf of an advanced routing rule: an ordered priority
|
|
1467
|
+
* list or a weighted volume split. snake_case `{type, data}` on the wire.
|
|
1468
|
+
*
|
|
1469
|
+
* Volume splits are drawn per payment via weighted random — the ratio converges
|
|
1470
|
+
* statistically over volume; it is not an exact quota.
|
|
1471
|
+
*/
|
|
1472
|
+
type ConnectorSelection = {
|
|
1473
|
+
type: 'priority';
|
|
1474
|
+
data: RoutableConnectorChoice[];
|
|
1475
|
+
} | {
|
|
1476
|
+
type: 'volume_split';
|
|
1477
|
+
data: ConnectorVolumeSplit[];
|
|
1478
|
+
};
|
|
1479
|
+
/**
|
|
1480
|
+
* A single advanced-routing rule (`Rule<ConnectorSelection>`). camelCase on the
|
|
1481
|
+
* wire, like the fee-rule tree (see the note above `EuclidComparisonType`).
|
|
1482
|
+
* Conditions use the Euclid dimension keys, e.g. `payment_method`, `amount`
|
|
1483
|
+
* (minor units), `currency`, `card_network`.
|
|
1484
|
+
*/
|
|
1485
|
+
interface RuleConnectorSelection {
|
|
1486
|
+
name: string;
|
|
1487
|
+
connectorSelection: ConnectorSelection;
|
|
1488
|
+
statements: EuclidIfStatement[];
|
|
1489
|
+
}
|
|
1490
|
+
/**
|
|
1491
|
+
* The advanced-routing program (`Program<ConnectorSelection>`) carried by
|
|
1492
|
+
* `{ type: 'advanced' }`. Rules are evaluated top-down, first match wins;
|
|
1493
|
+
* `defaultSelection` applies when no rule matches. Every referenced connector
|
|
1494
|
+
* must be an enabled connector (MCA) of the target profile.
|
|
1495
|
+
*/
|
|
1496
|
+
interface ProgramConnectorSelection {
|
|
1497
|
+
defaultSelection: ConnectorSelection;
|
|
1498
|
+
rules: RuleConnectorSelection[];
|
|
1499
|
+
/** Required on the wire — send `{}` when empty. */
|
|
1500
|
+
metadata: Record<string, unknown>;
|
|
1501
|
+
}
|
|
1434
1502
|
/** Static routing algorithm shape: `{type, data}` adjacently-tagged enum. */
|
|
1435
1503
|
type StaticRoutingAlgorithm = {
|
|
1436
1504
|
type: 'single';
|
|
@@ -1443,7 +1511,7 @@ type StaticRoutingAlgorithm = {
|
|
|
1443
1511
|
data: ConnectorVolumeSplit[];
|
|
1444
1512
|
} | {
|
|
1445
1513
|
type: 'advanced';
|
|
1446
|
-
data:
|
|
1514
|
+
data: ProgramConnectorSelection;
|
|
1447
1515
|
} | {
|
|
1448
1516
|
type: 'three_ds_decision_rule';
|
|
1449
1517
|
data: Record<string, unknown>;
|
|
@@ -2056,6 +2124,11 @@ interface ProfileCreateRequest {
|
|
|
2056
2124
|
* Billing / PayPal) that owns this profile's native subscriptions.
|
|
2057
2125
|
*/
|
|
2058
2126
|
billing_processor_id?: string | null;
|
|
2127
|
+
/**
|
|
2128
|
+
* Custom format for generated payment ids (cloaking), e.g.
|
|
2129
|
+
* `ORD-74219807`. `null` = default `pay_<random>` ids.
|
|
2130
|
+
*/
|
|
2131
|
+
payment_id_format?: PaymentIdFormatConfig | null;
|
|
2059
2132
|
}
|
|
2060
2133
|
interface ProfileUpdateRequest {
|
|
2061
2134
|
profile_name?: string | null;
|
|
@@ -2076,6 +2149,11 @@ interface ProfileUpdateRequest {
|
|
|
2076
2149
|
* Billing / PayPal) that owns this profile's native subscriptions.
|
|
2077
2150
|
*/
|
|
2078
2151
|
billing_processor_id?: string | null;
|
|
2152
|
+
/**
|
|
2153
|
+
* Custom format for generated payment ids (cloaking), e.g.
|
|
2154
|
+
* `ORD-74219807`. `null` = default `pay_<random>` ids.
|
|
2155
|
+
*/
|
|
2156
|
+
payment_id_format?: PaymentIdFormatConfig | null;
|
|
2079
2157
|
}
|
|
2080
2158
|
interface ProfileResponse {
|
|
2081
2159
|
merchant_id: string;
|
|
@@ -2104,6 +2182,11 @@ interface ProfileResponse {
|
|
|
2104
2182
|
* Billing / PayPal) that owns this profile's native subscriptions.
|
|
2105
2183
|
*/
|
|
2106
2184
|
billing_processor_id?: string | null;
|
|
2185
|
+
/**
|
|
2186
|
+
* Custom format for generated payment ids (cloaking), e.g.
|
|
2187
|
+
* `ORD-74219807`. `null` = default `pay_<random>` ids.
|
|
2188
|
+
*/
|
|
2189
|
+
payment_id_format?: PaymentIdFormatConfig | null;
|
|
2107
2190
|
[key: string]: unknown;
|
|
2108
2191
|
}
|
|
2109
2192
|
type BlocklistAddRequest = {
|
|
@@ -3962,6 +4045,48 @@ declare class Routing {
|
|
|
3962
4045
|
* algorithm: { type: 'priority', data: [{ connector: 'stripe' }] },
|
|
3963
4046
|
* });
|
|
3964
4047
|
* ```
|
|
4048
|
+
*
|
|
4049
|
+
* @example Conditional volume split (advanced): cards → 90% epayouts / 10% stripe.
|
|
4050
|
+
* Rules run top-down (first match wins); `defaultSelection` is the fallback.
|
|
4051
|
+
* Splits must sum to 100; `amount` conditions are in minor units.
|
|
4052
|
+
* ```typescript
|
|
4053
|
+
* const config = await delopay.routing.create({
|
|
4054
|
+
* name: 'Card split 90/10',
|
|
4055
|
+
* profile_id: 'pro_...',
|
|
4056
|
+
* algorithm: {
|
|
4057
|
+
* type: 'advanced',
|
|
4058
|
+
* data: {
|
|
4059
|
+
* defaultSelection: { type: 'priority', data: [{ connector: 'stripe' }] },
|
|
4060
|
+
* rules: [
|
|
4061
|
+
* {
|
|
4062
|
+
* name: 'cards',
|
|
4063
|
+
* connectorSelection: {
|
|
4064
|
+
* type: 'volume_split',
|
|
4065
|
+
* data: [
|
|
4066
|
+
* { connector: { connector: 'epayouts' }, split: 90 },
|
|
4067
|
+
* { connector: { connector: 'stripe' }, split: 10 },
|
|
4068
|
+
* ],
|
|
4069
|
+
* },
|
|
4070
|
+
* statements: [
|
|
4071
|
+
* {
|
|
4072
|
+
* condition: [
|
|
4073
|
+
* {
|
|
4074
|
+
* lhs: 'payment_method',
|
|
4075
|
+
* comparison: 'equal',
|
|
4076
|
+
* value: { type: 'enum_variant', value: 'card' },
|
|
4077
|
+
* metadata: {},
|
|
4078
|
+
* },
|
|
4079
|
+
* ],
|
|
4080
|
+
* },
|
|
4081
|
+
* ],
|
|
4082
|
+
* },
|
|
4083
|
+
* ],
|
|
4084
|
+
* metadata: {},
|
|
4085
|
+
* },
|
|
4086
|
+
* },
|
|
4087
|
+
* });
|
|
4088
|
+
* await delopay.routing.activate(config.id);
|
|
4089
|
+
* ```
|
|
3965
4090
|
*/
|
|
3966
4091
|
create(params: RoutingConfigCreateRequest): Promise<RoutingDictionaryRecord>;
|
|
3967
4092
|
/**
|
|
@@ -5342,4 +5467,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
|
|
|
5342
5467
|
declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
|
|
5343
5468
|
declare function shadowFor(style: SurfaceStyle): string;
|
|
5344
5469
|
|
|
5345
|
-
export { type AddUserRequest, type AddUserResponse, 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 ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, 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, type DeleteUserRoleRequest, 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 FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type 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 OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type 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 RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type 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 UpdateUserRoleRequest, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
|
|
5470
|
+
export { type AddUserRequest, type AddUserResponse, 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 ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorSelection, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type 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 FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type 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 OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentIdFormatConfig, type PaymentIdStyle, 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 ProgramConnectorSelection, 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 RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, type RuleConnectorSelection, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type 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 UpdateUserRoleRequest, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
|
package/dist/index.js
CHANGED
package/dist/internal.cjs
CHANGED
|
@@ -1892,6 +1892,48 @@ var Routing = class {
|
|
|
1892
1892
|
* algorithm: { type: 'priority', data: [{ connector: 'stripe' }] },
|
|
1893
1893
|
* });
|
|
1894
1894
|
* ```
|
|
1895
|
+
*
|
|
1896
|
+
* @example Conditional volume split (advanced): cards → 90% epayouts / 10% stripe.
|
|
1897
|
+
* Rules run top-down (first match wins); `defaultSelection` is the fallback.
|
|
1898
|
+
* Splits must sum to 100; `amount` conditions are in minor units.
|
|
1899
|
+
* ```typescript
|
|
1900
|
+
* const config = await delopay.routing.create({
|
|
1901
|
+
* name: 'Card split 90/10',
|
|
1902
|
+
* profile_id: 'pro_...',
|
|
1903
|
+
* algorithm: {
|
|
1904
|
+
* type: 'advanced',
|
|
1905
|
+
* data: {
|
|
1906
|
+
* defaultSelection: { type: 'priority', data: [{ connector: 'stripe' }] },
|
|
1907
|
+
* rules: [
|
|
1908
|
+
* {
|
|
1909
|
+
* name: 'cards',
|
|
1910
|
+
* connectorSelection: {
|
|
1911
|
+
* type: 'volume_split',
|
|
1912
|
+
* data: [
|
|
1913
|
+
* { connector: { connector: 'epayouts' }, split: 90 },
|
|
1914
|
+
* { connector: { connector: 'stripe' }, split: 10 },
|
|
1915
|
+
* ],
|
|
1916
|
+
* },
|
|
1917
|
+
* statements: [
|
|
1918
|
+
* {
|
|
1919
|
+
* condition: [
|
|
1920
|
+
* {
|
|
1921
|
+
* lhs: 'payment_method',
|
|
1922
|
+
* comparison: 'equal',
|
|
1923
|
+
* value: { type: 'enum_variant', value: 'card' },
|
|
1924
|
+
* metadata: {},
|
|
1925
|
+
* },
|
|
1926
|
+
* ],
|
|
1927
|
+
* },
|
|
1928
|
+
* ],
|
|
1929
|
+
* },
|
|
1930
|
+
* ],
|
|
1931
|
+
* metadata: {},
|
|
1932
|
+
* },
|
|
1933
|
+
* },
|
|
1934
|
+
* });
|
|
1935
|
+
* await delopay.routing.activate(config.id);
|
|
1936
|
+
* ```
|
|
1895
1937
|
*/
|
|
1896
1938
|
async create(params) {
|
|
1897
1939
|
return this.request("POST", "/routing", { body: params });
|