Changeset 96091 in spip-zone
- Timestamp:
- Mar 20, 2016, 8:51:23 AM (5 years ago)
- Location:
- _plugins_/commandes_paypal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/commandes_paypal/commandes_paypal_pipelines.php
r57367 r96091 9 9 $flux['args']['paypal']['custom'] == 'payer_commande' 10 10 and $reference = $flux['args']['paypal']['invoice'] 11 and $commande = sql_fetsel('id_commande, statut, id_auteur', 'spip_commandes', 'reference = '.sql_quote($reference)) 12 ){ 13 $id_commande = $commande['id_commande']; 14 $statut_commande = $commande['statut']; 15 $statut_paypal = $flux['args']['paypal']['payment_status']; 16 $prix_paypal = $flux['args']['paypal']['mc_gross']; 17 18 // Si le statut Paypal est "Pending" on passe juste la commande en attente et on verra plus tard pour le reste 19 if ($statut_paypal == 'Pending'){ 20 $statut_nouveau = 'attente'; 21 } 22 // Si Paypal est "Completed" on vérifie que le montant correspond au prix de cette commande 11 and $commande = sql_fetsel('id_commande, statut, id_auteur', 'spip_commandes', 'reference = '.sql_quote($reference))){ 12 $id_commande = $commande['id_commande']; 13 $statut_commande = $commande['statut']; 14 $statut_paypal = $flux['args']['paypal']['payment_status']; 15 $prix_paypal = $flux['args']['paypal']['mc_gross']; 16 17 // Si le statut Paypal est "Pending" on passe juste la commande en attente et on verra plus tard pour le reste 18 if ($statut_paypal == 'Pending'){ 19 $statut_nouveau = 'attente'; 20 } 21 // Si Paypal est "Completed" on vérifie que le montant correspond au prix de cette commande 23 22 elseif ($statut_paypal == 'Completed'){ 24 23 $fonction_prix = charger_fonction('prix', 'inc/'); 25 24 $prix_commande = $fonction_prix('commande', $id_commande); 26 27 28 29 30 31 32 33 34 25 26 // Si on a pas assez payé 27 if ($prix_paypal < $prix_commande){ 28 $statut_nouveau = 'partiel'; 29 } 30 // Sinon c'est bon 31 else{ 32 $statut_nouveau = 'paye'; 33 } 35 34 } 36 35 // Sinon on dit que c'est en erreur … … 40 39 41 40 spip_log("commandes_paypal_traitement envoi vers instituer $id_commande-$statut_nouveau",'commandes'); 42 41 43 42 //on institue la commande 44 43 $action = charger_fonction('instituer_commande', 'action'); … … 46 45 47 46 } 48 49 47 return $flux; 50 48 } -
_plugins_/commandes_paypal/plugin.xml
r96090 r96091 3 3 <auteur>[Les Développements Durables->http://www.ldd.fr]</auteur> 4 4 <licence>GPL v3</licence> 5 <version>0.2. 7</version>5 <version>0.2.8</version> 6 6 <etat>dev</etat> 7 7 <slogan>Gére les retours Paypal</slogan> 8 8 <description>Ce plugin permet de gérer les retours d'un payement Paypal pour savoir quelle commande a été payée, et donc changer son statut.</description> 9 9 <categorie>divers</categorie> 10 10 <icon>images/commandes_paypal-32.png</icon> 11 11 12 12 <prefix>commandes_paypal</prefix> 13 13 14 14 <pipeline> 15 15 <nom>traitement_paypal</nom> 16 16 <inclure>commandes_paypal_pipelines.php</inclure> 17 17 </pipeline> 18 18 19 19 <necessite id="SPIP" version="[2.1.8;3.1.99]" /> 20 <necessite id="commandes" version="[0.4. 0;]" />21 <necessite id="paypal" version="[0.1. 0;]" />20 <necessite id="commandes" version="[0.4.6;]" /> 21 <necessite id="paypal" version="[0.1.4;]" /> 22 22 </plugin>
Note: See TracChangeset
for help on using the changeset viewer.