@rebilly/framepay-react
Version:
A React wrapper for Rebilly's FramePay offering out-of-the-box support for Redux and other common React features
16 lines (13 loc) • 341 B
text/typescript
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();
}
};