import { loadFramepay } from '@rebilly/framepay';

interface ScriptProperties {
    readonly onReady: () => void;
    readonly onError: () => void;
}

export const injectScript = async ({ onReady, onError }: ScriptProperties) => {
    try {
        await loadFramepay();
        onReady();
    } catch (_error) {
        onError();
    }
};
