<?php
/***************************************************************************
- * Copyright (C) 2003-2008 Polytechnique.org *
+ * Copyright (C) 2003-2014 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
function BPLCCyberPlus($val)
{
// Improvement: number of digits after the coma might depend from the currency.
- $this->val = 100 * strtr(sprintf("%.02f", (float)$val), '.', ',');
+ $this->val = 100 * strtr($val, ',', '.');
}
// }}}
$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/";
'vads_url_return' => $pay->url ? $pay->url : $globals->baseurl . '/' . $platal->ns);
$this->infos['client'] = Array(
'vads_cust_email' => $user->bestEmail(),
- 'vads_cust_id' => S::v('uid'),
+ '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,
$api = 'BPLCCyberPlus';
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
?>