Send ascii to payment sites in order to avoid annoying encoding issues
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 5 Oct 2007 21:24:55 +0000 (23:24 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 5 Oct 2007 21:24:55 +0000 (23:24 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
modules/payment/money/cyberpaiement.inc.php
modules/payment/money/paypal.inc.php

index 11e7ad8..6d2b5f6 100644 (file)
@@ -68,11 +68,11 @@ class CyberPayment
             'CHAMP004' => "Polytechnique.org",
             'CHAMP005' => $roboturl,
             'CHAMP006' => "Polytechnique.org",
-            'CHAMP007' => $globals->baseurl . '/' . $platal->ns,
+            'CHAMP007' => $pay->url ? $pay->url : $globals->baseurl . '/' . $platal->ns,
             'CHAMP008' => $pay->mail);
         $this->infos['client'] = Array(
-            'CHAMP100' => $name,
-            'CHAMP101' => S::v('prenom'),
+            'CHAMP100' => replace_accent($name),
+            'CHAMP101' => replace_accent(S::v('prenom')),
             'CHAMP102' => '.',
             'CHAMP103' => '.',
             'CHAMP104' => S::v('bestalias').'@' . $globals->mail->domain,
index 5f454a3..ffd561f 100644 (file)
@@ -53,8 +53,8 @@ class PayPal
 
         $this->urlform = 'https://'.$globals->money->paypal_site.'/cgi-bin/webscr';
         $req = XDB::query("SELECT  IF(nom_usage!='', nom_usage, nom) AS nom
-                          FROM  auth_user_md5
-                          WHERE  user_id = {?}",S::v('uid'));
+                             FROM  auth_user_md5
+                            WHERE  user_id = {?}",S::v('uid'));
         $name = $req->fetchOneCell();
 
         $roboturl = str_replace("https://","http://",$globals->baseurl)
@@ -86,20 +86,20 @@ class PayPal
           LEFT JOIN tels        AS t ON (t.uid = a.uid AND t.adrid = a.adrid)
               WHERE q.user_id = {?}
               LIMIT 1", S::v('uid'));
-            $this->infos['client'] = array_merge($info_client, $res->fetchOneAssoc());
+        $this->infos['client'] = array_map('replace_accent', array_merge($info_client, $res->fetchOneAssoc()));
 
-            // on constuit la reference de la transaction
-            require_once 'xorg.misc.inc.php';
-            $prefix = ($pay->flags->hasflag('unique')) ? str_pad("",15,"0") : rand_url_id();
-            $fullref = substr("$prefix-xorg-{$pay->id}",-15);
+        // on constuit la reference de la transaction
+        require_once 'xorg.misc.inc.php';
+        $prefix = ($pay->flags->hasflag('unique')) ? str_pad("",15,"0") : rand_url_id();
+        $fullref = substr("$prefix-xorg-{$pay->id}",-15);
 
-            $this->infos['commande'] = Array(
-                'item_name' => $pay->text,
-                'amount'  => $this->val_number,
-                'currency_code' => 'EUR',
-                'custom'  => $fullref);
+        $this->infos['commande'] = Array(
+            'item_name' => replace_accent($pay->text),
+            'amount'  => $this->val_number,
+            'currency_code' => 'EUR',
+            'custom'  => $fullref);
 
-            $this->infos['divers'] = Array('cmd' => '_xclick');
+        $this->infos['divers'] = Array('cmd' => '_xclick');
     }
 
     // }}}