Skip to main content
Version: 2.4.0

PaymentMethodSelectModal

The payment method select modal is used to select one of the user's payment cards.

Loading...

Usage#

import React from "react";
import {
PaymentMethodSelectModal,
PelcroModalController,
usePelcro,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const PaymentMethodSelectExample = () => {
const { switchView } = usePelcro();
return (
<>
<button onClick={() => switchView("payment-method-select")}>
Select your payment method
</button>
<PelcroModalController>
<PaymentMethodSelectModal />
</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#

(selectedPaymentMethodId) โ‡’ void

Callback function called when the payment method is selected succesfully.