diff --git a/src/components/OrderConfirmation_3DS.js b/src/components/OrderConfirmation_3DS.js index 3db1ee1..e1e91a9 100644 --- a/src/components/OrderConfirmation_3DS.js +++ b/src/components/OrderConfirmation_3DS.js @@ -13,7 +13,7 @@ import { useParams } from 'react-router-dom' function OrderConfirmation_3DS(props) { const [menu, setmenu] = useState(""); const history = useHistory(); - const { orderid, packs } = useParams() + const { orderid, packs, nb_class } = useParams() useEffect(() => { @@ -94,6 +94,8 @@ function OrderConfirmation_3DS(props) { if (String(res.data.status) === String("true")) { setcheck_payement_finalise_order_api("true"); + MySy_LMS_Account_Management(); + } else { @@ -110,6 +112,41 @@ function OrderConfirmation_3DS(props) { } + + // Mise à jour du compte LMs Mysy + const [MySy_LMS_Account_Management_api, setMySy_LMS_Account_Management_api] = useState(""); + const [MySy_LMS_Account_Management_message, setMySy_LMS_Account_Management_message] = useState(""); + function MySy_LMS_Account_Management() { + + var formData_tpm = new FormData(); + formData_tpm.append('token', stored_part); + //formData_tpm.append('stripe_payment_id', stripe_pi); + //formData_tpm.append('packs', packs); + + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Check_MySy_LMS_Account/"; + + axios.post(myurl, formData_tpm).then(res => { + console.log('In MySy_LMS_Account_Management status = ', res.data.status, " -- message = ", res.data.message); + if (String(res.data.status) === String("true")) { + setMySy_LMS_Account_Management_api("true"); + + } + else { + setMySy_LMS_Account_Management_api("false") + setMySy_LMS_Account_Management_message(String(res.data.message)) + } + + + }).catch((error) => { + console.log('In MySy_LMS_Account_Management ', error); + setMySy_LMS_Account_Management_api("false") + + }) + + } + return (