/** * Retrieve the encoded bankdata * * @return array */ public function getBankData() { $customerId = (string) $_SESSION['customer_id']; $piEncryption = new Pi_Util_Encryption_XtCommerceEncryption(); if (!empty($customerId)) { $bankdata = $piEncryption->loadBankdata($customerId); } else { $bankdata = array('owner' => rpSession::getRpSessionEntry('rp-account-holder'), 'accountnumber' => rpSession::getRpSessionEntry('rp-account-number'), 'bankcode' => rpSession::getRpSessionEntry('rp-sort-code'), 'bankname' => rpSession::getRpSessionEntry('rp-bank-name')); } return $bankdata; }
/** * Save rate details to the db * * @param int$orderId */ protected function _saveRateDetails($orderId) { $data = array('order_number' => $orderId, 'total_amount' => rpSession::getRpSessionEntry('ratepay_rate_total_amount'), 'amount' => rpSession::getRpSessionEntry('ratepay_rate_amount'), 'interest_amount' => rpSession::getRpSessionEntry('ratepay_rate_interest_amount'), 'service_charge' => rpSession::getRpSessionEntry('ratepay_rate_service_charge'), 'annual_percentage_rate' => rpSession::getRpSessionEntry('ratepay_rate_annual_percentage_rate'), 'monthly_debit_interest' => rpSession::getRpSessionEntry('ratepay_rate_monthly_debit_interest'), 'number_of_rates' => rpSession::getRpSessionEntry('ratepay_rate_number_of_rates'), 'rate' => rpSession::getRpSessionEntry('ratepay_rate_rate'), 'last_rate' => rpSession::getRpSessionEntry('ratepay_rate_last_rate')); rpDb::setRatepayRateDetails($data); }
/** * Is called when the order is saved to the db * here we send the PAYMENT_CONFIRM call to RatePAY */ public function after_process() { global $insert_id; $transactionId = rpSession::getRpSessionEntry('transactionId'); $transactionShortId = rpSession::getRpSessionEntry('transactionShortId'); if (!empty($transactionId)) { $result = $this->_paymentConfirm($transactionId, $transactionShortId, $insert_id); if (!array_key_exists('error', $result)) { $this->_saveRpOrder(rpSession::getRpSessionEntry('rpOrder'), $insert_id); $this->_setRatepayOrderPaid($insert_id); rpSession::cleanRpSession(); } else { rpSession::cleanRpSession(); $error = urlencode(constant(strtoupper($this->code) . '_ERROR')); xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . $error, 'SSL')); } } }
<td> <?php if (!is_null(rpSession::getRpSessionEntry('message'))) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="<?php echo rpSession::getRpSessionEntry('message_css_class'); ?> "> <img border="0" title="" alt="" src="images/icons/error.gif"> <?php echo rpSession::getRpSessionEntry('message'); ?> </td> </tr> </table> </td> </tr> </table> <?php } ?> <?php if ($order->info['payment_method'] == 'ratepay_rate') { ?> <?php $details = rpDb::getRatepayRateDetails($orderId);
/** * Retrieve paymentInfo model * * @param order $order * @param int $orderId * @return rpPaymentInfo */ public static function getPaymentInfoModel(order $order, $orderId = null, array $post = array(), $subType = false) { $paymentInfo = new rpPaymentInfo(); $paymentInfo->setCurrency($order->info['currency']); $paymentInfo->setMethod(rpData::getRpPaymentMethod($order->info['payment_method'])); if ($subType != 'credit' && $subType != 'return' && $subType != 'cancellation') { $paymentInfo->setAmount(rpData::getPaymentAmount($order, $orderId, $post)); if ($order->info['payment_method'] == 'ratepay_rate') { if (is_null($orderId)) { $paymentInfo->setDebitType('BANK-TRANSFER')->setInstallmentAmount(rpSession::getRpSessionEntry('ratepay_rate_rate'))->setInstallmentNumber(rpSession::getRpSessionEntry('ratepay_rate_number_of_rates'))->setInterestRate(rpSession::getRpSessionEntry('ratepay_rate_interest_rate'))->setLastInstallmentAmount(rpSession::getRpSessionEntry('ratepay_rate_last_rate'))->setPaymentFirstDay(rpSession::getRpSessionEntry('ratepay_payment_firstday')); } else { $details = rpDb::getRatepayRateDetails($orderId); $paymentInfo->setDebitType('BANK-TRANSFER')->setInstallmentAmount($details['rate'])->setInstallmentNumber($details['number_of_rates'])->setInterestRate($details['interest_amount'])->setLastInstallmentAmount($details['last_rate'])->setPaymentFirstDay($details['payment_firstday']); } } } return $paymentInfo; }
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; }
/** * Is RatePAY disabled * * @return boolean */ public static function isRatepayAvailable() { return !rpSession::getRpSessionEntry('disabled'); }
/** * Insert ratepay order data * * @param order $order * @param int $orderId */ public static function setRatepayOrderData(order $order, $orderId) { $payment = $order->info['payment_method']; $sql = "INSERT INTO " . $payment . "_orders (" . "order_number, " . "transaction_id, " . "transaction_short_id, " . "descriptor," . "customers_birth," . "fax," . "customers_country_code," . "gender" . ") VALUES ('" . xtc_db_input($orderId) . "', '" . xtc_db_input(rpSession::getRpSessionEntry('transactionId')) . "', '" . xtc_db_input(rpSession::getRpSessionEntry('transactionShortId')) . "','" . xtc_db_input(rpSession::getRpSessionEntry('descriptor')) . "','" . xtc_db_input(rpDb::getCustomersDob(null, rpSession::getSessionEntry('customer_id'))) . "','" . xtc_db_input(rpDb::getCustomersFax(null, rpSession::getSessionEntry('customer_id'))) . "','" . xtc_db_input(rpSession::getRpSessionEntry('customers_country_code')) . "','" . xtc_db_input(rpDb::getXtCustomerEntry(rpSession::getSessionEntry('customer_id'), 'customers_gender')) . "')"; xtc_db_query($sql); self::setRpOrderItems($order, $orderId, $payment); }
/** * This method get all needed data and has to be rewritten * Optional - Will only be used, if you want to show the result on another page (include_result.html) * Needs to return an array with the indexes total_amount, amount, interest_amount, service_charge, annual_percentage_rate, monthly_debit_interest, number_of_rates , rate, lastRate * @return array */ public function getData() { return array('total_amount' => rpSession::getRpSessionEntry('ratepay_rate_total_amount'), 'amount' => rpSession::getRpSessionEntry('ratepay_rate_amount'), 'interest_rate' => rpSession::getRpSessionEntry('ratepay_rate_interest_rate'), 'interest_amount' => rpSession::getRpSessionEntry('ratepay_rate_interest_amount'), 'service_charge' => rpSession::getRpSessionEntry('ratepay_rate_service_charge'), 'annual_percentage_rate' => rpSession::getRpSessionEntry('ratepay_rate_annual_percentage_rate'), 'monthly_debit_interest' => rpSession::getRpSessionEntry('ratepay_rate_monthly_debit_interest'), 'number_of_rates' => rpSession::getRpSessionEntry('ratepay_rate_number_of_rates'), 'rate' => rpSession::getRpSessionEntry('ratepay_rate_rate'), 'last_rate' => rpSession::getRpSessionEntry('ratepay_rate_last_rate'), 'payment_firstday' => rpSession::getRpSessionEntry('ratepay_payment_firstday')); }