* @return object
* @static
*/
- public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = false) {
+ public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
if (!empty($paymentProcessor['id'])) {
$cacheKey = $paymentProcessor['id'];
}
$hashme = "$sha1hash.{$this->_getParam('secret')}";
$sha1hash = sha1($hashme);
-
// Generate the request xml that is send to Realex Payments.
$request_xml = "<request type='auth' timestamp='{$this->_getParam('timestamp')}'>
<merchantid>{$this->_getParam('merchant_ref')}</merchantid>
* Format the params from the form ready for sending to Realex. Also perform some validation
*/
public function setRealexFields(&$params) {
- if ((int)$params['amount'] <= 0) {
+ if ((int) $params['amount'] <= 0) {
return self::error(9001, ts('Amount must be positive'));
}
$this->_setParam('currency', $config->defaultCurrency);
// Format the expiry date to MMYY
- $expmonth = (string)$params['month'];
+ $expmonth = (string) $params['month'];
$expmonth = (strlen($expmonth) === 1) ? '0' . $expmonth : $expmonth;
- $expyear = substr((string)$params['year'], 2, 2);
+ $expyear = substr((string) $params['year'], 2, 2);
$this->_setParam('exp_date', $expmonth . $expyear);
if (isset($params['credit_card_start_date']) && (strlen($params['credit_card_start_date']['M']) !== 0) &&
(strlen($params['credit_card_start_date']['Y']) !== 0)
) {
- $startmonth = (string)$params['credit_card_start_date']['M'];
+ $startmonth = (string) $params['credit_card_start_date']['M'];
$startmonth = (strlen($startmonth) === 1) ? '0' . $startmonth : $startmonth;
- $startyear = substr((string)$params['credit_card_start_date']['Y'], 2, 2);
+ $startyear = substr((string) $params['credit_card_start_date']['Y'], 2, 2);
$this->_setParam('start_date', $startmonth . $startyear);
}