@delopay/sdk 0.48.0 → 0.50.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 +17 -0
- package/dist/{chunk-SX46W7E4.js → chunk-P45MMRTD.js} +33 -1
- package/dist/chunk-P45MMRTD.js.map +1 -0
- package/dist/index.cjs +32 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +107 -1
- package/dist/index.d.ts +107 -1
- package/dist/index.js +1 -1
- package/dist/internal.cjs +32 -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-SX46W7E4.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -360,6 +360,80 @@ interface PaymentListResponse {
|
|
|
360
360
|
size: number;
|
|
361
361
|
data: PaymentResponse[];
|
|
362
362
|
}
|
|
363
|
+
/**
|
|
364
|
+
* Status of a single payment attempt. Mirrors the backend `AttemptStatus`
|
|
365
|
+
* enum, and is distinct from a payment intent's status: one intent can carry
|
|
366
|
+
* several attempts (retries across connectors), each with its own status.
|
|
367
|
+
*/
|
|
368
|
+
type AttemptStatus = 'started' | 'authentication_failed' | 'router_declined' | 'authentication_pending' | 'authentication_successful' | 'authorized' | 'authorization_failed' | 'charged' | 'authorizing' | 'cod_initiated' | 'voided' | 'voided_post_charge' | 'void_initiated' | 'capture_initiated' | 'capture_failed' | 'void_failed' | 'auto_refunded' | 'partial_charged' | 'partially_authorized' | 'partial_charged_and_chargeable' | 'unresolved' | 'pending' | 'failure' | 'payment_method_awaited' | 'confirmation_awaited' | 'device_data_collection_pending' | 'integrity_failure' | 'expired';
|
|
369
|
+
/** How the customer is expected to complete the payment (redirect, SDK invoke, QR, etc.). */
|
|
370
|
+
type PaymentExperience = 'redirect_to_url' | 'invoke_sdk_client' | 'display_qr_code' | 'one_click' | 'link_wallet' | 'invoke_payment_app' | 'display_wait_screen' | 'collect_otp';
|
|
371
|
+
/**
|
|
372
|
+
* Resolved failure detail for a payment attempt: the Delopay-normalised
|
|
373
|
+
* decline reason plus the raw issuer/connector detail it was derived from.
|
|
374
|
+
* Each sub-object is an untyped blob whose exact shape depends on the connector.
|
|
375
|
+
*/
|
|
376
|
+
interface PaymentErrorDetails {
|
|
377
|
+
/** Delopay-unified code + message, resolved from the gateway_status_map. */
|
|
378
|
+
unified_details?: Record<string, unknown> | null;
|
|
379
|
+
/** Raw issuer decline detail (e.g. network decline code) when available. */
|
|
380
|
+
issuer_details?: Record<string, unknown> | null;
|
|
381
|
+
/** Raw connector error detail as returned by the gateway. */
|
|
382
|
+
connector_details?: Record<string, unknown> | null;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* A single attempt made on a payment, with full failure detail. Returned in
|
|
386
|
+
* the `data` array of `payments.listAttempts`.
|
|
387
|
+
*/
|
|
388
|
+
interface PaymentAttemptResponse {
|
|
389
|
+
/** Unique identifier for this attempt. */
|
|
390
|
+
attempt_id: string;
|
|
391
|
+
/** Status of this attempt (distinct from the parent intent's status). */
|
|
392
|
+
status: AttemptStatus;
|
|
393
|
+
/** Attempt amount in the smallest currency unit (e.g. cents). */
|
|
394
|
+
amount: number;
|
|
395
|
+
/** Order-level tax amount, in the smallest currency unit. */
|
|
396
|
+
order_tax_amount?: number | null;
|
|
397
|
+
currency?: Currency | null;
|
|
398
|
+
/** Connector (gateway) this attempt was routed to, e.g. `stripe`. */
|
|
399
|
+
connector?: string | null;
|
|
400
|
+
/** Human-readable error message, when the attempt failed. */
|
|
401
|
+
error_message?: string | null;
|
|
402
|
+
payment_method?: PaymentMethod | null;
|
|
403
|
+
/** Connector's transaction identifier for this attempt. */
|
|
404
|
+
connector_transaction_id?: string | null;
|
|
405
|
+
capture_method?: CaptureMethod | null;
|
|
406
|
+
authentication_type?: AuthenticationType | null;
|
|
407
|
+
/** When the attempt was created (RFC 3339). */
|
|
408
|
+
created_at: string;
|
|
409
|
+
/** When the attempt was last modified (RFC 3339). */
|
|
410
|
+
modified_at: string;
|
|
411
|
+
cancellation_reason?: string | null;
|
|
412
|
+
mandate_id?: string | null;
|
|
413
|
+
/** Raw connector error code, when the attempt failed. */
|
|
414
|
+
error_code?: string | null;
|
|
415
|
+
payment_token?: string | null;
|
|
416
|
+
connector_metadata?: Record<string, unknown> | null;
|
|
417
|
+
payment_experience?: PaymentExperience | null;
|
|
418
|
+
payment_method_type?: PaymentMethodType | null;
|
|
419
|
+
reference_id?: string | null;
|
|
420
|
+
/** Delopay-unified decline code (from the gateway_status_map). */
|
|
421
|
+
unified_code?: string | null;
|
|
422
|
+
/** Delopay-unified, human-readable decline message. */
|
|
423
|
+
unified_message?: string | null;
|
|
424
|
+
client_source?: string | null;
|
|
425
|
+
client_version?: string | null;
|
|
426
|
+
/** Structured failure detail resolved from the unified + raw error info. */
|
|
427
|
+
error_details?: PaymentErrorDetails | null;
|
|
428
|
+
[key: string]: unknown;
|
|
429
|
+
}
|
|
430
|
+
/** Response body for `payments.listAttempts` — every attempt on a single payment. */
|
|
431
|
+
interface PaymentAttemptsListResponse {
|
|
432
|
+
/** The number of attempts returned for this payment. */
|
|
433
|
+
size: number;
|
|
434
|
+
/** Every attempt made on this payment, including failed retries across connectors. */
|
|
435
|
+
data: PaymentAttemptResponse[];
|
|
436
|
+
}
|
|
363
437
|
/**
|
|
364
438
|
* Parameters for creating a refund.
|
|
365
439
|
*
|
|
@@ -3268,6 +3342,31 @@ declare class Payments {
|
|
|
3268
3342
|
* ```
|
|
3269
3343
|
*/
|
|
3270
3344
|
retrieve(paymentId: string, options?: PaymentRetrieveOptions): Promise<PaymentResponse>;
|
|
3345
|
+
/**
|
|
3346
|
+
* List every attempt made on a payment, each with its full failure detail
|
|
3347
|
+
* (`error_code` / `error_message`, the Delopay-unified `unified_code` and
|
|
3348
|
+
* `unified_message`, and structured `error_details`).
|
|
3349
|
+
*
|
|
3350
|
+
* Useful for surfacing retries across connectors — e.g. "attempt 1 stripe →
|
|
3351
|
+
* insufficient_funds, attempt 2 adyen → success".
|
|
3352
|
+
*
|
|
3353
|
+
* `GET /payments/{paymentId}/attempts`
|
|
3354
|
+
*
|
|
3355
|
+
* @param paymentId - The payment intent ID whose attempts to list.
|
|
3356
|
+
* @param options - Optional per-call extras: extra `headers`, a `timeout`
|
|
3357
|
+
* override, and an `AbortSignal`.
|
|
3358
|
+
* @returns The attempt list — `size` plus a `data` array of attempts.
|
|
3359
|
+
* @throws If the payment does not exist or belongs to another merchant (404).
|
|
3360
|
+
*
|
|
3361
|
+
* @example
|
|
3362
|
+
* ```typescript
|
|
3363
|
+
* const { size, data } = await delopay.payments.listAttempts('pay_abc123');
|
|
3364
|
+
* for (const attempt of data) {
|
|
3365
|
+
* console.log(attempt.status, attempt.unified_message ?? attempt.error_message);
|
|
3366
|
+
* }
|
|
3367
|
+
* ```
|
|
3368
|
+
*/
|
|
3369
|
+
listAttempts(paymentId: string, options?: RequestExtras): Promise<PaymentAttemptsListResponse>;
|
|
3271
3370
|
/**
|
|
3272
3371
|
* Update an existing payment intent before it is confirmed.
|
|
3273
3372
|
*
|
|
@@ -4670,6 +4769,13 @@ interface FeeRuleConditions {
|
|
|
4670
4769
|
connector?: Connector;
|
|
4671
4770
|
currency?: Currency;
|
|
4672
4771
|
cardNetwork?: string;
|
|
4772
|
+
/**
|
|
4773
|
+
* Customer billing-address country. Must be the exact backend `Country` enum
|
|
4774
|
+
* variant (PascalCase full name, e.g. `Germany`/`UnitedStatesOfAmerica`), not
|
|
4775
|
+
* an ISO code — the engine lowers `billing_country` via case-sensitive
|
|
4776
|
+
* `from_str`.
|
|
4777
|
+
*/
|
|
4778
|
+
billingCountry?: string;
|
|
4673
4779
|
/** `amount == n` (minor units). */
|
|
4674
4780
|
amountEquals?: number;
|
|
4675
4781
|
/** `amount > n` (minor units). */
|
|
@@ -4894,4 +5000,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
|
|
|
4894
5000
|
declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
|
|
4895
5001
|
declare function shadowFor(style: SurfaceStyle): string;
|
|
4896
5002
|
|
|
4897
|
-
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, 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 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 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 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 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 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 UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, 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 };
|
|
5003
|
+
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 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 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 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 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 UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, 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
|
@@ -360,6 +360,80 @@ interface PaymentListResponse {
|
|
|
360
360
|
size: number;
|
|
361
361
|
data: PaymentResponse[];
|
|
362
362
|
}
|
|
363
|
+
/**
|
|
364
|
+
* Status of a single payment attempt. Mirrors the backend `AttemptStatus`
|
|
365
|
+
* enum, and is distinct from a payment intent's status: one intent can carry
|
|
366
|
+
* several attempts (retries across connectors), each with its own status.
|
|
367
|
+
*/
|
|
368
|
+
type AttemptStatus = 'started' | 'authentication_failed' | 'router_declined' | 'authentication_pending' | 'authentication_successful' | 'authorized' | 'authorization_failed' | 'charged' | 'authorizing' | 'cod_initiated' | 'voided' | 'voided_post_charge' | 'void_initiated' | 'capture_initiated' | 'capture_failed' | 'void_failed' | 'auto_refunded' | 'partial_charged' | 'partially_authorized' | 'partial_charged_and_chargeable' | 'unresolved' | 'pending' | 'failure' | 'payment_method_awaited' | 'confirmation_awaited' | 'device_data_collection_pending' | 'integrity_failure' | 'expired';
|
|
369
|
+
/** How the customer is expected to complete the payment (redirect, SDK invoke, QR, etc.). */
|
|
370
|
+
type PaymentExperience = 'redirect_to_url' | 'invoke_sdk_client' | 'display_qr_code' | 'one_click' | 'link_wallet' | 'invoke_payment_app' | 'display_wait_screen' | 'collect_otp';
|
|
371
|
+
/**
|
|
372
|
+
* Resolved failure detail for a payment attempt: the Delopay-normalised
|
|
373
|
+
* decline reason plus the raw issuer/connector detail it was derived from.
|
|
374
|
+
* Each sub-object is an untyped blob whose exact shape depends on the connector.
|
|
375
|
+
*/
|
|
376
|
+
interface PaymentErrorDetails {
|
|
377
|
+
/** Delopay-unified code + message, resolved from the gateway_status_map. */
|
|
378
|
+
unified_details?: Record<string, unknown> | null;
|
|
379
|
+
/** Raw issuer decline detail (e.g. network decline code) when available. */
|
|
380
|
+
issuer_details?: Record<string, unknown> | null;
|
|
381
|
+
/** Raw connector error detail as returned by the gateway. */
|
|
382
|
+
connector_details?: Record<string, unknown> | null;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* A single attempt made on a payment, with full failure detail. Returned in
|
|
386
|
+
* the `data` array of `payments.listAttempts`.
|
|
387
|
+
*/
|
|
388
|
+
interface PaymentAttemptResponse {
|
|
389
|
+
/** Unique identifier for this attempt. */
|
|
390
|
+
attempt_id: string;
|
|
391
|
+
/** Status of this attempt (distinct from the parent intent's status). */
|
|
392
|
+
status: AttemptStatus;
|
|
393
|
+
/** Attempt amount in the smallest currency unit (e.g. cents). */
|
|
394
|
+
amount: number;
|
|
395
|
+
/** Order-level tax amount, in the smallest currency unit. */
|
|
396
|
+
order_tax_amount?: number | null;
|
|
397
|
+
currency?: Currency | null;
|
|
398
|
+
/** Connector (gateway) this attempt was routed to, e.g. `stripe`. */
|
|
399
|
+
connector?: string | null;
|
|
400
|
+
/** Human-readable error message, when the attempt failed. */
|
|
401
|
+
error_message?: string | null;
|
|
402
|
+
payment_method?: PaymentMethod | null;
|
|
403
|
+
/** Connector's transaction identifier for this attempt. */
|
|
404
|
+
connector_transaction_id?: string | null;
|
|
405
|
+
capture_method?: CaptureMethod | null;
|
|
406
|
+
authentication_type?: AuthenticationType | null;
|
|
407
|
+
/** When the attempt was created (RFC 3339). */
|
|
408
|
+
created_at: string;
|
|
409
|
+
/** When the attempt was last modified (RFC 3339). */
|
|
410
|
+
modified_at: string;
|
|
411
|
+
cancellation_reason?: string | null;
|
|
412
|
+
mandate_id?: string | null;
|
|
413
|
+
/** Raw connector error code, when the attempt failed. */
|
|
414
|
+
error_code?: string | null;
|
|
415
|
+
payment_token?: string | null;
|
|
416
|
+
connector_metadata?: Record<string, unknown> | null;
|
|
417
|
+
payment_experience?: PaymentExperience | null;
|
|
418
|
+
payment_method_type?: PaymentMethodType | null;
|
|
419
|
+
reference_id?: string | null;
|
|
420
|
+
/** Delopay-unified decline code (from the gateway_status_map). */
|
|
421
|
+
unified_code?: string | null;
|
|
422
|
+
/** Delopay-unified, human-readable decline message. */
|
|
423
|
+
unified_message?: string | null;
|
|
424
|
+
client_source?: string | null;
|
|
425
|
+
client_version?: string | null;
|
|
426
|
+
/** Structured failure detail resolved from the unified + raw error info. */
|
|
427
|
+
error_details?: PaymentErrorDetails | null;
|
|
428
|
+
[key: string]: unknown;
|
|
429
|
+
}
|
|
430
|
+
/** Response body for `payments.listAttempts` — every attempt on a single payment. */
|
|
431
|
+
interface PaymentAttemptsListResponse {
|
|
432
|
+
/** The number of attempts returned for this payment. */
|
|
433
|
+
size: number;
|
|
434
|
+
/** Every attempt made on this payment, including failed retries across connectors. */
|
|
435
|
+
data: PaymentAttemptResponse[];
|
|
436
|
+
}
|
|
363
437
|
/**
|
|
364
438
|
* Parameters for creating a refund.
|
|
365
439
|
*
|
|
@@ -3268,6 +3342,31 @@ declare class Payments {
|
|
|
3268
3342
|
* ```
|
|
3269
3343
|
*/
|
|
3270
3344
|
retrieve(paymentId: string, options?: PaymentRetrieveOptions): Promise<PaymentResponse>;
|
|
3345
|
+
/**
|
|
3346
|
+
* List every attempt made on a payment, each with its full failure detail
|
|
3347
|
+
* (`error_code` / `error_message`, the Delopay-unified `unified_code` and
|
|
3348
|
+
* `unified_message`, and structured `error_details`).
|
|
3349
|
+
*
|
|
3350
|
+
* Useful for surfacing retries across connectors — e.g. "attempt 1 stripe →
|
|
3351
|
+
* insufficient_funds, attempt 2 adyen → success".
|
|
3352
|
+
*
|
|
3353
|
+
* `GET /payments/{paymentId}/attempts`
|
|
3354
|
+
*
|
|
3355
|
+
* @param paymentId - The payment intent ID whose attempts to list.
|
|
3356
|
+
* @param options - Optional per-call extras: extra `headers`, a `timeout`
|
|
3357
|
+
* override, and an `AbortSignal`.
|
|
3358
|
+
* @returns The attempt list — `size` plus a `data` array of attempts.
|
|
3359
|
+
* @throws If the payment does not exist or belongs to another merchant (404).
|
|
3360
|
+
*
|
|
3361
|
+
* @example
|
|
3362
|
+
* ```typescript
|
|
3363
|
+
* const { size, data } = await delopay.payments.listAttempts('pay_abc123');
|
|
3364
|
+
* for (const attempt of data) {
|
|
3365
|
+
* console.log(attempt.status, attempt.unified_message ?? attempt.error_message);
|
|
3366
|
+
* }
|
|
3367
|
+
* ```
|
|
3368
|
+
*/
|
|
3369
|
+
listAttempts(paymentId: string, options?: RequestExtras): Promise<PaymentAttemptsListResponse>;
|
|
3271
3370
|
/**
|
|
3272
3371
|
* Update an existing payment intent before it is confirmed.
|
|
3273
3372
|
*
|
|
@@ -4670,6 +4769,13 @@ interface FeeRuleConditions {
|
|
|
4670
4769
|
connector?: Connector;
|
|
4671
4770
|
currency?: Currency;
|
|
4672
4771
|
cardNetwork?: string;
|
|
4772
|
+
/**
|
|
4773
|
+
* Customer billing-address country. Must be the exact backend `Country` enum
|
|
4774
|
+
* variant (PascalCase full name, e.g. `Germany`/`UnitedStatesOfAmerica`), not
|
|
4775
|
+
* an ISO code — the engine lowers `billing_country` via case-sensitive
|
|
4776
|
+
* `from_str`.
|
|
4777
|
+
*/
|
|
4778
|
+
billingCountry?: string;
|
|
4673
4779
|
/** `amount == n` (minor units). */
|
|
4674
4780
|
amountEquals?: number;
|
|
4675
4781
|
/** `amount > n` (minor units). */
|
|
@@ -4894,4 +5000,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
|
|
|
4894
5000
|
declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
|
|
4895
5001
|
declare function shadowFor(style: SurfaceStyle): string;
|
|
4896
5002
|
|
|
4897
|
-
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, 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 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 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 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 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 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 UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, 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 };
|
|
5003
|
+
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 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 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 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 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 UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, 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
|
@@ -1147,6 +1147,37 @@ var Payments = class {
|
|
|
1147
1147
|
if (Object.keys(query).length === 0) return this.request("GET", path);
|
|
1148
1148
|
return this.request("GET", path, { query });
|
|
1149
1149
|
}
|
|
1150
|
+
/**
|
|
1151
|
+
* List every attempt made on a payment, each with its full failure detail
|
|
1152
|
+
* (`error_code` / `error_message`, the Delopay-unified `unified_code` and
|
|
1153
|
+
* `unified_message`, and structured `error_details`).
|
|
1154
|
+
*
|
|
1155
|
+
* Useful for surfacing retries across connectors — e.g. "attempt 1 stripe →
|
|
1156
|
+
* insufficient_funds, attempt 2 adyen → success".
|
|
1157
|
+
*
|
|
1158
|
+
* `GET /payments/{paymentId}/attempts`
|
|
1159
|
+
*
|
|
1160
|
+
* @param paymentId - The payment intent ID whose attempts to list.
|
|
1161
|
+
* @param options - Optional per-call extras: extra `headers`, a `timeout`
|
|
1162
|
+
* override, and an `AbortSignal`.
|
|
1163
|
+
* @returns The attempt list — `size` plus a `data` array of attempts.
|
|
1164
|
+
* @throws If the payment does not exist or belongs to another merchant (404).
|
|
1165
|
+
*
|
|
1166
|
+
* @example
|
|
1167
|
+
* ```typescript
|
|
1168
|
+
* const { size, data } = await delopay.payments.listAttempts('pay_abc123');
|
|
1169
|
+
* for (const attempt of data) {
|
|
1170
|
+
* console.log(attempt.status, attempt.unified_message ?? attempt.error_message);
|
|
1171
|
+
* }
|
|
1172
|
+
* ```
|
|
1173
|
+
*/
|
|
1174
|
+
async listAttempts(paymentId, options) {
|
|
1175
|
+
return this.request(
|
|
1176
|
+
"GET",
|
|
1177
|
+
`/payments/${encodeURIComponent(paymentId)}/attempts`,
|
|
1178
|
+
options
|
|
1179
|
+
);
|
|
1180
|
+
}
|
|
1150
1181
|
/**
|
|
1151
1182
|
* Update an existing payment intent before it is confirmed.
|
|
1152
1183
|
*
|
|
@@ -3309,6 +3340,7 @@ function buildConditions(when = {}, raw = []) {
|
|
|
3309
3340
|
if (when.connector != null) out.push(enumCondition("connector", when.connector));
|
|
3310
3341
|
if (when.currency != null) out.push(enumCondition("currency", when.currency));
|
|
3311
3342
|
if (when.cardNetwork != null) out.push(enumCondition("card_network", when.cardNetwork));
|
|
3343
|
+
if (when.billingCountry != null) out.push(enumCondition("billing_country", when.billingCountry));
|
|
3312
3344
|
if (when.amountEquals != null) out.push(numberCondition("amount", "equal", when.amountEquals));
|
|
3313
3345
|
if (when.amountGreaterThan != null) {
|
|
3314
3346
|
out.push(numberCondition("amount", "greater_than", when.amountGreaterThan));
|