Bugfix paiement par paypal express : il y a une etape de confirmation du paiement a retour de paypal express qu'il faut gerer. On insere dans charger() le formulaire de confirmation si toutes les conditions sont requises (presence dans l'URL des bons arguments, en $_SESSION de la transaction et matching avec le formulaire affiche)

svn/root/tags/v1.1.3
cedric@yterium.com 9 years ago
parent 1c9899e0f6
commit 90db651e5a

@ -4,3 +4,4 @@
.formulaire_paiement .boutons { border: 0;margin: 0;text-align: left;padding:0;}
.formulaire_paiement .payer_mode .boutons form,
.formulaire_paiement .payer_mode .boutons form div {display: inline-block;}
.formulaire_paiement #confirm_order {padding:0;margin:0;}

@ -11,6 +11,50 @@
if (!defined('_ECRIRE_INC_VERSION')) return;
/**
* Rediriger vers le checkout apres un paiement qui demande confirmation
* (type paypal express)
* on saute l'etape de confirmation et on va direct au paiement
*
* @param $flux
* @return mixed
*/
function formidablepaiement_formulaire_charger($flux){
// gerer le retour paiement avec demande de confirmation
if (_request('confirm')
AND $flux['args']['form']=='formidable'
AND $id = $flux['args']['args'][0]
AND isset($_SESSION['id_transaction'])
AND $id_transaction = $_SESSION['id_transaction']
AND $checkout = _request('checkout')
AND $trans = sql_fetsel("*","spip_transactions","id_transaction=".intval($id_transaction))){
// verifier que la transaction en session est bien associee a ce formulaire
$id_formulaire = formidable_id_formulaire($id);
$parrain = "form{$id_formulaire}:";
if (strncmp($trans['parrain'],$parrain,strlen($parrain))==0){
// on reaffiche le modele de paiement qui demande confirmation
$form = recuperer_fond("modeles/formidablepaiement-transaction",array('id_transaction'=>$id_transaction,'transaction_hash'=>$trans['transaction_hash']));
$flux['data'] =
"<div class='formulaire_spip formulaire_paiement'>"
. $form
. "</div>";
$css = find_in_path("css/formidablepaiement.css");
$flux['data'] .= "<style type='text/css'>@import url('".$css."');</style>";
// Alternative par define ?
// on redirige directement vers le paiment (url de checkout)
// car on a rien a reafficher
#include_spip('inc/headers');
#redirige_par_entete($checkout);
}
}
return $flux;
}
/**
* Mise en forme du formulaire de paiement post-saisie
*

@ -1,7 +1,7 @@
<paquet
prefix="formidablepaiement"
categorie="communication"
version="1.0.2"
version="1.0.3"
etat="stable"
compatibilite="[3.0.0;3.0.*]"
logo="prive/themes/spip/images/formidablepaiement-64.png"
@ -15,6 +15,7 @@
<licence>GNU/GPL</licence>
<pipeline nom="formulaire_charger" inclure="formidablepaiement_pipelines.php" />
<pipeline nom="formulaire_fond" inclure="formidablepaiement_pipelines.php" />
<pipeline nom="bank_traiter_reglement" inclure="formidablepaiement_pipelines.php" />
<pipeline nom="affiche_enfants" inclure="formidablepaiement_pipelines.php" />

Loading…
Cancel
Save