X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fpayment%2Fmoney%2Fbplccyberplus.inc.php;h=46bf7f011e90f5928c4ee36b0aaf10080394e330;hb=1c02b178e88ecb8734929003ee28677f63af31f5;hp=f0b40e48aa8af9e74ab1f426eb8325b7a7af8797;hpb=e22ff176d83e1f4ffd866e6ad928ee247906c6a5;p=platal.git diff --git a/modules/payment/money/bplccyberplus.inc.php b/modules/payment/money/bplccyberplus.inc.php index f0b40e4..46bf7f0 100644 --- a/modules/payment/money/bplccyberplus.inc.php +++ b/modules/payment/money/bplccyberplus.inc.php @@ -60,17 +60,17 @@ class BPLCCyberPlus return trim(preg_replace('/\s\s+/', ' ', preg_replace('/[^a-zA-Z0-9]/', ' ', $string))); } - function prepareform($pay) + function prepareform($pay, $user) { global $globals, $platal; $log = S::v('log'); // Transaction's reference computation. - $prefix = ($pay->flags->hasflag('unique')) ? str_pad("",15,"0") : rand_url_id(); + $prefix = rand_url_id(); $fullref = substr("$prefix-{$pay->id}",-12); // FIXME : check for duplicates $ts = time(); - $trans_date = date("YmdHis", $ts); - $trans_id = date("His", $ts); // FIXME : check for duplicates + $trans_date = gmdate("YmdHis", $ts); + $trans_id = gmdate("His", $ts); // FIXME : check for duplicates // Form's content. $this->urlform = "https://systempay.cyberpluspaiement.com/vads-payment/"; @@ -79,9 +79,9 @@ class BPLCCyberPlus 'vads_return_mode' => 'NONE', 'vads_url_return' => $pay->url ? $pay->url : $globals->baseurl . '/' . $platal->ns); $this->infos['client'] = Array( - 'vads_cust_email' => S::user()->bestEmail(), - 'vads_cust_id' => S::v('uid'), - 'vads_cust_name' => substr(self::replaceNonAlpha(replace_accent(S::user()->shortName())), 0, 127)); + 'vads_cust_email' => $user->bestEmail(), + 'vads_cust_id' => $user->id(), + 'vads_cust_name' => substr(self::replaceNonAlpha(replace_accent($user->shortName())), 0, 127)); $this->infos['commande'] = Array( 'vads_amount' => $this->val, 'vads_currency' => '978', # Euro