X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fpayment%2Fmoney%2Fpaypal.inc.php;h=6ae107a78821c72e26cfadf15d50acd9b3ea90cf;hb=12262f1306059765d8625a6752364679c8625d31;hp=d5c2d9f2004e008f6ec1e820682180825c8b1c56;hpb=43b773cda738a90e97f0aba77bf9ab28f11778a5;p=platal.git diff --git a/modules/payment/money/paypal.inc.php b/modules/payment/money/paypal.inc.php index d5c2d9f..6ae107a 100644 --- a/modules/payment/money/paypal.inc.php +++ b/modules/payment/money/paypal.inc.php @@ -1,6 +1,6 @@ urlform = 'https://' . $globals->money->paypal_site . '/cgi-bin/webscr'; $user = S::user(); - $name = $user->lastName(); $roboturl = str_replace("https://","http://",$globals->baseurl) . '/' . $platal->ns . "payment/paypal_return/" . S::v('uid') . "?comment=" . urlencode(Env::v('comment')); - $this->infos = array(); - - $this->infos['commercant'] = array( - 'business' => $globals->money->paypal_compte, - 'rm' => 2, - 'return' => $roboturl, - 'cn' => 'Commentaires', - 'no_shipping' => 1, - 'cbt' => empty($GLOBALS['IS_XNET_SITE']) ? - 'Revenir sur polytechnique.org.' : - 'Revenir sur polytechnique.net.' + $this->infos = array( + 'commercant' => array( + 'business' => $globals->money->paypal_compte, + 'rm' => 2, + 'return' => $roboturl, + 'cn' => 'Commentaires', + 'no_shipping' => 1, + 'cbt' => empty($GLOBALS['IS_XNET_SITE']) ? 'Revenir sur polytechnique.org.' : 'Revenir sur polytechnique.net.' + ) ); $info_client = array( - 'first_name' => S::v('prenom'), - 'last_name' => $name, - 'email' => S::user()->bestEmail() + 'first_name' => $user->firstName(), + 'last_name' => $user->lastName(), + 'email' => $user->bestEmail() ); - $res = XDB::query("SELECT pa.text, gl.name AS city, pa.postalCode AS zip, pa.countryiId AS country, + $res = XDB::query("SELECT pa.text, gl.name AS city, pa.postalCode AS zip, pa.countryId AS country, IF(pp1.display_tel != '', pp1.display_tel, pp2.display_tel) AS night_phone_b FROM profile_addresses AS pa LEFT JOIN profile_phones AS pp1 ON (pp1.pid = pa.pid AND pp1.link_type = 'address' - AND pp1.link_id = pa.adrid) + AND pp1.link_id = pa.id) LEFT JOIN profile_phones AS pp2 ON (pp2.pid = pa.pid AND pp2.link_type = 'user' AND pp2.link_id = 0) LEFT JOIN geoloc_localities AS gl ON (gl.id = pa.localityId) WHERE pa.pid = {?} AND FIND_IN_SET('current', pa.flags) LIMIT 1", - S::i('pid')); + $user->profile()->id()); $this->infos['client'] = array_map('replace_accent', array_merge($info_client, $res->fetchOneAssoc())); list($this->infos['client']['address1'], $this->infos['client']['address2']) = explode("\n", Geocoder::getFirstLines($this->infos['client']['text'],