23/01/23 - 19h
parent
0285813f0e
commit
ac2c7a1529
|
@ -139,7 +139,7 @@ function Abonnement(props) {
|
|||
|
||||
const [paymentmode, setpaymentmode] = useState([]);
|
||||
const [paymentmodeapi, setpaymentmodeapi] = useState([]);
|
||||
|
||||
const [paymentmode_nb_carte, setpaymentmode_nb_carte] = useState();
|
||||
|
||||
function GetPayementMode(event) {
|
||||
|
||||
|
@ -160,7 +160,7 @@ function Abonnement(props) {
|
|||
})
|
||||
.then((data) => data.json())
|
||||
.then((data) => {
|
||||
//console.log('LAAAAAAAAA Success:', data['message'], "data['status'] = ", data['status']);
|
||||
console.log('LAAAAAAAAA Success:', data['message'], "data['status'] = ", data['status'], " nb_carte", data['nb_carte']);
|
||||
|
||||
if (String(data['status']) === String("false")) {
|
||||
//console.log("erreur rrrr:" + data['status'])
|
||||
|
@ -170,6 +170,7 @@ function Abonnement(props) {
|
|||
else {
|
||||
|
||||
setpaymentmodeapi("True");
|
||||
setpaymentmode_nb_carte(data['nb_carte'])
|
||||
if (data['message'] && data['message'][0] &&
|
||||
Object.keys(data['message'][0]).length > 0) {
|
||||
setpaymentmode(data['message']);
|
||||
|
@ -260,6 +261,10 @@ function Abonnement(props) {
|
|||
history.push("/PartnerLogin");
|
||||
}
|
||||
|
||||
const [RecordData_api, setRecordData_api] = useState();
|
||||
const [RecordData_result, setRecordData_result] = useState();
|
||||
const [RecordData_message, setRecordData_message] = useState();
|
||||
|
||||
function RecordData() {
|
||||
const formData = new FormData();
|
||||
const url = process.env.REACT_APP_API_URL + "myclass/api/update_partner_account/";
|
||||
|
@ -293,21 +298,21 @@ function Abonnement(props) {
|
|||
.then((response) => response.json())
|
||||
.then((result) => {
|
||||
console.log('Success:', result['message'], "result['status'] = ", result['status']);
|
||||
|
||||
|
||||
setRecordData_api(result['status']);
|
||||
setmyApiResponse(result['status']);
|
||||
setResult(result['message']);
|
||||
setRecordData_result(result['message']);
|
||||
if (String(result['status']) === String("true")) {
|
||||
settestval(true);
|
||||
desablefield1();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('RecordData Error:', error);
|
||||
|
||||
|
||||
setmyApiResponse("false");
|
||||
});
|
||||
|
||||
|
@ -378,8 +383,8 @@ function Abonnement(props) {
|
|||
formData.append('token', stored_part);
|
||||
|
||||
axios.post(url, formData).then(res => {
|
||||
|
||||
if (String(res.data.status) === String("true") ) {
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In getCurrentUserData res.data.status = " + res.data.status);
|
||||
//console.log(" In getCurrentUserData res.data.message = " + res.data.message);
|
||||
setmyApiResponse("True");
|
||||
|
@ -580,9 +585,9 @@ function Abonnement(props) {
|
|||
|
||||
console.log(" In getCurrentUserData res.data.status = " + data.status);
|
||||
console.log(" In getCurrentUserData res.data.message = " + data.message);
|
||||
|
||||
|
||||
if (String(data['status']) === String("false")) {
|
||||
|
||||
|
||||
setStopAbonnement_api("false");
|
||||
setStopAbonnement_message(data['message']);
|
||||
|
||||
|
@ -627,11 +632,13 @@ function Abonnement(props) {
|
|||
}
|
||||
|
||||
const [packprice, setpackprice] = useState();
|
||||
|
||||
return (
|
||||
<div className="abonnement">
|
||||
|
||||
{String(gotocheckout) === String("1") && <div>
|
||||
<Button onClick={returntoorder} className="btn_retour_ps"> Retour aux produits & Services </Button>
|
||||
|
||||
<CheckOut packs={selectedpacks} periodicity={periode} mypackprice={packprice} /> </div>
|
||||
|
||||
}
|
||||
|
@ -650,11 +657,11 @@ function Abonnement(props) {
|
|||
{String(gotocheckout) === String("0") && <div>
|
||||
<div className="div_row">
|
||||
<div className="div_row_gauche">
|
||||
|
||||
|
||||
<div className="titre1"> Votre plan actuel </div>
|
||||
Vous êtes actuellement sur un plan : {String(currentpack2).toUpperCase()}
|
||||
{result && (JSON.parse(result).end_date_abonnement) &&
|
||||
<nav style={{"color":"red"}}>Cet abonnement expire le {(JSON.parse(result).end_date_abonnement)} </nav>}
|
||||
Vous êtes actuellement sur un plan : {String(currentpack2).toUpperCase()}
|
||||
{result && (JSON.parse(result).end_date_abonnement) &&
|
||||
<nav style={{ "color": "red" }}>Cet abonnement expire le {(JSON.parse(result).end_date_abonnement)} </nav>}
|
||||
|
||||
<div style={{ "marginBottom": "2rem" }}> </div>
|
||||
<div className="titre1"> Mode de Paiement </div>
|
||||
|
@ -691,7 +698,7 @@ function Abonnement(props) {
|
|||
))}
|
||||
|
||||
|
||||
{String(paymentmodeapi) === String("True") && Object.keys(paymentmode).length <= 0 && <div>
|
||||
{String(paymentmodeapi) === String("True") && String(paymentmode_nb_carte) === "0" && <div>
|
||||
<div className="warninigUpdateData">
|
||||
Aucun mode de paiement enregistré.
|
||||
</div>
|
||||
|
@ -1182,25 +1189,25 @@ function Abonnement(props) {
|
|||
> Activez ce pack </Button>
|
||||
</div>}
|
||||
|
||||
{String(currentpack2).toLowerCase() === String("decouverte") && (!JSON.parse(result).end_date_abonnement) &&
|
||||
<div className="abonnement">
|
||||
<Button variant="contained"
|
||||
color="success"
|
||||
className="btn_arret_abonnement"
|
||||
onClick={(e) => {
|
||||
confirmSTOPAbonnement("decouverte");
|
||||
}}
|
||||
> Arretez </Button>
|
||||
</div>}
|
||||
{String(currentpack2).toLowerCase() === String("decouverte") && (!JSON.parse(result).end_date_abonnement) &&
|
||||
<div className="abonnement">
|
||||
<Button variant="contained"
|
||||
color="success"
|
||||
className="btn_arret_abonnement"
|
||||
onClick={(e) => {
|
||||
confirmSTOPAbonnement("decouverte");
|
||||
}}
|
||||
> Arretez </Button>
|
||||
</div>}
|
||||
|
||||
{String(currentpack2).toLowerCase() === String("decouverte") && (JSON.parse(result).end_date_abonnement) &&
|
||||
<div className="abonnement">
|
||||
<Button variant="contained"
|
||||
color="success"
|
||||
className="btn_arret_abonnement" style={{"cursor":"none"}}
|
||||
|
||||
> Arrêt le {(JSON.parse(result).end_date_abonnement)} </Button>
|
||||
</div>}
|
||||
<div className="abonnement">
|
||||
<Button variant="contained"
|
||||
color="success"
|
||||
className="btn_arret_abonnement" style={{ "cursor": "none" }}
|
||||
|
||||
> Arrêt le {(JSON.parse(result).end_date_abonnement)} </Button>
|
||||
</div>}
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -1257,7 +1264,7 @@ function Abonnement(props) {
|
|||
}}> Activez ce pack </Button>
|
||||
</div>}
|
||||
|
||||
{String(currentpack2).toLowerCase() === String("standard") && (!JSON.parse(result).end_date_abonnement) && <div className="abonnement">
|
||||
{String(currentpack2).toLowerCase() === String("standard") && (!JSON.parse(result).end_date_abonnement) && <div className="abonnement">
|
||||
<Button variant="contained"
|
||||
color="success"
|
||||
className="btn_arret_abonnement"
|
||||
|
@ -1268,13 +1275,13 @@ function Abonnement(props) {
|
|||
</div>}
|
||||
|
||||
{String(currentpack2).toLowerCase() === String("standard") && (JSON.parse(result).end_date_abonnement) &&
|
||||
<div className="abonnement">
|
||||
<Button variant="contained"
|
||||
color="success"
|
||||
className="btn_arret_abonnement" style={{"cursor":"none"}}
|
||||
|
||||
> Arrêt le {(JSON.parse(result).end_date_abonnement)} </Button>
|
||||
</div>}
|
||||
<div className="abonnement">
|
||||
<Button variant="contained"
|
||||
color="success"
|
||||
className="btn_arret_abonnement" style={{ "cursor": "none" }}
|
||||
|
||||
> Arrêt le {(JSON.parse(result).end_date_abonnement)} </Button>
|
||||
</div>}
|
||||
|
||||
|
||||
|
||||
|
@ -1335,24 +1342,24 @@ function Abonnement(props) {
|
|||
</div>}
|
||||
|
||||
{String(currentpack2).toLowerCase() === String("gold") && (!JSON.parse(result).end_date_abonnement) &&
|
||||
<div className="abonnement">
|
||||
<Button variant="contained"
|
||||
color="success"
|
||||
className="btn_arret_abonnement"
|
||||
onClick={(e) => {
|
||||
confirmSTOPAbonnement("Gold");
|
||||
}}
|
||||
> Arretez </Button>
|
||||
</div>}
|
||||
<div className="abonnement">
|
||||
<Button variant="contained"
|
||||
color="success"
|
||||
className="btn_arret_abonnement"
|
||||
onClick={(e) => {
|
||||
confirmSTOPAbonnement("Gold");
|
||||
}}
|
||||
> Arretez </Button>
|
||||
</div>}
|
||||
|
||||
{String(currentpack2).toLowerCase() === String("gold") && (JSON.parse(result).end_date_abonnement) &&
|
||||
<div className="abonnement">
|
||||
<Button variant="contained"
|
||||
color="success"
|
||||
className="btn_arret_abonnement" style={{"cursor":"none"}}
|
||||
|
||||
> Arrêt le {(JSON.parse(result).end_date_abonnement)} </Button>
|
||||
</div>}
|
||||
<div className="abonnement">
|
||||
<Button variant="contained"
|
||||
color="success"
|
||||
className="btn_arret_abonnement" style={{ "cursor": "none" }}
|
||||
|
||||
> Arrêt le {(JSON.parse(result).end_date_abonnement)} </Button>
|
||||
</div>}
|
||||
|
||||
|
||||
</div>
|
||||
|
|
|
@ -30,6 +30,7 @@ import { loadStripe } from '@stripe/stripe-js';
|
|||
import { PaymentElement } from '@stripe/react-stripe-js';
|
||||
|
||||
const stripePromise = loadStripe('pk_test_51LUUfAAbmaEugrFTI25uZBD3IFjbtaL6jUfRV83diDf7nco8worna4NGKhMHbPP71WCwT5EHFRdDNatxPrJWwgZ300kgH5EO4p');
|
||||
//const stripePromise_PROD = loadStripe('pk_live_51LUUfAAbmaEugrFTyfNe4Dj0vbxc5qXQqNs0rztjAKy8oSlc5EEQyJGjA8Z5kXmP2gvUMcYLUBYCIyWWzLCw59RY00PtGInkVf');
|
||||
|
||||
|
||||
|
||||
|
@ -96,7 +97,7 @@ function CheckOut(props) {
|
|||
)
|
||||
.then((response) => response.json())
|
||||
.then((result) => {
|
||||
console.log('Success:', result['message'], "result['status'] = ", result['status']);
|
||||
//console.log('Success:', result['message'], "result['status'] = ", result['status']);
|
||||
setmyApiResponse(result['status']);
|
||||
setResult(result['message']);
|
||||
if (String(result['status']) == String("true")) {
|
||||
|
@ -419,10 +420,22 @@ function CheckOut(props) {
|
|||
getCurrentUserData();
|
||||
get_production_service_by_pack();
|
||||
GetPayementMode();
|
||||
|
||||
if (String(props.packs).toLocaleLowerCase() === String("standard")) {
|
||||
setprice_ch(process.env.REACT_APP_API_URL_STRIP_ID_PACK_STAND);
|
||||
}
|
||||
else if (String(props.packs).toLocaleLowerCase() === String("gold")) {
|
||||
setprice_ch(process.env.REACT_APP_API_URL_STRIP_ID_PACK_GOLD);
|
||||
}
|
||||
|
||||
|
||||
window.scrollTo(0, 0);
|
||||
}, []);
|
||||
|
||||
|
||||
function Handler() {
|
||||
alert('works');
|
||||
}
|
||||
|
||||
const [orderid, setorderid] = useState();
|
||||
const [apiorderid, setapiorderid] = useState();
|
||||
|
@ -440,6 +453,53 @@ function CheckOut(props) {
|
|||
return;
|
||||
}
|
||||
|
||||
//initpayement_front();
|
||||
|
||||
// ---------- debut
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/create-subscription/";
|
||||
|
||||
var form1 = new FormData();
|
||||
|
||||
var local_souscription_id;
|
||||
var local_souscription_id2;
|
||||
|
||||
form1.append("customerid", cust_strip_id_global);
|
||||
form1.append("pack", currentpack);
|
||||
form1.append("qty", nb_formations);
|
||||
|
||||
fetch(myurl, {
|
||||
method: 'POST',
|
||||
body: form1,
|
||||
}).then((data) => data.json())
|
||||
.then((data) => {
|
||||
//console.log(' #### retour myclass/api/create-subscription/ = subscription_id:', data['subscription_id'], ' ### payment_intent_client_secret:', data['payment_intent_client_secret'], "data['Status'] = ", data['status'],);
|
||||
local_souscription_id = data['subscription_id'];
|
||||
|
||||
//console.log(" ### INSIDE initpayement_front(); : local_souscription_id = ", local_souscription_id);
|
||||
setpayement_id(data['subscription_id']);
|
||||
|
||||
if (String(data['status']) === String("true")) {
|
||||
//console.log(" subscriptionId = " + subscriptionId + " -- et clientSecret = " + clientSecret);
|
||||
setclientSecret_id(data['payment_intent_client_secret']);
|
||||
setpayement_id(data['subscription_id']);
|
||||
|
||||
local_souscription_id2 = data['subscription_id'];
|
||||
|
||||
//setSubscriptionData(data['subscription_id'], data['payment_intent_client_secret'] );
|
||||
//alert(" subscriptionId = " + data['subscription_id'] + " -- et clientSecret = " + data['payment_intent_client_secret']);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}).catch((error) => {
|
||||
console.log('Error:', error.message);
|
||||
});
|
||||
|
||||
|
||||
// ----- end
|
||||
|
||||
//console.log(" ### apres initpayement_front(); : local_souscription_id = ", local_souscription_id, " local_souscription_id2 = ",local_souscription_id2);
|
||||
|
||||
var form = new FormData();
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
|
@ -484,17 +544,17 @@ function CheckOut(props) {
|
|||
})
|
||||
.then((data) => data.json())
|
||||
.then((data) => {
|
||||
console.log('Success:', data['message'], "data['status'] = ", data['status'], "ORDER ID = ", data['order_id']);
|
||||
//console.log('Success:', data['message'], "data['status'] = ", data['status'], "ORDER ID = ", data['order_id']);
|
||||
if (String(data['status']) === String("true")) {
|
||||
setorderid(data['order_id']);
|
||||
setapiorderid("1");
|
||||
setmenu("ordervalide");
|
||||
//setmenu("ordervalide");
|
||||
setpaymentmodeapi("");
|
||||
setpaymentmode("");
|
||||
setgotocheckout("");
|
||||
|
||||
if (parseFloat(packprice) > 0)
|
||||
finalize_abonnement();
|
||||
finalize_abonnement(local_souscription_id);
|
||||
|
||||
}
|
||||
else {
|
||||
|
@ -510,6 +570,7 @@ function CheckOut(props) {
|
|||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const [paymentadded, setpaymentadded] = useState("");
|
||||
|
@ -640,7 +701,7 @@ function CheckOut(props) {
|
|||
)
|
||||
.then((response) => response.json())
|
||||
.then((result) => {
|
||||
console.log('Success:', result['message'], "result['status'] = ", result['status']);
|
||||
//console.log('Success:', result['message'], "result['status'] = ", result['status']);
|
||||
setaddfacturationinfo_api(result['status']);
|
||||
|
||||
|
||||
|
@ -665,7 +726,7 @@ function CheckOut(props) {
|
|||
|
||||
// Gestion payement Stripe
|
||||
|
||||
const [price_ch, setprice_ch] = useState("price_1LpyndAbmaEugrFTKZAAkm72");
|
||||
const [price_ch, setprice_ch] = useState("");
|
||||
const [customer_ch, setcustomer_ch] = useState();
|
||||
const [subscriptionData, setSubscriptionData] = useState(null);
|
||||
|
||||
|
@ -673,6 +734,8 @@ function CheckOut(props) {
|
|||
const [clientSecret_id, setclientSecret_id] = useState();
|
||||
const [paymentIntent, setPaymentIntent] = useState();
|
||||
|
||||
const [cust_strip_id_global, setcust_strip_id_global] = useState();
|
||||
|
||||
|
||||
|
||||
function initpayement_front() {
|
||||
|
@ -699,7 +762,8 @@ function CheckOut(props) {
|
|||
|
||||
if (String(data['status']) === String("true")) {
|
||||
var mylocaltraining = JSON.parse(data.message);
|
||||
if (mylocaltraining) {
|
||||
setcust_strip_id_global(mylocaltraining.stripe_account_id);
|
||||
/* if (mylocaltraining) {
|
||||
|
||||
cust_strip_id = mylocaltraining.stripe_account_id;
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/create-subscription/";
|
||||
|
@ -708,14 +772,15 @@ function CheckOut(props) {
|
|||
|
||||
|
||||
form.append("customerid", cust_strip_id);
|
||||
form.append("priceid", price_ch);
|
||||
form.append("pack", currentpack);
|
||||
form.append("qty", nb_formations);
|
||||
|
||||
fetch(myurl, {
|
||||
method: 'POST',
|
||||
body: form,
|
||||
}).then((data) => data.json())
|
||||
.then((data) => {
|
||||
//console.log(' #### subscription_id:', data['subscription_id'], ' ### payment_intent_client_secret:', data['payment_intent_client_secret'], "data['Status'] = ", data['status'],);
|
||||
console.log(' #### retour myclass/api/create-subscription/ = subscription_id:', data['subscription_id'], ' ### payment_intent_client_secret:', data['payment_intent_client_secret'], "data['Status'] = ", data['status'],);
|
||||
|
||||
if (String(data['status']) === String("true")) {
|
||||
//console.log(" subscriptionId = " + subscriptionId + " -- et clientSecret = " + clientSecret);
|
||||
|
@ -731,7 +796,7 @@ function CheckOut(props) {
|
|||
}).catch((error) => {
|
||||
console.log('Error:', error.message);
|
||||
});
|
||||
}
|
||||
} */
|
||||
}
|
||||
|
||||
|
||||
|
@ -751,7 +816,9 @@ function CheckOut(props) {
|
|||
const [payement_ok, setpayement_ok] = useState();
|
||||
const [amount_captured, setamount_captured] = useState();
|
||||
|
||||
function finalize_abonnement() {
|
||||
const [payement_3DS_url, setpayement_3DS_url] = useState();
|
||||
|
||||
function finalize_abonnement(local_souscription_id) {
|
||||
//alert("Finalization de l'abonnement ");
|
||||
// Initialize an instance of stripe.
|
||||
|
||||
|
@ -778,12 +845,12 @@ function CheckOut(props) {
|
|||
if (error) {
|
||||
// show error and collect new card details.
|
||||
alert(error.message);
|
||||
console.log(error.message);
|
||||
//console.log(error.message);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
//alert(" OKK paymentIntent = " + paymentIntent);
|
||||
console.log(paymentIntent);
|
||||
//console.log(paymentIntent);
|
||||
|
||||
setPaymentIntent(paymentIntent);
|
||||
//alert(" debut conformation cmd ");
|
||||
|
@ -793,9 +860,10 @@ function CheckOut(props) {
|
|||
|
||||
const handleSubmit_MySy_Back = async (e) => {
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/confirm_payment/";
|
||||
var form = new FormData();
|
||||
form.append("stripe_payment_id", payement_id);
|
||||
form.append("stripe_payment_id", local_souscription_id);
|
||||
form.append('token', stored_part);
|
||||
|
||||
|
||||
|
@ -804,12 +872,15 @@ function CheckOut(props) {
|
|||
body: form,
|
||||
}).then((data) => data.json())
|
||||
.then((data) => {
|
||||
//console.log(' #### status:', data['status'], ' -- payement_id:', data['payement_id'], " -- amount_captured = ", data['amount_captured'],);
|
||||
console.log(' #### status:', data['status'], ' -- payement_id:',
|
||||
data['payement_id'], " -- amount_captured = ", data['amount_captured'],
|
||||
" secure_url = ", data['secure_url']);
|
||||
|
||||
if (String(data['status']) === String("true")) {
|
||||
setpayement_ok("1");
|
||||
setamount_captured(data['amount_captured']);
|
||||
setPaymentIntent("1");
|
||||
setpayement_3DS_url(data['secure_url']);
|
||||
|
||||
}
|
||||
else {
|
||||
|
@ -852,6 +923,13 @@ function CheckOut(props) {
|
|||
|
||||
}
|
||||
|
||||
function finaliser() {
|
||||
window.open(
|
||||
"/",
|
||||
'_self'
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="checkout">
|
||||
|
||||
|
@ -863,6 +941,19 @@ function CheckOut(props) {
|
|||
|
||||
{String(menu) === String("default") && <div>
|
||||
<h2 style={{ "textAlign": "center", "marginBottom": "2rem" }} ref={scrollDiv}> Récapitulatif de votre commande </h2>
|
||||
setpayement_3DS_url = {payement_3DS_url}
|
||||
|
||||
{payement_3DS_url && <div>
|
||||
<button onClick={finaliser}> finaliser </button>
|
||||
<iframe src={payement_3DS_url} id="3DS_iframe"
|
||||
style={{ "border": "solid 2px", "width": "400px", "height": "500px" }}>
|
||||
|
||||
</iframe>
|
||||
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
<div className="div_row" >
|
||||
<div className="div_row_gauche">
|
||||
|
||||
|
@ -877,7 +968,7 @@ function CheckOut(props) {
|
|||
</ul>
|
||||
|
||||
))}
|
||||
|
||||
code produit :
|
||||
|
||||
</div>
|
||||
<div className="div_row_droite"> <div className="titre1"> Detail prix </div>
|
||||
|
@ -908,23 +999,23 @@ function CheckOut(props) {
|
|||
<div style={{ "textAlign": "left", "width": "50%", "float": "left" }}>
|
||||
Nombre de formations :
|
||||
</div>
|
||||
{(String(props.packs).toLowerCase() !== String("decouverte")) &&
|
||||
<div style={{ "textAlign": "right", "width": "50%", "float": "left" }}>
|
||||
<input
|
||||
value={nb_formations}
|
||||
onChange={change_nb_formations}
|
||||
type="number"
|
||||
min="1"
|
||||
max="50"
|
||||
className="nb_ftion"
|
||||
/>
|
||||
</div>
|
||||
{(String(props.packs).toLowerCase() !== String("decouverte")) &&
|
||||
<div style={{ "textAlign": "right", "width": "50%", "float": "left" }}>
|
||||
<input
|
||||
value={nb_formations}
|
||||
onChange={change_nb_formations}
|
||||
type="number"
|
||||
min="1"
|
||||
max="50"
|
||||
className="nb_ftion"
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
||||
{(String(props.packs).toLowerCase() === String("decouverte")) &&
|
||||
<div style={{ "textAlign": "right", "width": "50%", "float": "left" }}>
|
||||
1
|
||||
</div>
|
||||
{(String(props.packs).toLowerCase() === String("decouverte")) &&
|
||||
<div style={{ "textAlign": "right", "width": "50%", "float": "left" }}>
|
||||
1
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ function Inscription_Information(props) {
|
|||
var nom = document.getElementsByName("nom")[0].value;
|
||||
if (String(nom).trim().length <= 0) {
|
||||
document.getElementsByName("nom")[0].style.borderColor = "red";
|
||||
alert(" Le nom d'utilisateur est obligatoire ");
|
||||
alert(" Le nom d'utilisateur est obligatoire 3");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ function Inscription_Information(props) {
|
|||
|
||||
var session = mysession;
|
||||
if (String(nom).trim().length <= 0) {
|
||||
alert(" Le nom d'utilisateur est obligatoire ");
|
||||
alert(" Le nom d'utilisateur est obligatoire 2 ");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -394,7 +394,7 @@ function Inscription_Information(props) {
|
|||
if (props.Close_info_form)
|
||||
props.Close_info_form();
|
||||
}
|
||||
|
||||
|
||||
|
||||
const editorRef_description = useRef(null);
|
||||
const [field_description, setfield_description] = useState("");
|
||||
|
@ -419,6 +419,7 @@ function Inscription_Information(props) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
const [SendInformationRequest_api, setSendInformationRequest_api] = useState("");
|
||||
const [SendInformationRequest_status, setSendInformationRequest_status] = useState("");
|
||||
const [SendInformationRequest_message, setSendInformationRequest_message] = useState("");
|
||||
|
@ -427,14 +428,16 @@ function Inscription_Information(props) {
|
|||
const formData = new FormData();
|
||||
const url = process.env.REACT_APP_API_URL + "myclass/api/RenseignementClass/";
|
||||
|
||||
var nom = document.getElementsByName("nom_info")[0].value;
|
||||
var nom = valnom_info;
|
||||
|
||||
//console.log(" nom = ", nom, );
|
||||
if (String(nom).trim().length <= 0) {
|
||||
document.getElementsByName("nom_info")[0].style.borderColor = "red";
|
||||
alert(" Le nom d'utilisateur est obligatoire ");
|
||||
alert(" Le nom d'utilisateur est obligatoire 1 ");
|
||||
return;
|
||||
}
|
||||
|
||||
var prenom = document.getElementsByName("prenom_info")[0].value;
|
||||
var prenom = valprenom_info;
|
||||
if (String(prenom).trim().length <= 0) {
|
||||
document.getElementsByName("telephone_info")[0].style.borderColor = "red";
|
||||
alert(" Le prenom d'utilisateur est obligatoire ");
|
||||
|
@ -442,14 +445,14 @@ function Inscription_Information(props) {
|
|||
}
|
||||
|
||||
|
||||
var telephone = document.getElementsByName("telephone_info")[0].value;
|
||||
var telephone = valtelephone_info;
|
||||
if (String(telephone).trim().length < 10) {
|
||||
document.getElementsByName("telephone_info")[0].style.borderColor = "red";
|
||||
alert(" Le numero de telephone doit comporter 10 chiffres ");
|
||||
return;
|
||||
}
|
||||
|
||||
var email = document.getElementsByName("email_info")[0].value;
|
||||
var email = valemail_info;
|
||||
var re2 = /\S+@\S+\.\S+/;
|
||||
if (re2.test(email) === false) {
|
||||
alert("L'email est incorrect ");
|
||||
|
@ -458,11 +461,8 @@ function Inscription_Information(props) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
var employeur = ""
|
||||
if (document.getElementById('employeur_info') && document.getElementById('employeur_info').value) {
|
||||
employeur = document.getElementById('employeur_info').value;
|
||||
}
|
||||
var employeur = valemployeur_info;
|
||||
|
||||
|
||||
var message = "";
|
||||
if (editorRef_description.current) {
|
||||
|
@ -537,12 +537,12 @@ function Inscription_Information(props) {
|
|||
}
|
||||
|
||||
|
||||
if (!RatingValue){
|
||||
if (!RatingValue) {
|
||||
|
||||
alert(" Vous n'avez pas donné une appreciation globle. Le point N° 1. Merci d'avance")
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
formData.append('inscription_id', props.eval_token);
|
||||
|
@ -582,6 +582,40 @@ function Inscription_Information(props) {
|
|||
const [RatingValue, setRatingValue] = useState(0);
|
||||
let datafromchild = "yaaaaa child";
|
||||
|
||||
const [valnom_info, setvalnom_info] = useState();
|
||||
const [valprenom_info, setvalprenom_info] = useState();
|
||||
const [valemail_info, setvalemail_info] = useState();
|
||||
const [valtelephone_info, setvaltelephone_info] = useState();
|
||||
const [valemployeur_info, setvalemployeur_info] = useState();
|
||||
|
||||
const handlervalnom_info = event => {
|
||||
var val = event.target.value;
|
||||
setvalnom_info(val);
|
||||
};
|
||||
|
||||
|
||||
const handlervalprenom_info = event => {
|
||||
var val = event.target.value;
|
||||
setvalprenom_info(val);
|
||||
};
|
||||
|
||||
|
||||
const handlervalemail_info = event => {
|
||||
var val = event.target.value;
|
||||
setvalemail_info(val);
|
||||
};
|
||||
|
||||
|
||||
const handlervaltelephone_info = event => {
|
||||
var val = event.target.value;
|
||||
setvaltelephone_info(val);
|
||||
};
|
||||
|
||||
const handlervalemployeur_info = event => {
|
||||
var val = event.target.value;
|
||||
setvalemployeur_info(val);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className='inscription'>
|
||||
|
||||
|
@ -633,13 +667,13 @@ function Inscription_Information(props) {
|
|||
|
||||
<option value={JSON.parse(formation).formation_session_id}>
|
||||
|
||||
|
||||
|
||||
{(JSON.parse(formation).date_debut).substring(0, 10)} au {(JSON.parse(formation).date_fin).substring(0, 10)} -
|
||||
{(JSON.parse(formation).distantiel) === "1" && " A Distance - "}
|
||||
{(JSON.parse(formation).presentiel) === "1" && (JSON.parse(formation).adresse) && " En Présentiel - " + (JSON.parse(formation).adresse)}
|
||||
{(JSON.parse(formation).presentiel) === "1" && (!JSON.parse(formation).adresse) && " En Présentiel - " }
|
||||
{(JSON.parse(formation).code_postal) && " "+(JSON.parse(formation).code_postal) }
|
||||
|
||||
{(JSON.parse(formation).distantiel) === "1" && " A Distance - "}
|
||||
{(JSON.parse(formation).presentiel) === "1" && (JSON.parse(formation).adresse) && " En Présentiel - " + (JSON.parse(formation).adresse)}
|
||||
{(JSON.parse(formation).presentiel) === "1" && (!JSON.parse(formation).adresse) && " En Présentiel - "}
|
||||
{(JSON.parse(formation).code_postal) && " " + (JSON.parse(formation).code_postal)}
|
||||
|
||||
|
||||
|
||||
</option>
|
||||
|
@ -951,8 +985,9 @@ function Inscription_Information(props) {
|
|||
|
||||
<TextField
|
||||
required
|
||||
label="Nom"
|
||||
label="Nom "
|
||||
name="nom_info"
|
||||
id="nom_info"
|
||||
className="texte_area"
|
||||
sx={{ m: 1, width: '90%' }}
|
||||
InputProps={{
|
||||
|
@ -962,6 +997,7 @@ function Inscription_Information(props) {
|
|||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
onChange={handlervalnom_info}
|
||||
variant="standard"
|
||||
/>
|
||||
|
||||
|
@ -978,8 +1014,10 @@ function Inscription_Information(props) {
|
|||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
onChange={handlervalprenom_info}
|
||||
variant="standard"
|
||||
/>
|
||||
|
||||
<TextField
|
||||
required
|
||||
name="email_info"
|
||||
|
@ -993,6 +1031,7 @@ function Inscription_Information(props) {
|
|||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
onChange={handlervalemail_info}
|
||||
variant="standard"
|
||||
/>
|
||||
|
||||
|
@ -1009,6 +1048,7 @@ function Inscription_Information(props) {
|
|||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
onChange={handlervaltelephone_info}
|
||||
variant="standard"
|
||||
/>
|
||||
|
||||
|
@ -1025,6 +1065,7 @@ function Inscription_Information(props) {
|
|||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
onChange={handlervalemployeur_info}
|
||||
variant="standard"
|
||||
/>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { useState, useEffect } from "react";
|
||||
import Button from '@mui/material/Button';
|
||||
import img_visa_mastercard from "./../mysy_img/visa_mastercard.png";
|
||||
import img_logo_stripe from "./../mysy_img/logo-stripe-secure.png";
|
||||
import img_logo_stripe from "./../mysy_img/logo-stripe-secure.png";
|
||||
import img_paypal from "./../mysy_img/paypal.png";
|
||||
import axios from "axios";
|
||||
import Box from '@mui/material/Box';
|
||||
|
@ -98,8 +98,9 @@ function PaymentMethodeNoConnect(props) {
|
|||
const stored_part = getCookie('tokenmysypart');
|
||||
|
||||
|
||||
const [paymenadded_api, setpaymenadded_api] = useState([]);
|
||||
const [paymenadded_message, setpaymenadded_message] = useState([]);
|
||||
const [RecordData_api, setRecordData_api] = useState();
|
||||
const [RecordData_result, setRecordData_result] = useState();
|
||||
const [RecordData_message, setRecordData_message] = useState();
|
||||
function RecordData() {
|
||||
|
||||
const formData = new FormData();
|
||||
|
@ -114,6 +115,9 @@ function PaymentMethodeNoConnect(props) {
|
|||
formData.append('pwd', pwd);
|
||||
formData.append('secret', secret);
|
||||
|
||||
|
||||
console.log(" menu = ", menu);
|
||||
|
||||
if (String(menu) === String("cb")) {
|
||||
var nom_carte = document.getElementsByName("nom_carte")[0].value;
|
||||
var num_carte = document.getElementsByName("num_carte")[0].value;
|
||||
|
@ -136,21 +140,27 @@ function PaymentMethodeNoConnect(props) {
|
|||
.then((response) => response.json())
|
||||
.then((result) => {
|
||||
console.log(' paymenadded_api Success:', result['message'], "result['status'] = ", result['status']);
|
||||
setmyApiResponse(result['status']);
|
||||
setResult(result['message']);
|
||||
setRecordData_api(result['status']);
|
||||
|
||||
console.log(" FFFF ");
|
||||
if (String(result['status']) === String("true")) {
|
||||
|
||||
setpaymentadded("1");
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
setpaymentadded("0");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error:', error);
|
||||
setmyApiResponse("false");
|
||||
setRecordData_api("false");
|
||||
|
||||
setpaymentadded("0");
|
||||
});
|
||||
|
||||
|
@ -233,15 +243,6 @@ function PaymentMethodeNoConnect(props) {
|
|||
{String(paymentadded) === String("1") && <div className="okUpdateData">
|
||||
Le mode de Paiement a été correctement ajouté
|
||||
|
||||
{
|
||||
|
||||
history.push({
|
||||
pathname: "/Partner/",
|
||||
state: {
|
||||
currentpack: props.currentpack, local_sub_menu: 'abonnement'
|
||||
}
|
||||
})}
|
||||
|
||||
|
||||
{window.location.reload()}
|
||||
</div>
|
||||
|
@ -256,7 +257,7 @@ function PaymentMethodeNoConnect(props) {
|
|||
|
||||
<div className="div_row_central">
|
||||
<img src={img_logo_stripe} className="img_payment" />
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<Box alignItems="left" sx={{ '& > :not(style)': { m: 1 }, width: '100%', }}>
|
||||
|
|
|
@ -2660,7 +2660,6 @@ const Recherche_new_v2 = () => {
|
|||
<nav className="header_menu"> </nav>
|
||||
<nav className="bar_vert"> </nav>
|
||||
<nav className="cta1">
|
||||
|
||||
{String(someoneconnected) !== String("1") && <nav className="cta2">
|
||||
<nav className="minscrire">
|
||||
|
||||
|
@ -2672,6 +2671,18 @@ const Recherche_new_v2 = () => {
|
|||
</nav>
|
||||
</nav>}
|
||||
|
||||
{String(someoneconnected) === String("1") && <nav className="cta2">
|
||||
<nav className="minscrire">
|
||||
|
||||
<div className="minscrire" onClick={handleAccountConnexion_v2}>
|
||||
Mon compte
|
||||
</div>
|
||||
|
||||
|
||||
</nav>
|
||||
</nav>}
|
||||
|
||||
|
||||
<nav className="cta3">
|
||||
<nav className="meconnecter">
|
||||
{String(someoneconnected) !== String("1") && <nav className="meconnecter" onClick={handleAccountConnexion}>
|
||||
|
|
|
@ -841,37 +841,22 @@ Cette fonction recuperer les stats des TOP 5 formations sur la periode saisie pa
|
|||
</Popup>
|
||||
);
|
||||
|
||||
const NestedToolTip = () => (
|
||||
<Popup
|
||||
trigger={<button className="button"> Trigger 1 </button>}
|
||||
position="top center"
|
||||
nested
|
||||
>
|
||||
<div>
|
||||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Asperiores dolor
|
||||
nulla animi, natus velit assumenda deserunt molestias
|
||||
<Popup
|
||||
trigger={<button className="button"> Trigger 2 </button>}
|
||||
position="bottom left"
|
||||
nested
|
||||
>
|
||||
<div>
|
||||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Asperiores
|
||||
dolor nulla animi, natus velit assumenda deserunt
|
||||
<Popup
|
||||
trigger={<button className="button"> Trigger 3 </button>}
|
||||
position="top right"
|
||||
nested
|
||||
>
|
||||
<span> Popup content </span>
|
||||
</Popup>
|
||||
</div>
|
||||
</Popup>
|
||||
</div>
|
||||
</Popup>
|
||||
);
|
||||
|
||||
|
||||
const [cherif3DS, setcherif3DS] = useState("ok");
|
||||
window.top.postMessage('3DS-authentication-complete');
|
||||
|
||||
function fermer() {
|
||||
window.close();
|
||||
}
|
||||
|
||||
function finaliser(){
|
||||
window.open(
|
||||
"/",
|
||||
'_self'
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="test_page2">
|
||||
<Helmet>
|
||||
|
@ -885,17 +870,20 @@ Cette fonction recuperer les stats des TOP 5 formations sur la periode saisie pa
|
|||
<div className="div_mobile">
|
||||
|
||||
|
||||
<h2> cartouche formaion </h2>
|
||||
<h2> cartouche formaion </h2>
|
||||
|
||||
|
||||
<div>
|
||||
<div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<h2>payement strip</h2>
|
||||
|
||||
<button onClick={finaliser} id="finalise"> Finaliser la commande</button>
|
||||
|
||||
|
||||
<button onClick={fermer}> Commande validé, fermer </button>
|
||||
|
||||
<br />
|
||||
<Popup
|
||||
trigger={<button className="button"> Open Modal 2</button>}
|
||||
|
@ -911,9 +899,9 @@ Cette fonction recuperer les stats des TOP 5 formations sur la periode saisie pa
|
|||
<div className="ch_header"> MySy Info </div>
|
||||
<div className="ch_content">
|
||||
{' '}
|
||||
Saisir les informatons pour valider la formation*
|
||||
Saisir les informatons pour valider la formation*
|
||||
<br />
|
||||
<input type="number" id="prix" name="prix" min="0" /><br />
|
||||
<input type="number" id="prix" name="prix" min="0" /><br />
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur sit
|
||||
commodi beatae optio voluptatum sed eius cumque, delectus saepe repudiandae
|
||||
|
@ -951,6 +939,10 @@ Cette fonction recuperer les stats des TOP 5 formations sur la periode saisie pa
|
|||
</Popup>
|
||||
<br />
|
||||
|
||||
|
||||
|
||||
<br />
|
||||
|
||||
<button onClick={initpayement_front}>
|
||||
Init Payement
|
||||
</button>
|
||||
|
|
|
@ -10,6 +10,8 @@ import {loadStripe} from '@stripe/stripe-js';
|
|||
|
||||
const stripePromise = loadStripe('pk_test_51LUUfAAbmaEugrFTI25uZBD3IFjbtaL6jUfRV83diDf7nco8worna4NGKhMHbPP71WCwT5EHFRdDNatxPrJWwgZ300kgH5EO4p');
|
||||
|
||||
const stripePromise_PROD = loadStripe('pk_live_51LUUfAAbmaEugrFTyfNe4Dj0vbxc5qXQqNs0rztjAKy8oSlc5EEQyJGjA8Z5kXmP2gvUMcYLUBYCIyWWzLCw59RY00PtGInkVf');
|
||||
|
||||
window.ela_tocken="";
|
||||
|
||||
|
||||
|
@ -17,7 +19,7 @@ window.ela_tocken="";
|
|||
ReactDOM.render(
|
||||
|
||||
<React.StrictMode>
|
||||
<Elements stripe={stripePromise}>
|
||||
<Elements stripe={stripePromise_PROD}>
|
||||
<App />
|
||||
</Elements>
|
||||
</React.StrictMode>
|
||||
|
|
|
@ -3341,7 +3341,7 @@ cursor: pointer;
|
|||
|
||||
.minscrire {
|
||||
cursor: pointer;
|
||||
width: 74px;
|
||||
//width: 74px;
|
||||
height: 30px;
|
||||
|
||||
font-family: 'Albert Sans';
|
||||
|
@ -6203,7 +6203,7 @@ cursor: pointer;
|
|||
|
||||
.minscrire {
|
||||
cursor: pointer;
|
||||
width: 74px;
|
||||
//width: 74px;
|
||||
height: 30px;
|
||||
|
||||
font-family: 'Albert Sans';
|
||||
|
@ -9063,7 +9063,7 @@ cursor: pointer;
|
|||
|
||||
.minscrire {
|
||||
cursor: pointer;
|
||||
width: 74px;
|
||||
//width: 74px;
|
||||
height: 30px;
|
||||
|
||||
font-family: 'Albert Sans';
|
||||
|
@ -11937,7 +11937,7 @@ cursor: pointer;
|
|||
|
||||
.minscrire {
|
||||
cursor: pointer;
|
||||
width: 74px;
|
||||
//width: 74px;
|
||||
height: 30px;
|
||||
|
||||
font-family: 'Albert Sans';
|
||||
|
|
Loading…
Reference in New Issue