Skip to main content
Version: Next

SubscriptionManageMembersContainer

Manages Members for a subscription.

info

SubscriptionManageMembersContainer requires the subscriptionToManageMembers to be set. if you have your own custom flow, you can use the usePelcro hook to set them before rendering the payment view like in the following example.

Usage#

import React from "react";
import {
SubscriptionManageMembersContainer,
SubscriptionManageMembersEmails,
SubscriptionManageMembersButton,
usePelcro,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const CustomSubscriptionSuspendView = () => {
const { set } = usePelcro();
useEffect(() => {
set({
subscriptionToManageMembers: {id: 2556180},
});
}, []);
return (
<SubscriptionManageMembersContainer
onSuccess={(userObject) => {
console.log(userObject);
}}
onFailure={(err) => {
console.error(err.message);
}}
>
<SubscriptionManageMembersEmails />
<SubscriptionManageMembersButton
role="submit"
className="plc-w-full"
id="pelcro-submit"
/>
</SubscriptionManageMembersContainer>
);
};

Reference#

SubscriptionManageMembersContainer#

Props#

onSuccess#

(userObject) โ‡’ void

Callback function called when the user subscribes succesfully.

onFailure#

(errorObject) โ‡’ void

Callback function called when the subscription creation fails.

Children components#

SubscriptionManageMembersEmails#

Input field component to receive members emails that user want to invite


SubscriptionManageMembersButton#

Button to submit the members emails.