Skip to main content
Version: 3.3.0

PaymentMethodUpdateModal

Used to update the payment method for users.

Loading...

Usage#

import React from "react";
import {
PaymentMethodUpdateModal,
PelcroModalController,
usePelcro,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const PaymentMethodUpdateExample = () => {
const { switchView } = usePelcro();
return (
<>
<button onClick={() => switchView("payment-method-update")}>
Update payment method
</button>
<PelcroModalController>
<PaymentMethodUpdateModal />
</PelcroModalController>
</>
);
};

Reference#

Props#

onDisplay#

() โ‡’ void

Callback function called when the modal is first displayed.

onClose#

() โ‡’ void

Callback function called when the modal is closed.

onSuccess#

(userObject) โ‡’ void

Callback function called when the user updates payment method succesfully.

onFailure#

(errorObject) โ‡’ void

Callback function called when the payment update fails.