projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adds notion of donation for payments.
[platal.git]
/
modules
/
payment
/
money
/
bplccyberplus.inc.php
diff --git
a/modules/payment/money/bplccyberplus.inc.php
b/modules/payment/money/bplccyberplus.inc.php
index
061d3ce
..
28f69aa
100644
(file)
--- a/
modules/payment/money/bplccyberplus.inc.php
+++ b/
modules/payment/money/bplccyberplus.inc.php
@@
-55,6
+55,11
@@
class BPLCCyberPlus
// }}}
// {{{ function form()
// }}}
// {{{ function form()
+ private static function replaceNonAlpha($string)
+ {
+ return trim(preg_replace('/\s\s+/', ' ', preg_replace('/[^a-zA-Z0-9]/', ' ', $string)));
+ }
+
function prepareform($pay)
{
global $globals, $platal;
function prepareform($pay)
{
global $globals, $platal;
@@
-76,7
+81,7
@@
class BPLCCyberPlus
$this->infos['client'] = Array(
'vads_cust_email' => S::user()->bestEmail(),
'vads_cust_id' => S::v('uid'),
$this->infos['client'] = Array(
'vads_cust_email' => S::user()->bestEmail(),
'vads_cust_id' => S::v('uid'),
- 'vads_cust_name' =>
replace_accent(S::user()->fullName()
));
+ 'vads_cust_name' =>
substr(self::replaceNonAlpha(replace_accent(S::user()->shortName())), 0, 127
));
$this->infos['commande'] = Array(
'vads_amount' => $this->val,
'vads_currency' => '978', # Euro
$this->infos['commande'] = Array(
'vads_amount' => $this->val,
'vads_currency' => '978', # Euro
@@
-84,7
+89,7
@@
class BPLCCyberPlus
'vads_trans_date' => $trans_date,
'vads_trans_id' => $trans_id,
'vads_order_id' => $fullref,
'vads_trans_date' => $trans_date,
'vads_trans_id' => $trans_id,
'vads_order_id' => $fullref,
- 'vads_order_info' =>
Env::v('comment'
));
+ 'vads_order_info' =>
substr(self::replaceNonAlpha(replace_accent(Env::v('comment'))), 0, 255
));
$this->infos['divers'] = Array(
'vads_version' => 'V2',
'vads_ctx_mode' => $globals->money->cyperplus_prod,
$this->infos['divers'] = Array(
'vads_version' => 'V2',
'vads_ctx_mode' => $globals->money->cyperplus_prod,