import Stripe from "stripe"; import { StripeService } from "./stripe.service"; /** * Stripe Payment Service * * Manages payment intents, setup intents, and payment methods. Handles one-time payments * and payment method setup for future use. Supports automatic payment methods. * * @example * ```typescript * const paymentIntent = await stripePaymentService.createPaymentIntent({ * amount: 5000, * currency: 'usd', * stripeCustomerId: 'cus_abc123', * }); * * const setupIntent = await stripePaymentService.createSetupIntent({ * stripeCustomerId: 'cus_abc123', * }); * ``` */ export declare class StripePaymentService { private readonly stripeService; constructor(stripeService: StripeService); /** * Create a payment intent for a one-time payment * * @param params - Payment intent parameters * @param params.amount - Amount in cents * @param params.currency - Three-letter currency code * @param params.stripeCustomerId - Stripe customer ID * @param params.metadata - Additional metadata (optional) * @param params.description - Payment description (optional) * @param params.receiptEmail - Email for receipt (optional) * @returns Promise resolving to the created payment intent * @throws {StripeError} If payment intent creation fails * * @example * ```typescript * const paymentIntent = await service.createPaymentIntent({ * amount: 5000, * currency: 'usd', * stripeCustomerId: 'cus_abc123', * description: 'One-time purchase', * }); * ``` */ createPaymentIntent(params: { amount: number; currency: string; stripeCustomerId: string; metadata?: Record; description?: string; receiptEmail?: string; }): Promise; /** * Retrieve a payment intent by ID * * @param paymentIntentId - The payment intent ID * @returns Promise resolving to the payment intent * @throws {StripeError} If retrieval fails * * @example * ```typescript * const paymentIntent = await service.retrievePaymentIntent('pi_abc123'); * ``` */ retrievePaymentIntent(paymentIntentId: string): Promise; /** * Create a setup intent for saving payment methods for future use * * @param params - Setup intent parameters * @param params.stripeCustomerId - Stripe customer ID * @param params.metadata - Additional metadata (optional) * @param params.usage - Intended usage (on_session or off_session) (optional) * @returns Promise resolving to the created setup intent * @throws {StripeError} If setup intent creation fails * * @example * ```typescript * const setupIntent = await service.createSetupIntent({ * stripeCustomerId: 'cus_abc123', * usage: 'off_session', * }); * ``` */ createSetupIntent(params: { stripeCustomerId: string; metadata?: Record; usage?: "on_session" | "off_session"; }): Promise; /** * Retrieve a setup intent by ID * * @param setupIntentId - The setup intent ID * @returns Promise resolving to the setup intent * @throws {StripeError} If retrieval fails * * @example * ```typescript * const setupIntent = await service.retrieveSetupIntent('seti_abc123'); * ``` */ retrieveSetupIntent(setupIntentId: string): Promise; /** * Confirm a payment intent with a payment method * * @param paymentIntentId - The payment intent ID to confirm * @param paymentMethodId - The payment method ID to use * @returns Promise resolving to the confirmed payment intent * @throws {StripeError} If confirmation fails * * @example * ```typescript * const paymentIntent = await service.confirmPaymentIntent('pi_abc123', 'pm_xyz789'); * ``` */ confirmPaymentIntent(paymentIntentId: string, paymentMethodId: string): Promise; /** * Cancel a payment intent * * @param paymentIntentId - The payment intent ID to cancel * @returns Promise resolving to the canceled payment intent * @throws {StripeError} If cancellation fails * * @example * ```typescript * const paymentIntent = await service.cancelPaymentIntent('pi_abc123'); * ``` */ cancelPaymentIntent(paymentIntentId: string): Promise; /** * Retrieve a payment method by ID * * @param paymentMethodId - The payment method ID * @returns Promise resolving to the payment method * @throws {StripeError} If retrieval fails * * @example * ```typescript * const paymentMethod = await service.retrievePaymentMethod('pm_abc123'); * ``` */ retrievePaymentMethod(paymentMethodId: string): Promise; } //# sourceMappingURL=stripe.payment.service.d.ts.map