import React, { Component } from "react"; import { Modal, ModalBody } from 'reactstrap'; import "../../index.css"; import 'bootstrap/dist/css/bootstrap.min.css' import PaymentMethodData, { CardFeeCalculation, MappingBeanInterface } from "../../services/Models/sabpaisa-payment-types"; import ClientDetails from "./Sections/ClientDetails"; import sabpaisaService from "../../services/sabpaisa-service"; export interface PgModalProps { isOpen?: boolean; clientCode: string; clientTxnId: string; transUserName: string, transUserPassword: string; authkey: string; authiv: string; callbackUrl: string; payerName: string, payerEmail: string, payerMobile: string, payerAddress: string, amount: string, amountType: string, udf1: string, udf2: string, udf3: string, udf4: string, udf5: string, udf6: string, udf7: string, udf8: string, udf9: string, udf10: string, udf11: string, udf12: string, udf13: string, udf14: string, udf15: string, udf16: string, udf17: string, udf18: string, udf19: string, udf20: string, channelId: string, programId: string, mcc: string, onClick?: ( event: React.MouseEvent ) => void; additionalClass?: string; } type State = PaymentMethodData & { submitted: boolean, isOpen: boolean | undefined, currentState: number, errorMessage: string, paymentData: { [key: string]: any }, activeMappings: {}[], isResponsed: boolean; }; export default class PgModal extends Component { constructor(props: PgModalProps) { super(props); this.state = { submitted: false, isOpen: this.props.isOpen, currentState: 0, paymentData: {}, activeMappings: [], errorMessage: '', isResponsed: false }; } componentDidUpdate(prevProps: any, preState: any) { if (prevProps.isOpen !== this.props.isOpen) { this.setState({ isOpen: this.props.isOpen }); } if ((typeof (Object.keys(preState.paymentData).length || null) !== typeof Object.keys(this.state.paymentData).length) && (Object.keys(this.state.paymentData).length !== 0)) { this.setState({ isResponsed: true }); } } render() { const { isOpen, isResponsed } = this.state; const { onClick, additionalClass } = this.props; return (
{/* */} {/* {title} */} {/* */}
); } }