This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get montantHorsFdp() { | |
if (panier.listeProduits.length > 0) { | |
return panier.listeProduits.reduce((sum, i) => ( | |
sum += i.qte * i.prix | |
), 0); | |
} else { | |
return 0 | |
} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
class AddProduct extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
cart: [""], | |
prix: '', | |
nom: '', | |
qte: 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const makeTransaction = (amount, nonceFromTheClient) => { | |
gateway.transaction.sale({ | |
amount: amount, | |
paymentMethodNonce: nonceFromTheClient, | |
options: { | |
submitForSettlement: true | |
} | |
}, function(err, result) { | |
if (result.success) { | |
logger.info('[Braintree] Nouvelle transaction: %s', result.transaction.id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch('/saveInDB/livraison', { | |
credentials: 'include', | |
method: 'post', | |
body: JSON.stringify(values), | |
headers: new Headers({'Content-Type': 'application/json'}) | |
}) | |
.then(res => res.json()) | |
.then(res => { | |
if (res.error) { | |
console.log(res.error); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buy() { | |
// Send the nonce to your server | |
return this.instance.requestPaymentMethod() | |
.then(({nonce}) => fetch(`/paiement/nonce/${nonce}`), { | |
method: 'GET', | |
credentials: 'include', | |
}) | |
.then(resp => resp.json()) | |
.then(res => { | |
console.log(res); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
connection | |
close | |
content-length | |
2 | |
content-type | |
application/json; charset=utf-8 | |
date | |
Fri, 24 May 2019 21:36:43 GMT | |
etag | |
W/"2-vyGp6PvFo4RvsFtPoIWeCReyIC8" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var router = express.Router(); | |
var corsOptions = { | |
"origin": "http://localhost:3000", | |
"methods": "GET,HEAD,PUT,PATCH,POST,DELETE", | |
"preflightContinue": false, | |
"optionsSuccessStatus": 204, | |
"credentials": true | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
import SessionCart from './SessionCart'; | |
import Sessionlivraison from './SessionLivraison'; | |
import SessionPaiement from './SessionPaiement'; | |
import SessionAdresse from './SessionAdresse'; | |
import '../App.css'; | |
class Clients extends Component { | |
constructor(props) { | |
super(props); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const colis_1 = { | |
"colis_1.poids": "8", | |
"colis_1.longueur": "50", | |
"colis_1.largeur": "50", | |
"colis_1.hauteur": "55" | |
} | |
let recherche = new URLSearchParams(colis_1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let colis = new URLSearchParams(); | |
colis.set("expediteur.pays", "FR"); | |
colis.set("expediteur.code_postal", "35440"); | |
colis.set("expediteur.ville", "Feins"); | |
colis.set("expediteur.type", "entreprise"); | |
colis.set("expediteur.adresse", "1 rue d'aubigné"); |