@delopay/sdk 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-NKSNI5HS.js → chunk-WTVISXEY.js} +39 -27
- package/dist/chunk-WTVISXEY.js.map +1 -0
- package/dist/index.cjs +38 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +117 -25
- package/dist/index.d.ts +117 -25
- package/dist/index.js +1 -1
- package/dist/internal.cjs +71 -26
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +38 -2
- package/dist/internal.d.ts +38 -2
- package/dist/internal.js +33 -1
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-NKSNI5HS.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -653,6 +653,7 @@ interface ShopUpdateRequest {
|
|
|
653
653
|
return_url?: string | null;
|
|
654
654
|
webhook_url?: string | null;
|
|
655
655
|
is_active?: boolean | null;
|
|
656
|
+
payment_link_config?: BusinessPaymentLinkConfig | null;
|
|
656
657
|
}
|
|
657
658
|
interface ShopResponse {
|
|
658
659
|
shop_id: string;
|
|
@@ -663,6 +664,72 @@ interface ShopResponse {
|
|
|
663
664
|
return_url?: string | null;
|
|
664
665
|
webhook_url?: string | null;
|
|
665
666
|
project_id?: string | null;
|
|
667
|
+
payment_link_config?: BusinessPaymentLinkConfig | null;
|
|
668
|
+
}
|
|
669
|
+
/** Branding and behavior overrides for a shop's hosted checkout. */
|
|
670
|
+
interface BusinessPaymentLinkConfig {
|
|
671
|
+
/** Default config applied to every payment link under this shop. */
|
|
672
|
+
default_config?: PaymentLinkConfigRequest | null;
|
|
673
|
+
/** Per-sub-business overrides, keyed by a merchant-defined identifier. */
|
|
674
|
+
business_specific_configs?: Record<string, PaymentLinkConfigRequest> | null;
|
|
675
|
+
/** Host domains the payment link may be served from. */
|
|
676
|
+
allowed_domains?: string[] | null;
|
|
677
|
+
branding_visibility?: 'auto' | 'show' | 'hide' | null;
|
|
678
|
+
}
|
|
679
|
+
/** Appearance and behavior customization for the hosted checkout. */
|
|
680
|
+
interface PaymentLinkConfigRequest {
|
|
681
|
+
/** Primary theme color (hex). */
|
|
682
|
+
theme?: string | null;
|
|
683
|
+
/** Merchant logo URL shown on the checkout page. */
|
|
684
|
+
logo?: string | null;
|
|
685
|
+
/** Display name shown to customers instead of the shop name. */
|
|
686
|
+
seller_name?: string | null;
|
|
687
|
+
/** SDK layout: 'tabs' | 'accordion' | 'spaced_accordion'. */
|
|
688
|
+
sdk_layout?: string | null;
|
|
689
|
+
display_sdk_only?: boolean | null;
|
|
690
|
+
enabled_saved_payment_method?: boolean | null;
|
|
691
|
+
hide_card_nickname_field?: boolean | null;
|
|
692
|
+
show_card_form_by_default?: boolean | null;
|
|
693
|
+
transaction_details?: PaymentLinkTransactionDetails[] | null;
|
|
694
|
+
background_image?: PaymentLinkBackgroundImageConfig | null;
|
|
695
|
+
details_layout?: 'layout1' | 'layout2' | null;
|
|
696
|
+
payment_button_text?: string | null;
|
|
697
|
+
custom_message_for_card_terms?: string | null;
|
|
698
|
+
custom_message_for_payment_method_types?: Record<string, unknown> | null;
|
|
699
|
+
payment_button_colour?: string | null;
|
|
700
|
+
skip_status_screen?: boolean | null;
|
|
701
|
+
payment_button_text_colour?: string | null;
|
|
702
|
+
background_colour?: string | null;
|
|
703
|
+
/** CSS-variable overrides applied to the embedded SDK iframe. */
|
|
704
|
+
sdk_ui_rules?: Record<string, Record<string, string>> | null;
|
|
705
|
+
/** CSS-variable overrides applied to the outer payment-link page. */
|
|
706
|
+
payment_link_ui_rules?: Record<string, Record<string, string>> | null;
|
|
707
|
+
enable_button_only_on_form_ready?: boolean | null;
|
|
708
|
+
payment_form_header_text?: string | null;
|
|
709
|
+
payment_form_label_type?: 'above' | 'floating' | 'never' | null;
|
|
710
|
+
show_card_terms?: 'always' | 'auto' | 'never' | null;
|
|
711
|
+
is_setup_mandate_flow?: boolean | null;
|
|
712
|
+
/** Hex color for the CVC icon during error state. */
|
|
713
|
+
color_icon_card_cvc_error?: string | null;
|
|
714
|
+
}
|
|
715
|
+
interface PaymentLinkTransactionDetails {
|
|
716
|
+
key: string;
|
|
717
|
+
value: string;
|
|
718
|
+
ui_configuration?: {
|
|
719
|
+
position?: number | null;
|
|
720
|
+
is_key_bold?: boolean | null;
|
|
721
|
+
is_value_bold?: boolean | null;
|
|
722
|
+
} | null;
|
|
723
|
+
}
|
|
724
|
+
/** Response from `POST /shops/{merchantId}/{shopId}/logo`. */
|
|
725
|
+
interface ProfileLogoUploadResponse {
|
|
726
|
+
/** Publicly-reachable HTTPS URL of the uploaded logo. */
|
|
727
|
+
logo_url: string;
|
|
728
|
+
}
|
|
729
|
+
interface PaymentLinkBackgroundImageConfig {
|
|
730
|
+
url: string;
|
|
731
|
+
position?: 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | null;
|
|
732
|
+
size?: 'cover' | 'contain' | 'auto' | null;
|
|
666
733
|
}
|
|
667
734
|
interface ShopStats {
|
|
668
735
|
shop_id: string;
|
|
@@ -711,6 +778,32 @@ interface BillingProfileResponse {
|
|
|
711
778
|
suspended_at?: string | null;
|
|
712
779
|
created_at: string;
|
|
713
780
|
modified_at: string;
|
|
781
|
+
/**
|
|
782
|
+
* Volume-tier the merchant is currently locked to. Recomputed once
|
|
783
|
+
* per calendar month from the previous month's processed volume in
|
|
784
|
+
* USD. Omitted on legacy profiles created before tiers existed.
|
|
785
|
+
*/
|
|
786
|
+
current_tier?: TierSummary | null;
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* The merchant's currently-locked platform-fee tier. Tier 6 ("Custom" /
|
|
790
|
+
* Enterprise) sets `is_custom: true` and leaves `rate` unset — fees for
|
|
791
|
+
* those merchants are deducted at the Tier 5 rate until Delopay writes
|
|
792
|
+
* a negotiated per-merchant `FeeSchedule` override.
|
|
793
|
+
*/
|
|
794
|
+
interface TierSummary {
|
|
795
|
+
/** 1 (Starter) through 6 (Enterprise). */
|
|
796
|
+
level: number;
|
|
797
|
+
/** Human-readable tier name (e.g. "Growth"). */
|
|
798
|
+
name: string;
|
|
799
|
+
/** Percentage as a decimal — `3.5` means 3.50%. `null` for custom tier. */
|
|
800
|
+
rate?: number | null;
|
|
801
|
+
/** True when this is the custom (Tier 6) tier with no published rate. */
|
|
802
|
+
is_custom: boolean;
|
|
803
|
+
/** ISO date (`YYYY-MM-DD`) the locked tier expires; next snapshot reruns. */
|
|
804
|
+
locked_until?: string | null;
|
|
805
|
+
/** Volume in USD minor units (cents) that produced the current tier. */
|
|
806
|
+
volume_usd_minor?: number | null;
|
|
714
807
|
}
|
|
715
808
|
interface BillingSetupRequest {
|
|
716
809
|
balance_currency?: string | null;
|
|
@@ -763,14 +856,6 @@ interface AutoRechargeUpdateRequest {
|
|
|
763
856
|
threshold_amount?: number | null;
|
|
764
857
|
recharge_amount?: number | null;
|
|
765
858
|
}
|
|
766
|
-
interface AdminAdjustmentRequest {
|
|
767
|
-
amount: number;
|
|
768
|
-
description: string;
|
|
769
|
-
}
|
|
770
|
-
interface AdminAdjustmentResponse {
|
|
771
|
-
ledger_entry_id: string;
|
|
772
|
-
new_balance: number;
|
|
773
|
-
}
|
|
774
859
|
interface AllocationTransferRequest {
|
|
775
860
|
profile_id: string;
|
|
776
861
|
amount: number;
|
|
@@ -1245,6 +1330,7 @@ interface ProfileUpdateRequest {
|
|
|
1245
1330
|
redirect_to_merchant_with_http_post?: boolean | null;
|
|
1246
1331
|
webhook_details?: Record<string, unknown> | null;
|
|
1247
1332
|
metadata?: Record<string, unknown> | null;
|
|
1333
|
+
payment_link_config?: BusinessPaymentLinkConfig | null;
|
|
1248
1334
|
}
|
|
1249
1335
|
interface ProfileResponse {
|
|
1250
1336
|
merchant_id: string;
|
|
@@ -1668,22 +1754,6 @@ declare class Billing {
|
|
|
1668
1754
|
* @returns The updated billing profile.
|
|
1669
1755
|
*/
|
|
1670
1756
|
updateAutoRecharge(merchantId: string, params: AutoRechargeUpdateRequest): Promise<BillingProfileResponse>;
|
|
1671
|
-
/**
|
|
1672
|
-
* Admin: manually credit a merchant's balance (e.g. promotional credit).
|
|
1673
|
-
*
|
|
1674
|
-
* @param merchantId - The merchant account ID.
|
|
1675
|
-
* @param params - Credit amount and reason.
|
|
1676
|
-
* @returns The adjustment result.
|
|
1677
|
-
*/
|
|
1678
|
-
adminCredit(merchantId: string, params: AdminAdjustmentRequest): Promise<AdminAdjustmentResponse>;
|
|
1679
|
-
/**
|
|
1680
|
-
* Admin: manually debit a merchant's balance.
|
|
1681
|
-
*
|
|
1682
|
-
* @param merchantId - The merchant account ID.
|
|
1683
|
-
* @param params - Debit amount and reason.
|
|
1684
|
-
* @returns The adjustment result.
|
|
1685
|
-
*/
|
|
1686
|
-
adminDebit(merchantId: string, params: AdminAdjustmentRequest): Promise<AdminAdjustmentResponse>;
|
|
1687
1757
|
}
|
|
1688
1758
|
|
|
1689
1759
|
interface BlocklistListParams {
|
|
@@ -2630,6 +2700,28 @@ declare class Shops {
|
|
|
2630
2700
|
* @returns Array of shops.
|
|
2631
2701
|
*/
|
|
2632
2702
|
list(merchantId: string): Promise<ShopResponse[]>;
|
|
2703
|
+
/**
|
|
2704
|
+
* Upload a logo file for a shop. The file is stored in Delopay's configured
|
|
2705
|
+
* object store and a public HTTPS URL is returned. This method does NOT write
|
|
2706
|
+
* the URL into the shop's `payment_link_config.default_config.logo` — call
|
|
2707
|
+
* `shops.update` afterwards with the returned `logo_url` to persist the change.
|
|
2708
|
+
*
|
|
2709
|
+
* Accepts PNG, JPEG, WebP or SVG. The file must be ≤ 1 MiB.
|
|
2710
|
+
*
|
|
2711
|
+
* @param merchantId - The merchant account ID.
|
|
2712
|
+
* @param shopId - The shop (business profile) ID.
|
|
2713
|
+
* @param file - The logo file (Blob / File in browsers).
|
|
2714
|
+
* @returns The publicly-reachable URL of the uploaded logo.
|
|
2715
|
+
*
|
|
2716
|
+
* @example
|
|
2717
|
+
* ```typescript
|
|
2718
|
+
* const { logo_url } = await delopay.shops.uploadLogo('merch_1', 'pro_1', file);
|
|
2719
|
+
* await delopay.shops.update('merch_1', 'pro_1', {
|
|
2720
|
+
* payment_link_config: { default_config: { logo: logo_url } },
|
|
2721
|
+
* });
|
|
2722
|
+
* ```
|
|
2723
|
+
*/
|
|
2724
|
+
uploadLogo(merchantId: string, shopId: string, file: Blob): Promise<ProfileLogoUploadResponse>;
|
|
2633
2725
|
}
|
|
2634
2726
|
|
|
2635
2727
|
declare class StripeConnect {
|
|
@@ -3223,4 +3315,4 @@ declare const Webhooks: {
|
|
|
3223
3315
|
verify(rawBody: string, signatureHeader: string, secret: string, options?: VerifyOptions): Promise<WebhookEvent>;
|
|
3224
3316
|
};
|
|
3225
3317
|
|
|
3226
|
-
export { type Address, type AddressDetails, type
|
|
3318
|
+
export { type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, AnalyticsDashboard, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BusinessPaymentLinkConfig, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorType, type ConnectorUpdateRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeType, Files, Forex, type ForgotPasswordRequest, type FromEmailRequest, type GatewayConnectRequest, type GatewayResponse, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type LedgerEntry, type LedgerListParams, type LedgerResponse, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, 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 PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCreateRequest, type RegionResponse, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestFn, type RequestOptions, type ResetPasswordRequest, type RoutingConfigCreateRequest, type RoutingConfigResponse, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionCreateRequest, type SubscriptionListParams, type SubscriptionListResponse, type SubscriptionResponse, type SubscriptionUpdateRequest, Subscriptions, 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 UpdateUserDetailsRequest, type UserResponse, type VerifyOptions, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks };
|
package/dist/index.d.ts
CHANGED
|
@@ -653,6 +653,7 @@ interface ShopUpdateRequest {
|
|
|
653
653
|
return_url?: string | null;
|
|
654
654
|
webhook_url?: string | null;
|
|
655
655
|
is_active?: boolean | null;
|
|
656
|
+
payment_link_config?: BusinessPaymentLinkConfig | null;
|
|
656
657
|
}
|
|
657
658
|
interface ShopResponse {
|
|
658
659
|
shop_id: string;
|
|
@@ -663,6 +664,72 @@ interface ShopResponse {
|
|
|
663
664
|
return_url?: string | null;
|
|
664
665
|
webhook_url?: string | null;
|
|
665
666
|
project_id?: string | null;
|
|
667
|
+
payment_link_config?: BusinessPaymentLinkConfig | null;
|
|
668
|
+
}
|
|
669
|
+
/** Branding and behavior overrides for a shop's hosted checkout. */
|
|
670
|
+
interface BusinessPaymentLinkConfig {
|
|
671
|
+
/** Default config applied to every payment link under this shop. */
|
|
672
|
+
default_config?: PaymentLinkConfigRequest | null;
|
|
673
|
+
/** Per-sub-business overrides, keyed by a merchant-defined identifier. */
|
|
674
|
+
business_specific_configs?: Record<string, PaymentLinkConfigRequest> | null;
|
|
675
|
+
/** Host domains the payment link may be served from. */
|
|
676
|
+
allowed_domains?: string[] | null;
|
|
677
|
+
branding_visibility?: 'auto' | 'show' | 'hide' | null;
|
|
678
|
+
}
|
|
679
|
+
/** Appearance and behavior customization for the hosted checkout. */
|
|
680
|
+
interface PaymentLinkConfigRequest {
|
|
681
|
+
/** Primary theme color (hex). */
|
|
682
|
+
theme?: string | null;
|
|
683
|
+
/** Merchant logo URL shown on the checkout page. */
|
|
684
|
+
logo?: string | null;
|
|
685
|
+
/** Display name shown to customers instead of the shop name. */
|
|
686
|
+
seller_name?: string | null;
|
|
687
|
+
/** SDK layout: 'tabs' | 'accordion' | 'spaced_accordion'. */
|
|
688
|
+
sdk_layout?: string | null;
|
|
689
|
+
display_sdk_only?: boolean | null;
|
|
690
|
+
enabled_saved_payment_method?: boolean | null;
|
|
691
|
+
hide_card_nickname_field?: boolean | null;
|
|
692
|
+
show_card_form_by_default?: boolean | null;
|
|
693
|
+
transaction_details?: PaymentLinkTransactionDetails[] | null;
|
|
694
|
+
background_image?: PaymentLinkBackgroundImageConfig | null;
|
|
695
|
+
details_layout?: 'layout1' | 'layout2' | null;
|
|
696
|
+
payment_button_text?: string | null;
|
|
697
|
+
custom_message_for_card_terms?: string | null;
|
|
698
|
+
custom_message_for_payment_method_types?: Record<string, unknown> | null;
|
|
699
|
+
payment_button_colour?: string | null;
|
|
700
|
+
skip_status_screen?: boolean | null;
|
|
701
|
+
payment_button_text_colour?: string | null;
|
|
702
|
+
background_colour?: string | null;
|
|
703
|
+
/** CSS-variable overrides applied to the embedded SDK iframe. */
|
|
704
|
+
sdk_ui_rules?: Record<string, Record<string, string>> | null;
|
|
705
|
+
/** CSS-variable overrides applied to the outer payment-link page. */
|
|
706
|
+
payment_link_ui_rules?: Record<string, Record<string, string>> | null;
|
|
707
|
+
enable_button_only_on_form_ready?: boolean | null;
|
|
708
|
+
payment_form_header_text?: string | null;
|
|
709
|
+
payment_form_label_type?: 'above' | 'floating' | 'never' | null;
|
|
710
|
+
show_card_terms?: 'always' | 'auto' | 'never' | null;
|
|
711
|
+
is_setup_mandate_flow?: boolean | null;
|
|
712
|
+
/** Hex color for the CVC icon during error state. */
|
|
713
|
+
color_icon_card_cvc_error?: string | null;
|
|
714
|
+
}
|
|
715
|
+
interface PaymentLinkTransactionDetails {
|
|
716
|
+
key: string;
|
|
717
|
+
value: string;
|
|
718
|
+
ui_configuration?: {
|
|
719
|
+
position?: number | null;
|
|
720
|
+
is_key_bold?: boolean | null;
|
|
721
|
+
is_value_bold?: boolean | null;
|
|
722
|
+
} | null;
|
|
723
|
+
}
|
|
724
|
+
/** Response from `POST /shops/{merchantId}/{shopId}/logo`. */
|
|
725
|
+
interface ProfileLogoUploadResponse {
|
|
726
|
+
/** Publicly-reachable HTTPS URL of the uploaded logo. */
|
|
727
|
+
logo_url: string;
|
|
728
|
+
}
|
|
729
|
+
interface PaymentLinkBackgroundImageConfig {
|
|
730
|
+
url: string;
|
|
731
|
+
position?: 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | null;
|
|
732
|
+
size?: 'cover' | 'contain' | 'auto' | null;
|
|
666
733
|
}
|
|
667
734
|
interface ShopStats {
|
|
668
735
|
shop_id: string;
|
|
@@ -711,6 +778,32 @@ interface BillingProfileResponse {
|
|
|
711
778
|
suspended_at?: string | null;
|
|
712
779
|
created_at: string;
|
|
713
780
|
modified_at: string;
|
|
781
|
+
/**
|
|
782
|
+
* Volume-tier the merchant is currently locked to. Recomputed once
|
|
783
|
+
* per calendar month from the previous month's processed volume in
|
|
784
|
+
* USD. Omitted on legacy profiles created before tiers existed.
|
|
785
|
+
*/
|
|
786
|
+
current_tier?: TierSummary | null;
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* The merchant's currently-locked platform-fee tier. Tier 6 ("Custom" /
|
|
790
|
+
* Enterprise) sets `is_custom: true` and leaves `rate` unset — fees for
|
|
791
|
+
* those merchants are deducted at the Tier 5 rate until Delopay writes
|
|
792
|
+
* a negotiated per-merchant `FeeSchedule` override.
|
|
793
|
+
*/
|
|
794
|
+
interface TierSummary {
|
|
795
|
+
/** 1 (Starter) through 6 (Enterprise). */
|
|
796
|
+
level: number;
|
|
797
|
+
/** Human-readable tier name (e.g. "Growth"). */
|
|
798
|
+
name: string;
|
|
799
|
+
/** Percentage as a decimal — `3.5` means 3.50%. `null` for custom tier. */
|
|
800
|
+
rate?: number | null;
|
|
801
|
+
/** True when this is the custom (Tier 6) tier with no published rate. */
|
|
802
|
+
is_custom: boolean;
|
|
803
|
+
/** ISO date (`YYYY-MM-DD`) the locked tier expires; next snapshot reruns. */
|
|
804
|
+
locked_until?: string | null;
|
|
805
|
+
/** Volume in USD minor units (cents) that produced the current tier. */
|
|
806
|
+
volume_usd_minor?: number | null;
|
|
714
807
|
}
|
|
715
808
|
interface BillingSetupRequest {
|
|
716
809
|
balance_currency?: string | null;
|
|
@@ -763,14 +856,6 @@ interface AutoRechargeUpdateRequest {
|
|
|
763
856
|
threshold_amount?: number | null;
|
|
764
857
|
recharge_amount?: number | null;
|
|
765
858
|
}
|
|
766
|
-
interface AdminAdjustmentRequest {
|
|
767
|
-
amount: number;
|
|
768
|
-
description: string;
|
|
769
|
-
}
|
|
770
|
-
interface AdminAdjustmentResponse {
|
|
771
|
-
ledger_entry_id: string;
|
|
772
|
-
new_balance: number;
|
|
773
|
-
}
|
|
774
859
|
interface AllocationTransferRequest {
|
|
775
860
|
profile_id: string;
|
|
776
861
|
amount: number;
|
|
@@ -1245,6 +1330,7 @@ interface ProfileUpdateRequest {
|
|
|
1245
1330
|
redirect_to_merchant_with_http_post?: boolean | null;
|
|
1246
1331
|
webhook_details?: Record<string, unknown> | null;
|
|
1247
1332
|
metadata?: Record<string, unknown> | null;
|
|
1333
|
+
payment_link_config?: BusinessPaymentLinkConfig | null;
|
|
1248
1334
|
}
|
|
1249
1335
|
interface ProfileResponse {
|
|
1250
1336
|
merchant_id: string;
|
|
@@ -1668,22 +1754,6 @@ declare class Billing {
|
|
|
1668
1754
|
* @returns The updated billing profile.
|
|
1669
1755
|
*/
|
|
1670
1756
|
updateAutoRecharge(merchantId: string, params: AutoRechargeUpdateRequest): Promise<BillingProfileResponse>;
|
|
1671
|
-
/**
|
|
1672
|
-
* Admin: manually credit a merchant's balance (e.g. promotional credit).
|
|
1673
|
-
*
|
|
1674
|
-
* @param merchantId - The merchant account ID.
|
|
1675
|
-
* @param params - Credit amount and reason.
|
|
1676
|
-
* @returns The adjustment result.
|
|
1677
|
-
*/
|
|
1678
|
-
adminCredit(merchantId: string, params: AdminAdjustmentRequest): Promise<AdminAdjustmentResponse>;
|
|
1679
|
-
/**
|
|
1680
|
-
* Admin: manually debit a merchant's balance.
|
|
1681
|
-
*
|
|
1682
|
-
* @param merchantId - The merchant account ID.
|
|
1683
|
-
* @param params - Debit amount and reason.
|
|
1684
|
-
* @returns The adjustment result.
|
|
1685
|
-
*/
|
|
1686
|
-
adminDebit(merchantId: string, params: AdminAdjustmentRequest): Promise<AdminAdjustmentResponse>;
|
|
1687
1757
|
}
|
|
1688
1758
|
|
|
1689
1759
|
interface BlocklistListParams {
|
|
@@ -2630,6 +2700,28 @@ declare class Shops {
|
|
|
2630
2700
|
* @returns Array of shops.
|
|
2631
2701
|
*/
|
|
2632
2702
|
list(merchantId: string): Promise<ShopResponse[]>;
|
|
2703
|
+
/**
|
|
2704
|
+
* Upload a logo file for a shop. The file is stored in Delopay's configured
|
|
2705
|
+
* object store and a public HTTPS URL is returned. This method does NOT write
|
|
2706
|
+
* the URL into the shop's `payment_link_config.default_config.logo` — call
|
|
2707
|
+
* `shops.update` afterwards with the returned `logo_url` to persist the change.
|
|
2708
|
+
*
|
|
2709
|
+
* Accepts PNG, JPEG, WebP or SVG. The file must be ≤ 1 MiB.
|
|
2710
|
+
*
|
|
2711
|
+
* @param merchantId - The merchant account ID.
|
|
2712
|
+
* @param shopId - The shop (business profile) ID.
|
|
2713
|
+
* @param file - The logo file (Blob / File in browsers).
|
|
2714
|
+
* @returns The publicly-reachable URL of the uploaded logo.
|
|
2715
|
+
*
|
|
2716
|
+
* @example
|
|
2717
|
+
* ```typescript
|
|
2718
|
+
* const { logo_url } = await delopay.shops.uploadLogo('merch_1', 'pro_1', file);
|
|
2719
|
+
* await delopay.shops.update('merch_1', 'pro_1', {
|
|
2720
|
+
* payment_link_config: { default_config: { logo: logo_url } },
|
|
2721
|
+
* });
|
|
2722
|
+
* ```
|
|
2723
|
+
*/
|
|
2724
|
+
uploadLogo(merchantId: string, shopId: string, file: Blob): Promise<ProfileLogoUploadResponse>;
|
|
2633
2725
|
}
|
|
2634
2726
|
|
|
2635
2727
|
declare class StripeConnect {
|
|
@@ -3223,4 +3315,4 @@ declare const Webhooks: {
|
|
|
3223
3315
|
verify(rawBody: string, signatureHeader: string, secret: string, options?: VerifyOptions): Promise<WebhookEvent>;
|
|
3224
3316
|
};
|
|
3225
3317
|
|
|
3226
|
-
export { type Address, type AddressDetails, type
|
|
3318
|
+
export { type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, AnalyticsDashboard, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BusinessPaymentLinkConfig, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorType, type ConnectorUpdateRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeType, Files, Forex, type ForgotPasswordRequest, type FromEmailRequest, type GatewayConnectRequest, type GatewayResponse, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type LedgerEntry, type LedgerListParams, type LedgerResponse, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, 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 PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCreateRequest, type RegionResponse, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestFn, type RequestOptions, type ResetPasswordRequest, type RoutingConfigCreateRequest, type RoutingConfigResponse, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionCreateRequest, type SubscriptionListParams, type SubscriptionListResponse, type SubscriptionResponse, type SubscriptionUpdateRequest, Subscriptions, 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 UpdateUserDetailsRequest, type UserResponse, type VerifyOptions, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks };
|
package/dist/index.js
CHANGED
package/dist/internal.cjs
CHANGED
|
@@ -38,6 +38,7 @@ __export(internal_exports, {
|
|
|
38
38
|
Files: () => Files,
|
|
39
39
|
Forex: () => Forex,
|
|
40
40
|
Gsm: () => Gsm,
|
|
41
|
+
PlatformBilling: () => PlatformBilling,
|
|
41
42
|
PlatformFees: () => PlatformFees,
|
|
42
43
|
Regions: () => Regions,
|
|
43
44
|
Subscriptions: () => Subscriptions,
|
|
@@ -330,30 +331,6 @@ var Billing = class {
|
|
|
330
331
|
body: params
|
|
331
332
|
});
|
|
332
333
|
}
|
|
333
|
-
/**
|
|
334
|
-
* Admin: manually credit a merchant's balance (e.g. promotional credit).
|
|
335
|
-
*
|
|
336
|
-
* @param merchantId - The merchant account ID.
|
|
337
|
-
* @param params - Credit amount and reason.
|
|
338
|
-
* @returns The adjustment result.
|
|
339
|
-
*/
|
|
340
|
-
async adminCredit(merchantId, params) {
|
|
341
|
-
return this.request("POST", `/billing/${encodeURIComponent(merchantId)}/admin/credit`, {
|
|
342
|
-
body: params
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Admin: manually debit a merchant's balance.
|
|
347
|
-
*
|
|
348
|
-
* @param merchantId - The merchant account ID.
|
|
349
|
-
* @param params - Debit amount and reason.
|
|
350
|
-
* @returns The adjustment result.
|
|
351
|
-
*/
|
|
352
|
-
async adminDebit(merchantId, params) {
|
|
353
|
-
return this.request("POST", `/billing/${encodeURIComponent(merchantId)}/admin/debit`, {
|
|
354
|
-
body: params
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
334
|
};
|
|
358
335
|
|
|
359
336
|
// src/resources/blocklist.ts
|
|
@@ -1822,6 +1799,36 @@ var Shops = class {
|
|
|
1822
1799
|
async list(merchantId) {
|
|
1823
1800
|
return this.request("GET", `/shops/${encodeURIComponent(merchantId)}`);
|
|
1824
1801
|
}
|
|
1802
|
+
/**
|
|
1803
|
+
* Upload a logo file for a shop. The file is stored in Delopay's configured
|
|
1804
|
+
* object store and a public HTTPS URL is returned. This method does NOT write
|
|
1805
|
+
* the URL into the shop's `payment_link_config.default_config.logo` — call
|
|
1806
|
+
* `shops.update` afterwards with the returned `logo_url` to persist the change.
|
|
1807
|
+
*
|
|
1808
|
+
* Accepts PNG, JPEG, WebP or SVG. The file must be ≤ 1 MiB.
|
|
1809
|
+
*
|
|
1810
|
+
* @param merchantId - The merchant account ID.
|
|
1811
|
+
* @param shopId - The shop (business profile) ID.
|
|
1812
|
+
* @param file - The logo file (Blob / File in browsers).
|
|
1813
|
+
* @returns The publicly-reachable URL of the uploaded logo.
|
|
1814
|
+
*
|
|
1815
|
+
* @example
|
|
1816
|
+
* ```typescript
|
|
1817
|
+
* const { logo_url } = await delopay.shops.uploadLogo('merch_1', 'pro_1', file);
|
|
1818
|
+
* await delopay.shops.update('merch_1', 'pro_1', {
|
|
1819
|
+
* payment_link_config: { default_config: { logo: logo_url } },
|
|
1820
|
+
* });
|
|
1821
|
+
* ```
|
|
1822
|
+
*/
|
|
1823
|
+
async uploadLogo(merchantId, shopId, file) {
|
|
1824
|
+
const form = new FormData();
|
|
1825
|
+
form.append("file", file);
|
|
1826
|
+
return this.request(
|
|
1827
|
+
"POST",
|
|
1828
|
+
`/shops/${encodeURIComponent(merchantId)}/${encodeURIComponent(shopId)}/logo`,
|
|
1829
|
+
{ body: form }
|
|
1830
|
+
);
|
|
1831
|
+
}
|
|
1825
1832
|
};
|
|
1826
1833
|
|
|
1827
1834
|
// src/resources/stripeConnect.ts
|
|
@@ -2671,12 +2678,18 @@ var Delopay = class {
|
|
|
2671
2678
|
...this.jwtToken ? { Authorization: `Bearer ${this.jwtToken}` } : this.apiKey ? { "api-key": this.apiKey } : {},
|
|
2672
2679
|
...options?.headers
|
|
2673
2680
|
};
|
|
2674
|
-
|
|
2681
|
+
const isRawBody = options?.body !== void 0 && options?.body !== null && (options.body instanceof FormData || options.body instanceof Blob || options.body instanceof ArrayBuffer || options.body instanceof URLSearchParams);
|
|
2682
|
+
if (options?.body && !isRawBody) {
|
|
2675
2683
|
headers["Content-Type"] = "application/json";
|
|
2676
2684
|
}
|
|
2677
2685
|
const idempotencyKey = findIdempotencyKey(headers)?.trim();
|
|
2678
2686
|
const isRetryable = method === "GET" || method === "DELETE" || idempotencyKey !== void 0 && idempotencyKey !== "";
|
|
2679
|
-
|
|
2687
|
+
let serializedBody;
|
|
2688
|
+
if (isRawBody) {
|
|
2689
|
+
serializedBody = options?.body;
|
|
2690
|
+
} else if (options?.body) {
|
|
2691
|
+
serializedBody = JSON.stringify(options.body);
|
|
2692
|
+
}
|
|
2680
2693
|
const callerSignal = options?.signal;
|
|
2681
2694
|
if (callerSignal?.aborted) {
|
|
2682
2695
|
throw new DelopayError("Request aborted", {
|
|
@@ -3027,6 +3040,36 @@ var Gsm = class {
|
|
|
3027
3040
|
}
|
|
3028
3041
|
};
|
|
3029
3042
|
|
|
3043
|
+
// src/internal/resources/platformBilling.ts
|
|
3044
|
+
var PlatformBilling = class {
|
|
3045
|
+
constructor(request) {
|
|
3046
|
+
this.request = request;
|
|
3047
|
+
}
|
|
3048
|
+
/**
|
|
3049
|
+
* Manually credit a merchant's balance (e.g. promotional credit,
|
|
3050
|
+
* dispute reversal, manual correction).
|
|
3051
|
+
*
|
|
3052
|
+
* @param merchantId - The merchant account ID.
|
|
3053
|
+
* @param params - Credit amount and reason.
|
|
3054
|
+
*/
|
|
3055
|
+
async credit(merchantId, params) {
|
|
3056
|
+
return this.request("POST", `/billing/${encodeURIComponent(merchantId)}/admin/credit`, {
|
|
3057
|
+
body: params
|
|
3058
|
+
});
|
|
3059
|
+
}
|
|
3060
|
+
/**
|
|
3061
|
+
* Manually debit a merchant's balance.
|
|
3062
|
+
*
|
|
3063
|
+
* @param merchantId - The merchant account ID.
|
|
3064
|
+
* @param params - Debit amount and reason.
|
|
3065
|
+
*/
|
|
3066
|
+
async debit(merchantId, params) {
|
|
3067
|
+
return this.request("POST", `/billing/${encodeURIComponent(merchantId)}/admin/debit`, {
|
|
3068
|
+
body: params
|
|
3069
|
+
});
|
|
3070
|
+
}
|
|
3071
|
+
};
|
|
3072
|
+
|
|
3030
3073
|
// src/internal/resources/platformFees.ts
|
|
3031
3074
|
var PlatformFees = class {
|
|
3032
3075
|
constructor(request) {
|
|
@@ -3071,6 +3114,7 @@ var DelopayInternal = class extends Delopay {
|
|
|
3071
3114
|
this.cardIssuers = new CardIssuers(request);
|
|
3072
3115
|
this.configs = new Configs(request);
|
|
3073
3116
|
this.gsm = new Gsm(request);
|
|
3117
|
+
this.platformBilling = new PlatformBilling(request);
|
|
3074
3118
|
this.platformFees = new PlatformFees(request);
|
|
3075
3119
|
}
|
|
3076
3120
|
};
|
|
@@ -3094,6 +3138,7 @@ var DelopayInternal = class extends Delopay {
|
|
|
3094
3138
|
Files,
|
|
3095
3139
|
Forex,
|
|
3096
3140
|
Gsm,
|
|
3141
|
+
PlatformBilling,
|
|
3097
3142
|
PlatformFees,
|
|
3098
3143
|
Regions,
|
|
3099
3144
|
Subscriptions,
|