@astropay/payments-lib
Version:
Official AstroPay payments library for web and mobile.
58 lines (57 loc) • 1.83 kB
TypeScript
import { Component } from '../../components/templates/Component';
import { APFullCheckout } from '../../types';
/**
* AstroPayFullCheckout provides a complete payment checkout experience.
*
* @example
* ```ts
* const checkout = new AstroPayFullCheckout({
* amount: 100,
* currency: 'USD',
* country: 'BR',
* // Optional props
* showTitle: true,
* showDescription: true,
* onSuccess: () => console.log('Payment successful'),
* onError: () => console.error('Payment failed')
* });
* ```
*
* @see {@link APFullCheckout} for all available configuration options
*/
export declare class AstroPayFullCheckout extends Component<HTMLDivElement> {
private loadingWrapper;
private readonly componentProps;
private accPaymentMethods?;
constructor(params: APFullCheckout);
private createPayment;
private renderPaymentMethods;
private showSuccessContent;
/**
* Renders the full checkout experience into the specified DOM container.
*
* @example
* ```ts
* const checkoutComponent = new AstroPayFullCheckout(checkoutPaymentSettings);
* checkout.render(document.getElementById('payment-container'));
* ```
*
* @param {HTMLElement} container - The DOM element to render the payment component into.
*/
render(container: HTMLElement): void;
/**
* Destroys the payment component instance, cleaning up all DOM elements
* and unregistering from the AstroPay Payments Library.
*
* @example
* ```ts
* // Initialize and render component
* const checkoutComponent = new AstroPayFullCheckout(checkoutPaymentSettings);
* checkout.render(document.getElementById('payment-container'));
*
* // Later cleanup
* checkoutComponent.destroy();
* ```
*/
destroy(): void;
}