Display a customizable donation form in a modal that overlays your website though a button click
import { useDonationCheckoutModal } from "@everfund/react-sdk";
const [success, setSuccess] = useState(false); const { isOpen, openModal } = useDonationCheckoutModal({ code: "ggsm", onSuccess: (data) => { console.log("Everfund success", data); setSuccess(true); }, onFailure: (err) => { console.log("Everfund failed", err); setSuccess(true); }, onClose: () => { if (success) { console.log("Payment success"); } else { console.log("Payment failed"); } }, }); return ( <button onClick={() => openModal()}> Donate Now </button> );
closeOnSuccess
boolean | null
undefined
code
string
domain
onClose
() => void
onFailure
(data: Record<string, unknown>) => void
onSuccess
(data: SuccessResponse) => void
On this page