18/03/2023 - 21h

recette2
cherif 2023-03-18 21:58:53 +01:00
parent 01bc9c9002
commit 409f6d639d
1 changed files with 49 additions and 1 deletions

View File

@ -428,6 +428,12 @@ function CheckOut(props) {
setprice_ch(process.env.REACT_APP_API_URL_STRIP_ID_PACK_GOLD);
}
else if (String(props.packs).toLocaleLowerCase() === String("decouverte")) {
setnb_formations("1");
}
window.scrollTo(0, 0);
}, []);
@ -448,7 +454,7 @@ function CheckOut(props) {
//alert(" confirmation ok");
if (String(nb_formations) === "0") {
alert(" Vous devez choisir un nombre de formation ");
alert(" Vous devez choisir un nombre de formations ");
document.getElementById('div_nb_formation').style.color = "red";
document.getElementById('div_ttc').style.color = "red";
@ -557,8 +563,14 @@ function CheckOut(props) {
setpaymentmode("");
setgotocheckout("");
console.log(" ### packprice = ", packprice);
if (parseFloat(packprice) > 0)
finalize_abonnement(local_souscription_id);
else if (String(props.packs).toLowerCase() === String("decouverte")) {
MySy_LMS_Account_Management();
window.location.reload();
}
}
else {
@ -588,6 +600,42 @@ function CheckOut(props) {
setmenumodepayement("sepa");
}
// 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")
})
}
const [invoiceAdressOK, setinvoiceAdressOK] = useState();
function checkInvoicingField() {