@delopay/sdk 0.8.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-SPWI4Z6T.js → chunk-WTVISXEY.js} +39 -3
- package/dist/chunk-WTVISXEY.js.map +1 -0
- package/dist/index.cjs +38 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +117 -1
- package/dist/index.d.ts +117 -1
- package/dist/index.js +1 -1
- package/dist/internal.cjs +38 -2
- 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-SPWI4Z6T.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;
|
|
@@ -1237,6 +1330,7 @@ interface ProfileUpdateRequest {
|
|
|
1237
1330
|
redirect_to_merchant_with_http_post?: boolean | null;
|
|
1238
1331
|
webhook_details?: Record<string, unknown> | null;
|
|
1239
1332
|
metadata?: Record<string, unknown> | null;
|
|
1333
|
+
payment_link_config?: BusinessPaymentLinkConfig | null;
|
|
1240
1334
|
}
|
|
1241
1335
|
interface ProfileResponse {
|
|
1242
1336
|
merchant_id: string;
|
|
@@ -2606,6 +2700,28 @@ declare class Shops {
|
|
|
2606
2700
|
* @returns Array of shops.
|
|
2607
2701
|
*/
|
|
2608
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>;
|
|
2609
2725
|
}
|
|
2610
2726
|
|
|
2611
2727
|
declare class StripeConnect {
|
|
@@ -3199,4 +3315,4 @@ declare const Webhooks: {
|
|
|
3199
3315
|
verify(rawBody: string, signatureHeader: string, secret: string, options?: VerifyOptions): Promise<WebhookEvent>;
|
|
3200
3316
|
};
|
|
3201
3317
|
|
|
3202
|
-
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 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 PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, 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 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 TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type UpdateUserDetailsRequest, type UserResponse, type VerifyOptions, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks };
|
|
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;
|
|
@@ -1237,6 +1330,7 @@ interface ProfileUpdateRequest {
|
|
|
1237
1330
|
redirect_to_merchant_with_http_post?: boolean | null;
|
|
1238
1331
|
webhook_details?: Record<string, unknown> | null;
|
|
1239
1332
|
metadata?: Record<string, unknown> | null;
|
|
1333
|
+
payment_link_config?: BusinessPaymentLinkConfig | null;
|
|
1240
1334
|
}
|
|
1241
1335
|
interface ProfileResponse {
|
|
1242
1336
|
merchant_id: string;
|
|
@@ -2606,6 +2700,28 @@ declare class Shops {
|
|
|
2606
2700
|
* @returns Array of shops.
|
|
2607
2701
|
*/
|
|
2608
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>;
|
|
2609
2725
|
}
|
|
2610
2726
|
|
|
2611
2727
|
declare class StripeConnect {
|
|
@@ -3199,4 +3315,4 @@ declare const Webhooks: {
|
|
|
3199
3315
|
verify(rawBody: string, signatureHeader: string, secret: string, options?: VerifyOptions): Promise<WebhookEvent>;
|
|
3200
3316
|
};
|
|
3201
3317
|
|
|
3202
|
-
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 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 PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, 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 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 TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type UpdateUserDetailsRequest, type UserResponse, type VerifyOptions, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks };
|
|
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
|
@@ -1799,6 +1799,36 @@ var Shops = class {
|
|
|
1799
1799
|
async list(merchantId) {
|
|
1800
1800
|
return this.request("GET", `/shops/${encodeURIComponent(merchantId)}`);
|
|
1801
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
|
+
}
|
|
1802
1832
|
};
|
|
1803
1833
|
|
|
1804
1834
|
// src/resources/stripeConnect.ts
|
|
@@ -2648,12 +2678,18 @@ var Delopay = class {
|
|
|
2648
2678
|
...this.jwtToken ? { Authorization: `Bearer ${this.jwtToken}` } : this.apiKey ? { "api-key": this.apiKey } : {},
|
|
2649
2679
|
...options?.headers
|
|
2650
2680
|
};
|
|
2651
|
-
|
|
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) {
|
|
2652
2683
|
headers["Content-Type"] = "application/json";
|
|
2653
2684
|
}
|
|
2654
2685
|
const idempotencyKey = findIdempotencyKey(headers)?.trim();
|
|
2655
2686
|
const isRetryable = method === "GET" || method === "DELETE" || idempotencyKey !== void 0 && idempotencyKey !== "";
|
|
2656
|
-
|
|
2687
|
+
let serializedBody;
|
|
2688
|
+
if (isRawBody) {
|
|
2689
|
+
serializedBody = options?.body;
|
|
2690
|
+
} else if (options?.body) {
|
|
2691
|
+
serializedBody = JSON.stringify(options.body);
|
|
2692
|
+
}
|
|
2657
2693
|
const callerSignal = options?.signal;
|
|
2658
2694
|
if (callerSignal?.aborted) {
|
|
2659
2695
|
throw new DelopayError("Request aborted", {
|