23/01/23 - 19h
parent
0285813f0e
commit
ac2c7a1529
|
@ -139,7 +139,7 @@ function Abonnement(props) {
|
||||||
|
|
||||||
const [paymentmode, setpaymentmode] = useState([]);
|
const [paymentmode, setpaymentmode] = useState([]);
|
||||||
const [paymentmodeapi, setpaymentmodeapi] = useState([]);
|
const [paymentmodeapi, setpaymentmodeapi] = useState([]);
|
||||||
|
const [paymentmode_nb_carte, setpaymentmode_nb_carte] = useState();
|
||||||
|
|
||||||
function GetPayementMode(event) {
|
function GetPayementMode(event) {
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ function Abonnement(props) {
|
||||||
})
|
})
|
||||||
.then((data) => data.json())
|
.then((data) => data.json())
|
||||||
.then((data) => {
|
.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")) {
|
if (String(data['status']) === String("false")) {
|
||||||
//console.log("erreur rrrr:" + data['status'])
|
//console.log("erreur rrrr:" + data['status'])
|
||||||
|
@ -170,6 +170,7 @@ function Abonnement(props) {
|
||||||
else {
|
else {
|
||||||
|
|
||||||
setpaymentmodeapi("True");
|
setpaymentmodeapi("True");
|
||||||
|
setpaymentmode_nb_carte(data['nb_carte'])
|
||||||
if (data['message'] && data['message'][0] &&
|
if (data['message'] && data['message'][0] &&
|
||||||
Object.keys(data['message'][0]).length > 0) {
|
Object.keys(data['message'][0]).length > 0) {
|
||||||
setpaymentmode(data['message']);
|
setpaymentmode(data['message']);
|
||||||
|
@ -260,6 +261,10 @@ function Abonnement(props) {
|
||||||
history.push("/PartnerLogin");
|
history.push("/PartnerLogin");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const [RecordData_api, setRecordData_api] = useState();
|
||||||
|
const [RecordData_result, setRecordData_result] = useState();
|
||||||
|
const [RecordData_message, setRecordData_message] = useState();
|
||||||
|
|
||||||
function RecordData() {
|
function RecordData() {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
const url = process.env.REACT_APP_API_URL + "myclass/api/update_partner_account/";
|
const url = process.env.REACT_APP_API_URL + "myclass/api/update_partner_account/";
|
||||||
|
@ -294,9 +299,9 @@ function Abonnement(props) {
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
console.log('Success:', result['message'], "result['status'] = ", result['status']);
|
console.log('Success:', result['message'], "result['status'] = ", result['status']);
|
||||||
|
|
||||||
|
setRecordData_api(result['status']);
|
||||||
setmyApiResponse(result['status']);
|
setmyApiResponse(result['status']);
|
||||||
setResult(result['message']);
|
setRecordData_result(result['message']);
|
||||||
if (String(result['status']) === String("true")) {
|
if (String(result['status']) === String("true")) {
|
||||||
settestval(true);
|
settestval(true);
|
||||||
desablefield1();
|
desablefield1();
|
||||||
|
@ -627,11 +632,13 @@ function Abonnement(props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const [packprice, setpackprice] = useState();
|
const [packprice, setpackprice] = useState();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="abonnement">
|
<div className="abonnement">
|
||||||
|
|
||||||
{String(gotocheckout) === String("1") && <div>
|
{String(gotocheckout) === String("1") && <div>
|
||||||
<Button onClick={returntoorder} className="btn_retour_ps"> Retour aux produits & Services </Button>
|
<Button onClick={returntoorder} className="btn_retour_ps"> Retour aux produits & Services </Button>
|
||||||
|
|
||||||
<CheckOut packs={selectedpacks} periodicity={periode} mypackprice={packprice} /> </div>
|
<CheckOut packs={selectedpacks} periodicity={periode} mypackprice={packprice} /> </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">
|
<div className="warninigUpdateData">
|
||||||
Aucun mode de paiement enregistré.
|
Aucun mode de paiement enregistré.
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -30,6 +30,7 @@ import { loadStripe } from '@stripe/stripe-js';
|
||||||
import { PaymentElement } from '@stripe/react-stripe-js';
|
import { PaymentElement } from '@stripe/react-stripe-js';
|
||||||
|
|
||||||
const stripePromise = loadStripe('pk_test_51LUUfAAbmaEugrFTI25uZBD3IFjbtaL6jUfRV83diDf7nco8worna4NGKhMHbPP71WCwT5EHFRdDNatxPrJWwgZ300kgH5EO4p');
|
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((response) => response.json())
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
console.log('Success:', result['message'], "result['status'] = ", result['status']);
|
//console.log('Success:', result['message'], "result['status'] = ", result['status']);
|
||||||
setmyApiResponse(result['status']);
|
setmyApiResponse(result['status']);
|
||||||
setResult(result['message']);
|
setResult(result['message']);
|
||||||
if (String(result['status']) == String("true")) {
|
if (String(result['status']) == String("true")) {
|
||||||
|
@ -419,10 +420,22 @@ function CheckOut(props) {
|
||||||
getCurrentUserData();
|
getCurrentUserData();
|
||||||
get_production_service_by_pack();
|
get_production_service_by_pack();
|
||||||
GetPayementMode();
|
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);
|
window.scrollTo(0, 0);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
|
function Handler() {
|
||||||
|
alert('works');
|
||||||
|
}
|
||||||
|
|
||||||
const [orderid, setorderid] = useState();
|
const [orderid, setorderid] = useState();
|
||||||
const [apiorderid, setapiorderid] = useState();
|
const [apiorderid, setapiorderid] = useState();
|
||||||
|
@ -440,6 +453,53 @@ function CheckOut(props) {
|
||||||
return;
|
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();
|
var form = new FormData();
|
||||||
const stored_cookie = getCookie('tokenmysypart');
|
const stored_cookie = getCookie('tokenmysypart');
|
||||||
|
@ -484,17 +544,17 @@ function CheckOut(props) {
|
||||||
})
|
})
|
||||||
.then((data) => data.json())
|
.then((data) => data.json())
|
||||||
.then((data) => {
|
.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")) {
|
if (String(data['status']) === String("true")) {
|
||||||
setorderid(data['order_id']);
|
setorderid(data['order_id']);
|
||||||
setapiorderid("1");
|
setapiorderid("1");
|
||||||
setmenu("ordervalide");
|
//setmenu("ordervalide");
|
||||||
setpaymentmodeapi("");
|
setpaymentmodeapi("");
|
||||||
setpaymentmode("");
|
setpaymentmode("");
|
||||||
setgotocheckout("");
|
setgotocheckout("");
|
||||||
|
|
||||||
if (parseFloat(packprice) > 0)
|
if (parseFloat(packprice) > 0)
|
||||||
finalize_abonnement();
|
finalize_abonnement(local_souscription_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -510,6 +570,7 @@ function CheckOut(props) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [paymentadded, setpaymentadded] = useState("");
|
const [paymentadded, setpaymentadded] = useState("");
|
||||||
|
@ -640,7 +701,7 @@ function CheckOut(props) {
|
||||||
)
|
)
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
console.log('Success:', result['message'], "result['status'] = ", result['status']);
|
//console.log('Success:', result['message'], "result['status'] = ", result['status']);
|
||||||
setaddfacturationinfo_api(result['status']);
|
setaddfacturationinfo_api(result['status']);
|
||||||
|
|
||||||
|
|
||||||
|
@ -665,7 +726,7 @@ function CheckOut(props) {
|
||||||
|
|
||||||
// Gestion payement Stripe
|
// Gestion payement Stripe
|
||||||
|
|
||||||
const [price_ch, setprice_ch] = useState("price_1LpyndAbmaEugrFTKZAAkm72");
|
const [price_ch, setprice_ch] = useState("");
|
||||||
const [customer_ch, setcustomer_ch] = useState();
|
const [customer_ch, setcustomer_ch] = useState();
|
||||||
const [subscriptionData, setSubscriptionData] = useState(null);
|
const [subscriptionData, setSubscriptionData] = useState(null);
|
||||||
|
|
||||||
|
@ -673,6 +734,8 @@ function CheckOut(props) {
|
||||||
const [clientSecret_id, setclientSecret_id] = useState();
|
const [clientSecret_id, setclientSecret_id] = useState();
|
||||||
const [paymentIntent, setPaymentIntent] = useState();
|
const [paymentIntent, setPaymentIntent] = useState();
|
||||||
|
|
||||||
|
const [cust_strip_id_global, setcust_strip_id_global] = useState();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function initpayement_front() {
|
function initpayement_front() {
|
||||||
|
@ -699,7 +762,8 @@ function CheckOut(props) {
|
||||||
|
|
||||||
if (String(data['status']) === String("true")) {
|
if (String(data['status']) === String("true")) {
|
||||||
var mylocaltraining = JSON.parse(data.message);
|
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;
|
cust_strip_id = mylocaltraining.stripe_account_id;
|
||||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/create-subscription/";
|
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("customerid", cust_strip_id);
|
||||||
form.append("priceid", price_ch);
|
form.append("pack", currentpack);
|
||||||
|
form.append("qty", nb_formations);
|
||||||
|
|
||||||
fetch(myurl, {
|
fetch(myurl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: form,
|
body: form,
|
||||||
}).then((data) => data.json())
|
}).then((data) => data.json())
|
||||||
.then((data) => {
|
.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")) {
|
if (String(data['status']) === String("true")) {
|
||||||
//console.log(" subscriptionId = " + subscriptionId + " -- et clientSecret = " + clientSecret);
|
//console.log(" subscriptionId = " + subscriptionId + " -- et clientSecret = " + clientSecret);
|
||||||
|
@ -731,7 +796,7 @@ function CheckOut(props) {
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log('Error:', error.message);
|
console.log('Error:', error.message);
|
||||||
});
|
});
|
||||||
}
|
} */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -751,7 +816,9 @@ function CheckOut(props) {
|
||||||
const [payement_ok, setpayement_ok] = useState();
|
const [payement_ok, setpayement_ok] = useState();
|
||||||
const [amount_captured, setamount_captured] = 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 ");
|
//alert("Finalization de l'abonnement ");
|
||||||
// Initialize an instance of stripe.
|
// Initialize an instance of stripe.
|
||||||
|
|
||||||
|
@ -778,12 +845,12 @@ function CheckOut(props) {
|
||||||
if (error) {
|
if (error) {
|
||||||
// show error and collect new card details.
|
// show error and collect new card details.
|
||||||
alert(error.message);
|
alert(error.message);
|
||||||
console.log(error.message);
|
//console.log(error.message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//alert(" OKK paymentIntent = " + paymentIntent);
|
//alert(" OKK paymentIntent = " + paymentIntent);
|
||||||
console.log(paymentIntent);
|
//console.log(paymentIntent);
|
||||||
|
|
||||||
setPaymentIntent(paymentIntent);
|
setPaymentIntent(paymentIntent);
|
||||||
//alert(" debut conformation cmd ");
|
//alert(" debut conformation cmd ");
|
||||||
|
@ -793,9 +860,10 @@ function CheckOut(props) {
|
||||||
|
|
||||||
const handleSubmit_MySy_Back = async (e) => {
|
const handleSubmit_MySy_Back = async (e) => {
|
||||||
|
|
||||||
|
|
||||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/confirm_payment/";
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/confirm_payment/";
|
||||||
var form = new FormData();
|
var form = new FormData();
|
||||||
form.append("stripe_payment_id", payement_id);
|
form.append("stripe_payment_id", local_souscription_id);
|
||||||
form.append('token', stored_part);
|
form.append('token', stored_part);
|
||||||
|
|
||||||
|
|
||||||
|
@ -804,12 +872,15 @@ function CheckOut(props) {
|
||||||
body: form,
|
body: form,
|
||||||
}).then((data) => data.json())
|
}).then((data) => data.json())
|
||||||
.then((data) => {
|
.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")) {
|
if (String(data['status']) === String("true")) {
|
||||||
setpayement_ok("1");
|
setpayement_ok("1");
|
||||||
setamount_captured(data['amount_captured']);
|
setamount_captured(data['amount_captured']);
|
||||||
setPaymentIntent("1");
|
setPaymentIntent("1");
|
||||||
|
setpayement_3DS_url(data['secure_url']);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -852,6 +923,13 @@ function CheckOut(props) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function finaliser() {
|
||||||
|
window.open(
|
||||||
|
"/",
|
||||||
|
'_self'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="checkout">
|
<div className="checkout">
|
||||||
|
|
||||||
|
@ -863,6 +941,19 @@ function CheckOut(props) {
|
||||||
|
|
||||||
{String(menu) === String("default") && <div>
|
{String(menu) === String("default") && <div>
|
||||||
<h2 style={{ "textAlign": "center", "marginBottom": "2rem" }} ref={scrollDiv}> Récapitulatif de votre commande </h2>
|
<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" >
|
||||||
<div className="div_row_gauche">
|
<div className="div_row_gauche">
|
||||||
|
|
||||||
|
@ -877,7 +968,7 @@ function CheckOut(props) {
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
))}
|
))}
|
||||||
|
code produit :
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div className="div_row_droite"> <div className="titre1"> Detail prix </div>
|
<div className="div_row_droite"> <div className="titre1"> Detail prix </div>
|
||||||
|
|
|
@ -108,7 +108,7 @@ function Inscription_Information(props) {
|
||||||
var nom = document.getElementsByName("nom")[0].value;
|
var nom = document.getElementsByName("nom")[0].value;
|
||||||
if (String(nom).trim().length <= 0) {
|
if (String(nom).trim().length <= 0) {
|
||||||
document.getElementsByName("nom")[0].style.borderColor = "red";
|
document.getElementsByName("nom")[0].style.borderColor = "red";
|
||||||
alert(" Le nom d'utilisateur est obligatoire ");
|
alert(" Le nom d'utilisateur est obligatoire 3");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ function Inscription_Information(props) {
|
||||||
|
|
||||||
var session = mysession;
|
var session = mysession;
|
||||||
if (String(nom).trim().length <= 0) {
|
if (String(nom).trim().length <= 0) {
|
||||||
alert(" Le nom d'utilisateur est obligatoire ");
|
alert(" Le nom d'utilisateur est obligatoire 2 ");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -419,6 +419,7 @@ function Inscription_Information(props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const [SendInformationRequest_api, setSendInformationRequest_api] = useState("");
|
const [SendInformationRequest_api, setSendInformationRequest_api] = useState("");
|
||||||
const [SendInformationRequest_status, setSendInformationRequest_status] = useState("");
|
const [SendInformationRequest_status, setSendInformationRequest_status] = useState("");
|
||||||
const [SendInformationRequest_message, setSendInformationRequest_message] = useState("");
|
const [SendInformationRequest_message, setSendInformationRequest_message] = useState("");
|
||||||
|
@ -427,14 +428,16 @@ function Inscription_Information(props) {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
const url = process.env.REACT_APP_API_URL + "myclass/api/RenseignementClass/";
|
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) {
|
if (String(nom).trim().length <= 0) {
|
||||||
document.getElementsByName("nom_info")[0].style.borderColor = "red";
|
document.getElementsByName("nom_info")[0].style.borderColor = "red";
|
||||||
alert(" Le nom d'utilisateur est obligatoire ");
|
alert(" Le nom d'utilisateur est obligatoire 1 ");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var prenom = document.getElementsByName("prenom_info")[0].value;
|
var prenom = valprenom_info;
|
||||||
if (String(prenom).trim().length <= 0) {
|
if (String(prenom).trim().length <= 0) {
|
||||||
document.getElementsByName("telephone_info")[0].style.borderColor = "red";
|
document.getElementsByName("telephone_info")[0].style.borderColor = "red";
|
||||||
alert(" Le prenom d'utilisateur est obligatoire ");
|
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) {
|
if (String(telephone).trim().length < 10) {
|
||||||
document.getElementsByName("telephone_info")[0].style.borderColor = "red";
|
document.getElementsByName("telephone_info")[0].style.borderColor = "red";
|
||||||
alert(" Le numero de telephone doit comporter 10 chiffres ");
|
alert(" Le numero de telephone doit comporter 10 chiffres ");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var email = document.getElementsByName("email_info")[0].value;
|
var email = valemail_info;
|
||||||
var re2 = /\S+@\S+\.\S+/;
|
var re2 = /\S+@\S+\.\S+/;
|
||||||
if (re2.test(email) === false) {
|
if (re2.test(email) === false) {
|
||||||
alert("L'email est incorrect ");
|
alert("L'email est incorrect ");
|
||||||
|
@ -458,11 +461,8 @@ function Inscription_Information(props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var employeur = valemployeur_info;
|
||||||
|
|
||||||
var employeur = ""
|
|
||||||
if (document.getElementById('employeur_info') && document.getElementById('employeur_info').value) {
|
|
||||||
employeur = document.getElementById('employeur_info').value;
|
|
||||||
}
|
|
||||||
|
|
||||||
var message = "";
|
var message = "";
|
||||||
if (editorRef_description.current) {
|
if (editorRef_description.current) {
|
||||||
|
@ -582,6 +582,40 @@ function Inscription_Information(props) {
|
||||||
const [RatingValue, setRatingValue] = useState(0);
|
const [RatingValue, setRatingValue] = useState(0);
|
||||||
let datafromchild = "yaaaaa child";
|
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 (
|
return (
|
||||||
<div className='inscription'>
|
<div className='inscription'>
|
||||||
|
|
||||||
|
@ -953,6 +987,7 @@ function Inscription_Information(props) {
|
||||||
required
|
required
|
||||||
label="Nom "
|
label="Nom "
|
||||||
name="nom_info"
|
name="nom_info"
|
||||||
|
id="nom_info"
|
||||||
className="texte_area"
|
className="texte_area"
|
||||||
sx={{ m: 1, width: '90%' }}
|
sx={{ m: 1, width: '90%' }}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
|
@ -962,6 +997,7 @@ function Inscription_Information(props) {
|
||||||
</InputAdornment>
|
</InputAdornment>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
onChange={handlervalnom_info}
|
||||||
variant="standard"
|
variant="standard"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -978,8 +1014,10 @@ function Inscription_Information(props) {
|
||||||
</InputAdornment>
|
</InputAdornment>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
onChange={handlervalprenom_info}
|
||||||
variant="standard"
|
variant="standard"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextField
|
<TextField
|
||||||
required
|
required
|
||||||
name="email_info"
|
name="email_info"
|
||||||
|
@ -993,6 +1031,7 @@ function Inscription_Information(props) {
|
||||||
</InputAdornment>
|
</InputAdornment>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
onChange={handlervalemail_info}
|
||||||
variant="standard"
|
variant="standard"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -1009,6 +1048,7 @@ function Inscription_Information(props) {
|
||||||
</InputAdornment>
|
</InputAdornment>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
onChange={handlervaltelephone_info}
|
||||||
variant="standard"
|
variant="standard"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -1025,6 +1065,7 @@ function Inscription_Information(props) {
|
||||||
</InputAdornment>
|
</InputAdornment>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
onChange={handlervalemployeur_info}
|
||||||
variant="standard"
|
variant="standard"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
@ -98,8 +98,9 @@ function PaymentMethodeNoConnect(props) {
|
||||||
const stored_part = getCookie('tokenmysypart');
|
const stored_part = getCookie('tokenmysypart');
|
||||||
|
|
||||||
|
|
||||||
const [paymenadded_api, setpaymenadded_api] = useState([]);
|
const [RecordData_api, setRecordData_api] = useState();
|
||||||
const [paymenadded_message, setpaymenadded_message] = useState([]);
|
const [RecordData_result, setRecordData_result] = useState();
|
||||||
|
const [RecordData_message, setRecordData_message] = useState();
|
||||||
function RecordData() {
|
function RecordData() {
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
@ -114,6 +115,9 @@ function PaymentMethodeNoConnect(props) {
|
||||||
formData.append('pwd', pwd);
|
formData.append('pwd', pwd);
|
||||||
formData.append('secret', secret);
|
formData.append('secret', secret);
|
||||||
|
|
||||||
|
|
||||||
|
console.log(" menu = ", menu);
|
||||||
|
|
||||||
if (String(menu) === String("cb")) {
|
if (String(menu) === String("cb")) {
|
||||||
var nom_carte = document.getElementsByName("nom_carte")[0].value;
|
var nom_carte = document.getElementsByName("nom_carte")[0].value;
|
||||||
var num_carte = document.getElementsByName("num_carte")[0].value;
|
var num_carte = document.getElementsByName("num_carte")[0].value;
|
||||||
|
@ -136,21 +140,27 @@ function PaymentMethodeNoConnect(props) {
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
console.log(' paymenadded_api Success:', result['message'], "result['status'] = ", result['status']);
|
console.log(' paymenadded_api Success:', result['message'], "result['status'] = ", result['status']);
|
||||||
setmyApiResponse(result['status']);
|
setRecordData_api(result['status']);
|
||||||
setResult(result['message']);
|
|
||||||
|
|
||||||
|
console.log(" FFFF ");
|
||||||
if (String(result['status']) === String("true")) {
|
if (String(result['status']) === String("true")) {
|
||||||
|
|
||||||
setpaymentadded("1");
|
setpaymentadded("1");
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
setpaymentadded("0");
|
setpaymentadded("0");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Error:', error);
|
console.error('Error:', error);
|
||||||
setmyApiResponse("false");
|
setRecordData_api("false");
|
||||||
|
|
||||||
setpaymentadded("0");
|
setpaymentadded("0");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -233,15 +243,6 @@ function PaymentMethodeNoConnect(props) {
|
||||||
{String(paymentadded) === String("1") && <div className="okUpdateData">
|
{String(paymentadded) === String("1") && <div className="okUpdateData">
|
||||||
Le mode de Paiement a été correctement ajouté
|
Le mode de Paiement a été correctement ajouté
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
history.push({
|
|
||||||
pathname: "/Partner/",
|
|
||||||
state: {
|
|
||||||
currentpack: props.currentpack, local_sub_menu: 'abonnement'
|
|
||||||
}
|
|
||||||
})}
|
|
||||||
|
|
||||||
|
|
||||||
{window.location.reload()}
|
{window.location.reload()}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2660,7 +2660,6 @@ const Recherche_new_v2 = () => {
|
||||||
<nav className="header_menu"> </nav>
|
<nav className="header_menu"> </nav>
|
||||||
<nav className="bar_vert"> </nav>
|
<nav className="bar_vert"> </nav>
|
||||||
<nav className="cta1">
|
<nav className="cta1">
|
||||||
|
|
||||||
{String(someoneconnected) !== String("1") && <nav className="cta2">
|
{String(someoneconnected) !== String("1") && <nav className="cta2">
|
||||||
<nav className="minscrire">
|
<nav className="minscrire">
|
||||||
|
|
||||||
|
@ -2672,6 +2671,18 @@ const Recherche_new_v2 = () => {
|
||||||
</nav>
|
</nav>
|
||||||
</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="cta3">
|
||||||
<nav className="meconnecter">
|
<nav className="meconnecter">
|
||||||
{String(someoneconnected) !== String("1") && <nav className="meconnecter" onClick={handleAccountConnexion}>
|
{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>
|
</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 (
|
return (
|
||||||
<div className="test_page2">
|
<div className="test_page2">
|
||||||
<Helmet>
|
<Helmet>
|
||||||
|
@ -894,8 +879,11 @@ Cette fonction recuperer les stats des TOP 5 formations sur la periode saisie pa
|
||||||
</div>
|
</div>
|
||||||
<h2>payement strip</h2>
|
<h2>payement strip</h2>
|
||||||
|
|
||||||
|
<button onClick={finaliser} id="finalise"> Finaliser la commande</button>
|
||||||
|
|
||||||
|
|
||||||
|
<button onClick={fermer}> Commande validé, fermer </button>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<Popup
|
<Popup
|
||||||
trigger={<button className="button"> Open Modal 2</button>}
|
trigger={<button className="button"> Open Modal 2</button>}
|
||||||
|
@ -951,6 +939,10 @@ Cette fonction recuperer les stats des TOP 5 formations sur la periode saisie pa
|
||||||
</Popup>
|
</Popup>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
<button onClick={initpayement_front}>
|
<button onClick={initpayement_front}>
|
||||||
Init Payement
|
Init Payement
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -10,6 +10,8 @@ import {loadStripe} from '@stripe/stripe-js';
|
||||||
|
|
||||||
const stripePromise = loadStripe('pk_test_51LUUfAAbmaEugrFTI25uZBD3IFjbtaL6jUfRV83diDf7nco8worna4NGKhMHbPP71WCwT5EHFRdDNatxPrJWwgZ300kgH5EO4p');
|
const stripePromise = loadStripe('pk_test_51LUUfAAbmaEugrFTI25uZBD3IFjbtaL6jUfRV83diDf7nco8worna4NGKhMHbPP71WCwT5EHFRdDNatxPrJWwgZ300kgH5EO4p');
|
||||||
|
|
||||||
|
const stripePromise_PROD = loadStripe('pk_live_51LUUfAAbmaEugrFTyfNe4Dj0vbxc5qXQqNs0rztjAKy8oSlc5EEQyJGjA8Z5kXmP2gvUMcYLUBYCIyWWzLCw59RY00PtGInkVf');
|
||||||
|
|
||||||
window.ela_tocken="";
|
window.ela_tocken="";
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,7 +19,7 @@ window.ela_tocken="";
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
|
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<Elements stripe={stripePromise}>
|
<Elements stripe={stripePromise_PROD}>
|
||||||
<App />
|
<App />
|
||||||
</Elements>
|
</Elements>
|
||||||
</React.StrictMode>
|
</React.StrictMode>
|
||||||
|
|
|
@ -3341,7 +3341,7 @@ cursor: pointer;
|
||||||
|
|
||||||
.minscrire {
|
.minscrire {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 74px;
|
//width: 74px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
|
||||||
font-family: 'Albert Sans';
|
font-family: 'Albert Sans';
|
||||||
|
@ -6203,7 +6203,7 @@ cursor: pointer;
|
||||||
|
|
||||||
.minscrire {
|
.minscrire {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 74px;
|
//width: 74px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
|
||||||
font-family: 'Albert Sans';
|
font-family: 'Albert Sans';
|
||||||
|
@ -9063,7 +9063,7 @@ cursor: pointer;
|
||||||
|
|
||||||
.minscrire {
|
.minscrire {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 74px;
|
//width: 74px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
|
||||||
font-family: 'Albert Sans';
|
font-family: 'Albert Sans';
|
||||||
|
@ -11937,7 +11937,7 @@ cursor: pointer;
|
||||||
|
|
||||||
.minscrire {
|
.minscrire {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 74px;
|
//width: 74px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
|
||||||
font-family: 'Albert Sans';
|
font-family: 'Albert Sans';
|
||||||
|
|
Loading…
Reference in New Issue