import PropTypes from 'prop-types' import Tabs from '@mui/material/Tabs' import Tab from '@mui/material/Tab' import Box from '@mui/material/Box' import Button from '@mui/material/Button' import {Paypal} from '@icons-pack/react-simple-icons' import {Elements} from '@stripe/react-stripe-js' import {loadStripe} from '@stripe/stripe-js' import {appearance} from '../../lib/utils/stripe-style' import CheckoutForm from './checkout-form' import StripePayment from './stripe-payment' const stripePromise = loadStripe( process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY ) const PAYPAL_ID = process.env.NEXT_PUBLIC_PAYPAL_DONATE_ID function TabPanel(props) { const {children, value, index, ...other} = props return ( ) } TabPanel.propTypes = { children: PropTypes.node, index: PropTypes.number.isRequired, value: PropTypes.number.isRequired, } function a11yProps(index) { return { id: `simple-tab-${index}`, 'aria-controls': `simple-tabpanel-${index}`, } } export default function PaymentMethod({isLoading, paymentMethod, setPaymentMethod, selectedMontant, setSelectedMontant, validMontant, setValidMontant, prices, paymentIntent, setClientSecret, setPaymentIntent, setIsLoading, setPaymentIsReady, setClientEmail, clientEmail, error, setError, clientSecret}) { const options = { clientSecret, appearance, } const handleChange = (event, newValue) => { setPaymentMethod(newValue) } return ( {clientSecret && validMontant && paymentMethod === 2 && ( )} ) } PaymentMethod.defaultProps = { selectedMontant: null, validMontant: null, paymentIntent: null, clientEmail: null, error: null, clientSecret: null } PaymentMethod.propTypes = { isLoading: PropTypes.bool.isRequired, paymentMethod: PropTypes.number.isRequired, setPaymentMethod: PropTypes.func.isRequired, selectedMontant: PropTypes.string, setSelectedMontant: PropTypes.func.isRequired, validMontant: PropTypes.string, setValidMontant: PropTypes.func.isRequired, prices: PropTypes.array.isRequired, paymentIntent: PropTypes.string, setClientSecret: PropTypes.func.isRequired, setPaymentIntent: PropTypes.func.isRequired, setIsLoading: PropTypes.func.isRequired, setPaymentIsReady: PropTypes.func.isRequired, setClientEmail: PropTypes.func.isRequired, clientEmail: PropTypes.string, error: PropTypes.string, setError: PropTypes.func.isRequired, clientSecret: PropTypes.string }