/** * Redeclare _saveRpOrder() rate detail saving added * * @param order $order * @param int $orderId */ protected function _saveRpOrder(order $order, $orderId) { parent::_saveRpOrder($order, $orderId); $this->_saveRateDetails($orderId); }
public function pre_confirmation_check() { if (!rpGlobals::hasPostEntry('rp-account-number') || rpData::betterEmpty(rpGlobals::getPostEntry('rp-account-number'))) { $this->error['ACCOUNT_NUMBER'] = 'MISSING'; } if (strtoupper(substr(rpGlobals::getPostEntry('rp-account-number'), 0, 2)) !== 'DE') { if (!rpGlobals::hasPostEntry('rp-sort-code') || rpData::betterEmpty(rpGlobals::getPostEntry('rp-sort-code'))) { $this->error['SORT_CODE'] = 'MISSING'; } } if (strtoupper(substr(rpGlobals::getPostEntry('rp-account-number'), 0, 2)) === 'DE') { if (strlen(rpGlobals::getPostEntry('rp-account-number')) !== 22) { $this->error['ACCOUNT_NUMBER'] = 'DE_WRONG_LENGTH'; } if (!is_numeric(substr(rpGlobals::getPostEntry('rp-account-number'), 2))) { $this->error['ACCOUNT_NUMBER'] = 'IBAN_INVALID'; } } if (strtoupper(substr(rpGlobals::getPostEntry('rp-account-number'), 0, 2)) === 'AT') { if (strlen(rpGlobals::getPostEntry('rp-account-number')) !== 20) { $this->error['ACCOUNT_NUMBER'] = 'AT_WRONG_LENGTH'; } if (!is_numeric(substr(rpGlobals::getPostEntry('rp-account-number'), 2))) { $this->error['ACCOUNT_NUMBER'] = 'IBAN_INVALID'; } } if (is_numeric(substr(rpGlobals::getPostEntry('rp-account-number'), 0, 2))) { if (!is_numeric(rpGlobals::getPostEntry('rp-sort-code'))) { $this->error['SORT_CODE'] = 'NOT_NUMERIC'; } if (strlen(rpGlobals::getPostEntry('rp-sort-code')) !== 8) { $this->error['SORT_CODE'] = 'WRONG_LENGTH'; } if (!is_numeric(rpGlobals::getPostEntry('rp-account-number'))) { $this->error['ACCOUNT_NUMBER'] = 'KONTO_NR_NOT_NUMERIC'; } } if (!is_numeric(substr(rpGlobals::getPostEntry('rp-account-number'), 0, 2))) { if (is_numeric(rpGlobals::getPostEntry('rp-sort-code')) && !rpData::betterEmpty(rpGlobals::getPostEntry('rp-sort-code'))) { $this->error['SORT_CODE'] = 'IBAN_AND_BLZ_PROVIDED'; } } if (!rpGlobals::hasPostEntry('rp-account-holder') || rpData::betterEmpty(rpGlobals::getPostEntry('rp-account-holder'))) { $this->error['ACCOUNT_HOLDER'] = 'MISSING'; } if (!rpGlobals::hasPostEntry('rp-bank-name') || rpData::betterEmpty(rpGlobals::getPostEntry('rp-bank-name'))) { $this->error['BANK_NAME'] = 'MISSING'; } if (empty($this->error)) { $this->setBankData($_POST); } parent::pre_confirmation_check(); }
public function pre_confirmation_check() { if ($this->_isBankAccountNeeded()) { $accountOwner = trim(Globals::getPostEntry('ratepay_lastschrift_bankaccountowner')); $accountNumber = strtoupper(trim(Globals::getPostEntry('ratepay_lastschrift_bankaccountnumber'))); $bankCode = strtoupper(trim(Globals::getPostEntry('ratepay_lastschrift_bankcode'))); $bankName = trim(Globals::getPostEntry('ratepay_lastschrift_bankname')); $conditions = Globals::getPostEntry('ratepay_lastschrift_conditions'); if ($this->_checkBankAccountOwner($accountOwner)) { $bankAccount['owner'] = $accountOwner; } else { $this->error['ACCOUNTOWNER'] = 'MISSING'; } switch ($this->_checkBankAccountNumber($accountNumber)) { case 'IBAN': $bankAccount['iban'] = $accountNumber; break; case 'ACCNR': $bankAccount['bank-account-number'] = $accountNumber; break; case 'MISSING': $this->error['ACCOUNTNUMBER'] = 'MISSING'; break; case 'WRONG_COUNTRY': $this->error['ACCOUNTNUMBER'] = 'WRONG_COUNTRY'; break; case 'INVALID': $this->error['ACCOUNTNUMBER'] = 'INVALID'; break; } switch ($this->_checkBankCode($bankCode)) { case 'BIC': $bankAccount['bic-swift'] = $bankCode; break; case 'BLZ': $bankAccount['bank-code'] = $bankCode; break; case 'MISSING': if (!$bankAccount['iban'] || $this->country != 'DE') { $this->error['BANKCODE'] = 'MISSING'; } break; case 'INVALID': $this->error['BANKCODE'] = 'INVALID'; break; } if ($this->_checkBankName($bankName)) { $bankAccount['bank-name'] = $bankName; } else { $this->error['BANKNAME'] = 'MISSING'; } if ($bankAccount['bank-account-number'] && $bankAccount['bic-swift'] || $bankAccount['iban'] && $bankAccount['bank-code']) { $this->error['BANKACCOUNTS'] = 'INVALID'; } if ($bankAccount) { $this->setBankData($bankAccount); } if (!$this->_checkBankConditions($conditions)) { $this->error['CONDITIONS'] = 'MISSING'; } } parent::pre_confirmation_check(); }
public function selection() { global $order; $display = parent::selection(); if (!is_null($display)) { $minVarName = 'min' . ucfirst(strtolower($order->billing['country']['iso_code_2'])); $maxVarName = 'max' . ucfirst(strtolower($order->billing['country']['iso_code_2'])); $privacy = ''; $privacyConstant = 'MODULE_PAYMENT_' . strtoupper($this->code) . '_RATEPAY_PRIVACY_URL_' . strtoupper($order->billing['country']['iso_code_2']); if (defined($privacyConstant)) { $privacy = constant($privacyConstant); } $smarty = new Smarty(); /* BEGINN OF DEVICE FINGERPRINT CODE */ if (!rpSession::getRpSessionEntry('RATEPAY_DFP_TOKEN') && rpDb::getRpDfpSId()) { $ratepay_dfp_token = md5($order->info['total'] . microtime()); rpSession::setRpSessionEntry('RATEPAY_DFP_TOKEN', $ratepay_dfp_token); $smarty->assign('RATEPAY_DFP_TOKEN', $ratepay_dfp_token); $smarty->assign('RATEPAY_DFP_SNIPPET_ID', rpDb::getRpDfpSId()); } /* END OF DEVICE FINGERPRINT CODE */ //CS Aenderung des Value von $display['module'] fuer die Ausgabe $display['module'] = $this->public_title; $display['fields'][] = array('title' => '', 'field' => $smarty->fetch(CURRENT_TEMPLATE . '/module/ratepay_rechnung.html')); } return $display; }