@blocklet/payment-react
Version:
Reusable react components for payment kit v2
33 lines (32 loc) • 1.12 kB
TypeScript
/**
* PromotionSection Component
*
* Handles promotion code input, applied discounts display, and removal.
*/
import type { TPaymentCurrency } from '@blocklet/payment-types';
export interface DiscountInfo {
promotion_code?: string;
coupon?: string;
discount_amount?: string;
promotion_code_details?: {
code?: string;
};
coupon_details?: any;
verification_data?: {
code?: string;
};
}
export interface PromotionSectionProps {
checkoutSessionId: string;
currency: TPaymentCurrency;
currencyId: string;
discounts: DiscountInfo[];
allowPromotionCodes: boolean;
completed?: boolean;
disabled?: boolean;
onPromotionUpdate: () => void;
onRemovePromotion: (sessionId: string) => void;
calculatedDiscountAmount?: string | null;
isRateLoading?: boolean;
}
export default function PromotionSection({ checkoutSessionId, currency, currencyId, discounts, allowPromotionCodes, completed, disabled, onPromotionUpdate, onRemovePromotion, calculatedDiscountAmount, isRateLoading, }: PromotionSectionProps): import("react").JSX.Element | null;