24/01/23 - 19h
parent
ac2c7a1529
commit
5afea3b977
|
@ -37,6 +37,7 @@ import GestionAdministrative from "./components/GestionAdministrative";
|
||||||
import Emargement from "./pages/emargementOk";
|
import Emargement from "./pages/emargementOk";
|
||||||
import Formation_Cartouche_Com from "./pages/recherche_cartouche_com";
|
import Formation_Cartouche_Com from "./pages/recherche_cartouche_com";
|
||||||
import SeDesabonner from './pages/sedesabonner';
|
import SeDesabonner from './pages/sedesabonner';
|
||||||
|
import OrderConfirmation_3DS from "./pages/orderconfirmation_3DS";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
|
|
||||||
|
@ -73,6 +74,8 @@ function App() {
|
||||||
<Route path="/Display-Detail-formation_old/:classId/:action" exact component={DisplayDetailClass_new_v2} />
|
<Route path="/Display-Detail-formation_old/:classId/:action" exact component={DisplayDetailClass_new_v2} />
|
||||||
<Route path="/Display-Detail-Article/:articleId" exact component={DisplayDetailArticle} />
|
<Route path="/Display-Detail-Article/:articleId" exact component={DisplayDetailArticle} />
|
||||||
<Route path="/Display-Detail-formation-Coeur/:classId" exact component={CoupDeCoeur} />
|
<Route path="/Display-Detail-formation-Coeur/:classId" exact component={CoupDeCoeur} />
|
||||||
|
<Route path="/Partner/:action/:orderid/:packs" exact component={Partner} />
|
||||||
|
<Route path="/Partner/:action" exact component={Partner} />
|
||||||
<Route path="/Partner" exact component={Partner} />
|
<Route path="/Partner" exact component={Partner} />
|
||||||
<Route path="/PartnerLogin" exact component={PartnerLogin} />
|
<Route path="/PartnerLogin" exact component={PartnerLogin} />
|
||||||
<Route path="/PartnerLogin0" exact component={PartnerLogin0} />
|
<Route path="/PartnerLogin0" exact component={PartnerLogin0} />
|
||||||
|
@ -95,6 +98,7 @@ function App() {
|
||||||
<Route path="/CartoucheComMySy/" exact component={Formation_Cartouche_Com} />
|
<Route path="/CartoucheComMySy/" exact component={Formation_Cartouche_Com} />
|
||||||
<Route path="/Recherche_new_v2/" exact component={Recherche_new_v2} />
|
<Route path="/Recherche_new_v2/" exact component={Recherche_new_v2} />
|
||||||
<Route path="/unsubscribe/" exact component={SeDesabonner} />
|
<Route path="/unsubscribe/" exact component={SeDesabonner} />
|
||||||
|
<Route path="/OrderConfirmation_3DS/:orderid/:packs" exact component={OrderConfirmation_3DS} />
|
||||||
|
|
||||||
<Route component={NotFound} />
|
<Route component={NotFound} />
|
||||||
</Switch>
|
</Switch>
|
||||||
|
|
|
@ -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'], " nb_carte", data['nb_carte']);
|
//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'])
|
||||||
|
|
|
@ -437,6 +437,9 @@ function CheckOut(props) {
|
||||||
alert('works');
|
alert('works');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const [payment_in_process, setpayment_in_process] = useState();
|
||||||
|
|
||||||
const [orderid, setorderid] = useState();
|
const [orderid, setorderid] = useState();
|
||||||
const [apiorderid, setapiorderid] = useState();
|
const [apiorderid, setapiorderid] = useState();
|
||||||
const [apiorderidmessage, setapiorderidmessage] = useState();
|
const [apiorderidmessage, setapiorderidmessage] = useState();
|
||||||
|
@ -457,6 +460,7 @@ function CheckOut(props) {
|
||||||
|
|
||||||
// ---------- debut
|
// ---------- debut
|
||||||
|
|
||||||
|
setpayment_in_process("1");
|
||||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/create-subscription/";
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/create-subscription/";
|
||||||
|
|
||||||
var form1 = new FormData();
|
var form1 = new FormData();
|
||||||
|
@ -509,6 +513,7 @@ function CheckOut(props) {
|
||||||
//form.append("prix_ht", "1");
|
//form.append("prix_ht", "1");
|
||||||
form.append("discount", "0");
|
form.append("discount", "0");
|
||||||
form.append("pack", currentpack);
|
form.append("pack", currentpack);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
/!\ : Important, il faut preciser le nombre d'article envoyé avec ceci : form.append("nb_product", nb_article);
|
/!\ : Important, il faut preciser le nombre d'article envoyé avec ceci : form.append("nb_product", nb_article);
|
||||||
*/
|
*/
|
||||||
|
@ -536,7 +541,6 @@ function CheckOut(props) {
|
||||||
|
|
||||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/createOrder/";
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/createOrder/";
|
||||||
|
|
||||||
|
|
||||||
fetch(myurl,
|
fetch(myurl,
|
||||||
{
|
{
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
@ -818,10 +822,15 @@ function CheckOut(props) {
|
||||||
|
|
||||||
const [payement_3DS_url, setpayement_3DS_url] = useState();
|
const [payement_3DS_url, setpayement_3DS_url] = useState();
|
||||||
|
|
||||||
|
const [souscription_id, setsouscription_id] = useState();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function finalize_abonnement(local_souscription_id) {
|
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.
|
||||||
|
|
||||||
|
setsouscription_id(local_souscription_id);
|
||||||
|
|
||||||
const handleSubmit_ch = async (e) => {
|
const handleSubmit_ch = async (e) => {
|
||||||
|
|
||||||
|
@ -860,7 +869,6 @@ 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", local_souscription_id);
|
form.append("stripe_payment_id", local_souscription_id);
|
||||||
|
@ -923,13 +931,40 @@ function CheckOut(props) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function finaliser() {
|
const [check_payement_finalise_order_api, setcheck_payement_finalise_order_api] = useState("");
|
||||||
window.open(
|
const [check_payement_finalise_order_message, setcheck_payement_finalise_order_message] = useState("");
|
||||||
"/",
|
function check_payement_finalise_order() {
|
||||||
'_self'
|
|
||||||
);
|
var formData_tpm = new FormData();
|
||||||
|
formData_tpm.append('token', stored_part);
|
||||||
|
formData_tpm.append('stripe_payment_id', souscription_id);
|
||||||
|
|
||||||
|
console.log(" stripe_payment_id = ", souscription_id);
|
||||||
|
alert(" stripe_payment_id = ", souscription_id);
|
||||||
|
|
||||||
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/payment_retrieve_status/";
|
||||||
|
|
||||||
|
axios.post(myurl, formData_tpm).then(res => {
|
||||||
|
if (String(res.data.status) === String("true")) {
|
||||||
|
setcheck_payement_finalise_order_api("true")
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setcheck_payement_finalise_order_api("false")
|
||||||
|
setcheck_payement_finalise_order_message(String(res.data.message))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log('In CheckSalesOrder ', error);
|
||||||
|
setcheck_payement_finalise_order_api("false")
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="checkout">
|
<div className="checkout">
|
||||||
|
|
||||||
|
@ -941,12 +976,15 @@ 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}
|
|
||||||
|
<br />
|
||||||
|
|
||||||
{payement_3DS_url && <div>
|
{payement_3DS_url && <div>
|
||||||
<button onClick={finaliser}> finaliser </button>
|
|
||||||
<iframe src={payement_3DS_url} id="3DS_iframe"
|
<iframe src={payement_3DS_url} id="3DS_iframe"
|
||||||
style={{ "border": "solid 2px", "width": "400px", "height": "500px" }}>
|
style={{ "border": "solid 2px", "width": "90%", "height": "600px",
|
||||||
|
"marginBottom":"2rem",
|
||||||
|
"marginLeft":"5%" }}>
|
||||||
|
|
||||||
</iframe>
|
</iframe>
|
||||||
|
|
||||||
|
@ -1713,12 +1751,16 @@ function CheckOut(props) {
|
||||||
<div className="div_row">
|
<div className="div_row">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div className="div_row_center">
|
<div className="div_row_center">
|
||||||
|
|
||||||
{(String(okcommande) !== String("ko") ||
|
{(String(okcommande) !== String("ko") ||
|
||||||
(String(props.packs).toLowerCase() === String("decouverte")))
|
(String(props.packs).toLowerCase() === String("decouverte"))) &&
|
||||||
|
String(payment_in_process) !== "1"
|
||||||
&& <Button variant="contained" color="success" className="div_row22 btn_enreg_cmd " onClick={Ordervalidation}>Confirmer la commande</Button>}
|
&& <Button variant="contained" color="success" className="div_row22 btn_enreg_cmd " onClick={Ordervalidation}>Confirmer la commande</Button>}
|
||||||
{String(okcommande) === String("ko") && (String(props.packs).toLowerCase() !== String("decouverte")) && <Button variant="contained" disabled className="div_row22 btn_enreg_cmd " onClick={""}>Confirmer la commande</Button>}
|
{String(okcommande) === String("ko") && (String(props.packs).toLowerCase() !== String("decouverte")) &&
|
||||||
|
String(payment_in_process) !== "1"
|
||||||
|
&& <Button variant="contained" disabled className="div_row22 btn_enreg_cmd " onClick={""}>Confirmer la commande</Button>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ function OrderConfirmation(props) {
|
||||||
|
|
||||||
<h2 style={{ "textAlign": "center", "color": "green", "marginTop": "3rem" }}> Commande numéro : {props.num_cmd} </h2>
|
<h2 style={{ "textAlign": "center", "color": "green", "marginTop": "3rem" }}> Commande numéro : {props.num_cmd} </h2>
|
||||||
|
|
||||||
<div className="div_row_central">
|
{String(props.ok_order) === "1" && <div className="div_row_central">
|
||||||
Votre commande a été validée avec succès.<br />
|
Votre commande a été validée avec succès.<br />
|
||||||
Votre pack <b> {String(props.packs).toLocaleUpperCase()} </b>se mettra à jour dès que vous aurez actualisé votre page.<br />
|
Votre pack <b> {String(props.packs).toLocaleUpperCase()} </b>se mettra à jour dès que vous aurez actualisé votre page.<br />
|
||||||
Merci d'avoir choisi MySy Training.
|
Merci d'avoir choisi MySy Training.
|
||||||
|
@ -43,10 +43,18 @@ function OrderConfirmation(props) {
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Vous pouvez dès a present commencer à utiliser nos services.<br />
|
Vous pouvez dès à present commencer à utiliser nos services.<br />
|
||||||
Si vous avez d'aider n'hesitez pas à conter notre équipe support par le chatbot (en bas de votre écran) ou mail.
|
Si vous avez d'aider n'hesitez pas à contacter notre équipe support par le chatbot (en bas de votre écran) ou mail.
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>}
|
||||||
|
|
||||||
|
{String(props.ok_order) !== "1" && <div className="div_row_central koUpdateData">
|
||||||
|
Impossible de trouver la commnde {String(props.num_cmd)} .<br />
|
||||||
|
Merci de contacter notre équipe support par le chatbot (en bas de votre écran) ou mail.
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
</div>}
|
||||||
|
|
||||||
<div className="div_row_central">
|
<div className="div_row_central">
|
||||||
<Button variant="contained" color="success" className="div_row22 btn_enreg_cmd" onClick={(e) => {
|
<Button variant="contained" color="success" className="div_row22 btn_enreg_cmd" onClick={(e) => {
|
||||||
|
|
|
@ -0,0 +1,176 @@
|
||||||
|
import React, { useState, useEffect } from "react";
|
||||||
|
import Button from '@mui/material/Button';
|
||||||
|
import { getCookie } from 'react-use-cookie';
|
||||||
|
import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid';
|
||||||
|
import axios from "axios";
|
||||||
|
import Box from '@mui/material/Box';
|
||||||
|
import Partner from "./Partner";
|
||||||
|
import { useHistory } from "react-router-dom";
|
||||||
|
import Facture from "./Facture";
|
||||||
|
import { FaHandPointRight } from "react-icons/fa";
|
||||||
|
import { useParams } from 'react-router-dom'
|
||||||
|
|
||||||
|
function OrderConfirmation_3DS(props) {
|
||||||
|
const [menu, setmenu] = useState("");
|
||||||
|
const history = useHistory();
|
||||||
|
const { orderid, packs } = useParams()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
|
||||||
|
CheckSalesOrder();
|
||||||
|
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
function GoToInvoice() {
|
||||||
|
setmenu("facture");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const [stripe_payement_id, setstripe_payement_id] = useState("");
|
||||||
|
|
||||||
|
const [CheckSalesOrder_api, setCheckSalesOrder_api] = useState("");
|
||||||
|
const [CheckSalesOrder_message, setCheckSalesOrder_message] = useState("");
|
||||||
|
const [CheckSalesOrder_result, setCheckSalesOrder_result] = useState("");
|
||||||
|
const stored_part = getCookie('tokenmysypart');
|
||||||
|
function CheckSalesOrder(event) {
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
form.append("token", stored_part);
|
||||||
|
form.append("orderid", orderid);
|
||||||
|
|
||||||
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/CheckSalesOrder/";
|
||||||
|
|
||||||
|
axios.post(myurl, form).then(res => {
|
||||||
|
|
||||||
|
console.log(res.data.status, " -- ", res.data.message )
|
||||||
|
if (String(res.data.status) === String("true")) {
|
||||||
|
setCheckSalesOrder_api("true");
|
||||||
|
setCheckSalesOrder_result(String(res.data.message));
|
||||||
|
|
||||||
|
if (JSON.parse(res.data.message).stripe_pi) {
|
||||||
|
setstripe_payement_id(JSON.parse(res.data.message).stripe_pi);
|
||||||
|
check_payement_finalise_order(JSON.parse(res.data.message).stripe_pi);
|
||||||
|
}else{
|
||||||
|
setcheck_payement_finalise_order_api("false");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setCheckSalesOrder_api("false")
|
||||||
|
setCheckSalesOrder_message(String(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log('In CheckSalesOrder ', error);
|
||||||
|
setCheckSalesOrder_api("false")
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function parent_retur_main_page() {
|
||||||
|
if (window.parent) {
|
||||||
|
window.parent.location.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Verification si le payement est bien passé
|
||||||
|
const [check_payement_finalise_order_api, setcheck_payement_finalise_order_api] = useState("");
|
||||||
|
const [check_payement_finalise_order_message, setcheck_payement_finalise_order_message] = useState("");
|
||||||
|
function check_payement_finalise_order(stripe_pi) {
|
||||||
|
|
||||||
|
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/payment_retrieve_status/";
|
||||||
|
|
||||||
|
axios.post(myurl, formData_tpm).then(res => {
|
||||||
|
if (String(res.data.status) === String("true")) {
|
||||||
|
setcheck_payement_finalise_order_api("true");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setcheck_payement_finalise_order_api("false")
|
||||||
|
setcheck_payement_finalise_order_message(String(res.data.message))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log('In CheckSalesOrder ', error);
|
||||||
|
setcheck_payement_finalise_order_api("false")
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="orderconfirmation">
|
||||||
|
|
||||||
|
|
||||||
|
{String(menu) !== "facture" && <div>
|
||||||
|
|
||||||
|
<h2 style={{ "textAlign": "center", "color": "green", "marginTop": "3rem" }}> Commande numéro : {orderid} </h2>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{String(CheckSalesOrder_api) === "true" && String(check_payement_finalise_order_api) === "true" &&
|
||||||
|
<div className="div_row_central">
|
||||||
|
|
||||||
|
|
||||||
|
Votre commande a été validée avec succès.<br />
|
||||||
|
Votre pack <b> {String(packs).toLocaleUpperCase()} </b>se mettra à jour dès que vous aurez actualisé votre page.<br />
|
||||||
|
Merci d'avoir choisi MySy Training.
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
Votre facture est disponible dans votre espace personnel.
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
Vous pouvez dès à present commencer à utiliser nos services.<br />
|
||||||
|
Si vous avez d'aider n'hesitez pas à contacter notre équipe support par le chatbot (en bas de votre écran) ou mail.
|
||||||
|
<br />
|
||||||
|
</div>}
|
||||||
|
|
||||||
|
|
||||||
|
{String(CheckSalesOrder_api) === "true" && String(check_payement_finalise_order_api) === "false" &&
|
||||||
|
<div className="div_row_central koUpdateData">
|
||||||
|
Le payement de la commande {String(orderid)} n'est pas passé .<br />
|
||||||
|
Merci de contacter notre équipe support par le chatbot (en bas de votre écran) ou mail.
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
</div>}
|
||||||
|
|
||||||
|
|
||||||
|
{String(CheckSalesOrder_api) === "false" &&
|
||||||
|
<div className="div_row_central koUpdateData">
|
||||||
|
Impossible de trouver la commnde {String(orderid)} .<br />
|
||||||
|
Merci de contacter notre équipe support par le chatbot (en bas de votre écran) ou mail.
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
</div>}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div className="div_row_central">
|
||||||
|
<Button variant="contained" color="success" className="div_row22 btn_enreg_cmd"
|
||||||
|
onClick={parent_retur_main_page}>Retour vers mon compte</Button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default OrderConfirmation_3DS;
|
|
@ -24,6 +24,7 @@ import { useParams } from 'react-router-dom'
|
||||||
import CheckOut from "./CheckOut";
|
import CheckOut from "./CheckOut";
|
||||||
import { IoCheckmarkCircleSharp } from "react-icons/io5";
|
import { IoCheckmarkCircleSharp } from "react-icons/io5";
|
||||||
import { FaHandPointRight } from "react-icons/fa";
|
import { FaHandPointRight } from "react-icons/fa";
|
||||||
|
import OrderConfirmation from "./OrderConfirmation";
|
||||||
|
|
||||||
const Partner = (props) => {
|
const Partner = (props) => {
|
||||||
const { commingmenu, commingpack } = useParams();
|
const { commingmenu, commingpack } = useParams();
|
||||||
|
@ -54,6 +55,7 @@ const Partner = (props) => {
|
||||||
const [refesh, setrefesh] = useState("init");
|
const [refesh, setrefesh] = useState("init");
|
||||||
|
|
||||||
const [firstConnexion, setfirstConnexion] = useState("");
|
const [firstConnexion, setfirstConnexion] = useState("");
|
||||||
|
const { action, orderid, packs } = useParams()
|
||||||
|
|
||||||
|
|
||||||
const changeHandler = (event) => {
|
const changeHandler = (event) => {
|
||||||
|
@ -109,7 +111,7 @@ const Partner = (props) => {
|
||||||
setformation_file_name(event.target.files[0].name);
|
setformation_file_name(event.target.files[0].name);
|
||||||
|
|
||||||
//console.log(" import du ficier ", event.target.files[0].name);
|
//console.log(" import du ficier ", event.target.files[0].name);
|
||||||
|
|
||||||
|
|
||||||
formData.append('File', fileUploaded);
|
formData.append('File', fileUploaded);
|
||||||
//formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
|
//formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
|
||||||
|
@ -136,7 +138,7 @@ const Partner = (props) => {
|
||||||
if (String(result['status']) === String("true")) {
|
if (String(result['status']) === String("true")) {
|
||||||
sethandleSubmission_api("true");
|
sethandleSubmission_api("true");
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
sethandleSubmission_api("false");
|
sethandleSubmission_api("false");
|
||||||
sethandleSubmission_message(result['message']);
|
sethandleSubmission_message(result['message']);
|
||||||
}
|
}
|
||||||
|
@ -204,6 +206,20 @@ const Partner = (props) => {
|
||||||
setpartnerPackService(location.state.currentpack);
|
setpartnerPackService(location.state.currentpack);
|
||||||
//alert(" le pack = "+location.state.currentpack);
|
//alert(" le pack = "+location.state.currentpack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var list_menu = ['creation', 'infopartner', 'statistique', 'abonnement', 'affichage', 'ordervalide']
|
||||||
|
|
||||||
|
if (action && list_menu.includes(action)) {
|
||||||
|
setmenu(action);
|
||||||
|
|
||||||
|
if( action && orderid && packs && String("ordervalide")){
|
||||||
|
CheckSalesOrder();
|
||||||
|
}
|
||||||
|
|
||||||
|
if( action && orderid && packs && String("abonnement")){
|
||||||
|
console.log(" abonnement : payement intent = ", orderid, " pack = ", packs);
|
||||||
|
}
|
||||||
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
|
@ -439,7 +455,33 @@ const Partner = (props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const [formation_file_name, setformation_file_name] = useState();
|
const [formation_file_name, setformation_file_name] = useState();
|
||||||
|
const [CheckSalesOrder_api, setCheckSalesOrder_api] = useState("");
|
||||||
|
const [CheckSalesOrder_message, setCheckSalesOrder_message] = useState("");
|
||||||
|
function CheckSalesOrder(event) {
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
formData.append("token", stored_part);
|
||||||
|
formData.append("orderid", orderid);
|
||||||
|
|
||||||
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/CheckSalesOrder/";
|
||||||
|
|
||||||
|
axios.post(myurl, form).then(res => {
|
||||||
|
if (String(res.data.status) === String("true")) {
|
||||||
|
setCheckSalesOrder_api("true")
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setCheckSalesOrder_api("false")
|
||||||
|
setCheckSalesOrder_message(String(res.data.message))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log('In CheckSalesOrder ', error);
|
||||||
|
setCheckSalesOrder_api("false")
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
|
@ -584,7 +626,7 @@ const Partner = (props) => {
|
||||||
id='menu_import_formation' name='menu_import_formation'>Choisir un fichier et importer des formations <SendIcon />
|
id='menu_import_formation' name='menu_import_formation'>Choisir un fichier et importer des formations <SendIcon />
|
||||||
</Button><br />
|
</Button><br />
|
||||||
{formation_file_name && <nav className="okUpdateData"><i>{formation_file_name}</i></nav>}
|
{formation_file_name && <nav className="okUpdateData"><i>{formation_file_name}</i></nav>}
|
||||||
<input type="file"
|
<input type="file"
|
||||||
accept=".csv"
|
accept=".csv"
|
||||||
ref={hiddenFileInput_formation}
|
ref={hiddenFileInput_formation}
|
||||||
style={{ display: 'none' }}
|
style={{ display: 'none' }}
|
||||||
|
@ -598,7 +640,7 @@ const Partner = (props) => {
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
{/* <input type="file" name="file" accept=".csv" onChange={changeHandler} /> <br /> */}
|
{/* <input type="file" name="file" accept=".csv" onChange={changeHandler} /> <br /> */}
|
||||||
<br />
|
<br />
|
||||||
<div className="import_excel_text">
|
<div className="import_excel_text">
|
||||||
|
|
||||||
|
@ -626,7 +668,7 @@ const Partner = (props) => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>}
|
</div>}
|
||||||
|
|
||||||
|
@ -702,6 +744,11 @@ const Partner = (props) => {
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{String(menu) === "ordervalide" && orderid && packs && <div className="div_droite">
|
||||||
|
<OrderConfirmation num_cmd={orderid} packs={String(packs).toLocaleUpperCase()} />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<div className="pieddepage">
|
<div className="pieddepage">
|
||||||
<Footer />
|
<Footer />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
import OrderConfirmation_3DS from "../components/OrderConfirmation_3DS";
|
||||||
|
import Navigation from "../components/Navigation";
|
||||||
|
|
||||||
|
|
||||||
|
const acceuil = () => {
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<OrderConfirmation_3DS />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export default acceuil;
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue