Skip to main content
Version: 3.3.0

PaymentSuccessModal

The Payment success modal opens after a successful new, or renewed subscription.

Loading...
info

The title and content of this modal is configured on every product on the platform.

Usage#

import React from "react";
import {
PaymentSuccessModal,
PelcroModalController,
usePelcro,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const LoginExample = () => {
const { switchView, setProduct, setPlan } = usePelcro();
useEffect(() => {
setProduct(834);
setPlan(22033);
}, []);
return (
<>
<button onClick={() => switchView("subscription-success")}>
Open payment success
</button>
<PelcroModalController>
<PaymentSuccessModal />
</PelcroModalController>
</>
);
};

Reference#

Props#

onDisplay#

() โ‡’ void

Callback function called when the modal is first displayed.

onClose#

() โ‡’ void

Callback function called when the modal is closed.