Merge commit 'origin/fusionax' into account
[platal.git] / modules / payment / money / paypal.inc.php
index 08d83f4..231c86d 100644 (file)
@@ -43,10 +43,8 @@ class PayPal
         global $globals, $platal;
 
         $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'));
-        $name = $req->fetchOneCell();
+        $user = S::user();
+        $name = $user->lastName();
 
         $roboturl = str_replace("https://","http://",$globals->baseurl)
                   . '/' . $platal->ns . "payment/paypal_return/" . S::v('uid')
@@ -71,6 +69,7 @@ class PayPal
             'email'      => S::user()->bestEmail()
         );
 
+        // XXX: waiting for port of adresses.
         $res = XDB::query(
                 "SELECT  a.text, l.name AS city, a.postalCode AS zip, a.countryiId AS country,
                          IF(t1.display_tel != '', t1.display_tel, t2.display_tel) AS night_phone_b