function add() { global $mainframe, $Itemid, $now; $userId = JRequest::getVar('userId', 0); $mMember = $this->getModel('member'); $tMember = $mMember->table; $tUser = $this->getModel('user')->table; $tUser->load($userId); $tEvt = $this->getModel('event')->table; $tEvt->load($tUser->eventId); $eventId = $tUser->eventId; $memtot = DT_Session::get('register.User.memtot'); if ($memtot >= $tEvt->max_group_size) { $mainframe->redirect("index.php?option=com_dtregister&controller=member&userId=" . $userId . "&Itemid=" . $Itemid, JText::_('DT_MAX_GROUP_SIZE_REACHED')); } if (isset($_POST['formsubmit'])) { $min = $tEvt->min_group_size == "" ? 2 : $tEvt->min_group_size; $data = $_POST['Member']; $data['fields'] = JRequest::getVar('Field', array(), null, 'array'); $data['created'] = $now->toMySQL(); $members = DT_Session::get('register.User.members'); $members[] = $data; DT_Session::set('register.User.members', $members); $memtot = DT_Session::get('register.User.memtot'); $memtot++; DT_Session::set('register.User.memtot', $memtot); $mainframe->redirect("index.php?option=com_dtregister&controller=member&userId=" . $userId . "&Itemid=" . $Itemid); pr($tUser->TableFee); prd($fee); die; } $type = 'M'; $this->view->assign('header_eventId', $eventId); $this->view->assign('form', $tUser->TableEvent->form($type, array(), false, 'frmcart', false)); $this->view->assign('userId', $userId); $this->display(); }
function process() { global $currency_code, $cardtype; if ($currency_code == "") { $currency_code = 'USD'; } switch ($cardtype[$this->cardtype]) { case 'AmericanExpress': $this->cardtype = 'Amex'; break; default: $this->cardtype = $cardtype[$this->cardtype]; break; } $card_expiry_array = explode("/", $this->x_exp_date); $firstName = urlencode($this->firstname); $lastName = urlencode($this->lastname); $creditCardType = urlencode($this->cardtype); $creditCardNumber = urlencode($this->x_card_num); $expDateMonth = urlencode($card_expiry_array[0]); $expDateYear = urlencode($card_expiry_array[1]); $cvv2Number = urlencode($this->x_card_code); $address1 = urlencode($this->address); $address2 = ''; $city = urlencode($this->city); $state = urlencode($this->state); $zip = isset($this->zipcode) ? urlencode($this->zipcode) : ''; $amount = urlencode($this->cart->getAmount()); $currencyCode = urlencode($currency_code); $paymentAction = urlencode("Sale"); $nvpRecurring = ''; $methodToCall = 'DoDirectPayment'; $nvpstr = '&PAYMENTACTION=' . $paymentAction . '&AMT=' . $amount . '&CREDITCARDTYPE=' . $creditCardType . '&ACCT=' . $creditCardNumber . '&EXPDATE=' . $expDateMonth . $expDateYear . '&CVV2=' . $cvv2Number . '&FIRSTNAME=' . $firstName . '&LASTNAME=' . $lastName . '&STREET=' . $address1 . '&CITY=' . $city . '&STATE=' . $state . '&ZIP=' . $zip . '&COUNTRYCODE=' . $this->country . '&CURRENCYCODE=' . $currencyCode . '&IPADDRESS=' . urlencode($_SERVER['REMOTE_ADDR']) . ''; //$nvpstr='&PAYMENTACTION=Sale&AMT=2&CREDITCARDTYPE=Visa&ACCT=4340325581348705&EXPDATE=082019&CVV2=123&FIRSTNAME=Lucky&LASTNAME=Litt&STREET=address&CITY=city&STATE=state&ZIP=12345&COUNTRYCODE=US&CURRENCYCODE=USD&IPADDRESS='.urlencode($_SERVER['REMOTE_ADDR']).''; //pr($nvpstr); $resArray = $this->hash_call($methodToCall, $nvpstr); $ack = strtoupper($resArray["ACK"]); // pr($resArray); if (isset($resArray['TRANSACTIONID']) && $resArray['TRANSACTIONID'] != "") { $this->transactionId = $res['TRANSACTIONID']; DT_Session::set('register.payment.transactionId', $this->transactionId); return true; } else { echo JText::_('DT_PAYPAL_PRO_FAILURE') . '<br /><br />'; return false; } }
function success() { $this->transactionId = $this->payEway->get_transaction_detail(); if ($this->transactionId === false) { return false; } DT_Session::set('register.payment.transactionId', $this->transactionId); return true; }
function notify() { if ($_REQUEST['_type'] == 'new-order-notification') { $this->transactionId = $_REQUEST['google-order-number']; DT_Session::set('register.payment.transactionId', $this->transactionId); return true; } else { return false; } }
function process() { global $currency_code, $Itemid; $this->sCurrency = $currency_code; $this->setOrderId($this->confirmNum); $session_id = $this->saveSession(); DT_Session::set('register.payment.transactionId', $this->sOrderId); $mosConfig_live_site = JURI::root(false); $urlSuccess = "{$mosConfig_live_site}components/com_dtregister/success.php?return={$session_id}&Itemid={$Itemid}&task=restore"; $urlCancel = "{$mosConfig_live_site}components/com_dtregister/success.php?return={$session_id}&Itemid={$Itemid}&task=cancel"; $urlError = "{$mosConfig_live_site}index.php?option=com_dtregister&task=error&controller=payment&Itemid={$Itemid}"; $this->setUrlCancel($urlCancel); $this->setUrlSuccess($urlSuccess); $this->setUrlError($urlError); $this->setAmount($this->cart->getAmount()); $this->setOrderDescription($this->description); echo $this->createForm(); }
function success() { global $mainframe, $Itemid, $now; $ret = $this->validate(); if ($ret) { $id = JRequest::getVar('order_id', 0); $this->transactionId = JRequest::getVar('transaction_id'); DT_Session::set('register.payment.transactionId', $this->transactionId); $database =& JFactory::getDBO(); $data = $_SESSION; $sql = "update #__dtregister_session set `data`= " . $database->Quote(serialize($data)) . " where id=" . $id; $database->setQuery($sql); $database->query(); $database->getErrorMsg(); return true; } else { return false; } }
function save() { global $mainframe; $row = $this->getModel('event')->table; $data = JRequest::getVar('data'); $error = false; $error = false; if ($data['event']['slabId'] != "") { $row->load($data['event']['slabId']); if (!$row->validDateChange($data)) { } if (!$row->comparerepeat($data) && $row->repetition !== false) { $this->error = JText::_("DT_REPTITIONS_NOT_VALID"); $error = true; //$error = false ; } } if ($error) { DT_Session::set('event.data', $data); $files = JRequest::getVar('event_files', null, 'files', 'array'); DT_Session::set('event.event_files', $files); $this->view->setLayout('warning'); $this->view->assign('message', JText::_("DT_REPEAT_DELETE_WARNING")); $this->view->display(); } else { if ($row->save($data) !== false) { global $eventListOrder; $conf = DtrModel::getInstance('config', 'DtregisterModel'); $conf->updateEventorder($eventListOrder); } else { $mainframe->redirect("index.php?option=com_dtregister&controller=event&task=edit&cid[]=" . $row->slabId, $row->error); } $mainframe->redirect("index.php?option=com_dtregister&controller=event"); } }
function success() { $id = JRequest::getVar('transaction_id', 0); $this->checkPayment($id); if (!$this->paid_status) { return false; } if ($id) { $this->transactionId = JRequest::getVar('transaction_id'); DT_Session::set('register.payment.transactionId', $this->transactionId); $database =& JFactory::getDBO(); $data = $_SESSION; $sql = "update #__dtregister_session set `data`= " . $database->Quote(serialize($data)) . " where id=" . $id; $database->setQuery($sql); $database->query(); $database->getErrorMsg(); return true; } else { return false; } }
function save() { global $mainframe, $Itemid, $DT_mailfrom, $DT_fromname, $frontendEventNotification; $row = $this->getModel('event')->table; $data = JRequest::getVar('data'); $error = false; if ($data['event']['slabId'] != "") { $row->load($data['event']['slabId']); if (!$row->validDateChange($data)) { $this->error = JText::_("DT_REPTITIONS_NOT_VALID"); $error = true; } } if ($error) { DT_Session::set('event.data', $data); $files = JRequest::getVar('event_files', null, 'files', 'array'); DT_Session::set('event.event_files', $files); $this->view->setLayout('warning'); $this->view->assign('message', JText::_("DT_REPEAT_DELETE_WARNING")); $this->view->display(); } else { if ($row->save($data) !== false) { global $eventListOrder; $conf = DtrModel::getInstance('config', 'DtregisterModel'); $conf->updateEventorder($eventListOrder); $subject = JText::_('DT_EVENT_EDIT_SUBJECT'); $message = JText::_('DT_EVENT_EDIT_MESSAGE'); $user = $this->getModel('user')->table; $Tagparser = new Tagparser(); if (isset($data['event']['slabId']) && $data['event']['slabId'] > 0) { $token_subject = JText::_('DT_EVENT_EDIT_SUBJECT'); $token_msg = ""; $token_msg .= '<p>' . JText::_('DT_EVENT_EDIT_MESSAGE') . '</p><p>' . JText::_('DT_EVENT_NAME') . ': [EVENT_NAME]'; $token_msg .= '<br />' . JText::_('DT_EVENT_DATE') . ': [EVENT_DATE]'; $token_msg .= '<br />' . JText::_('DT_EVENT_TIME') . ': [EVENT_TIME]'; $token_msg .= '<br />' . JText::_('DT_LOCATION') . ': [LOCATION]</p>'; } else { $token_subject = JText::_('DT_EVENT_CREATE_SUBJECT'); $token_msg = ""; $token_msg .= '<p>' . JText::_('DT_EVENT_CREATE_MESSAGE') . '</p><p>' . JText::_('DT_EVENT_NAME') . ': [EVENT_NAME]'; $token_msg .= '<br />' . JText::_('DT_EVENT_DATE') . ': [EVENT_DATE]'; $token_msg .= '<br />' . JText::_('DT_EVENT_TIME') . ': [EVENT_TIME]'; $token_msg .= '<br />' . JText::_('DT_LOCATION') . ': [LOCATION]</p>'; } $user->eventId = $row->slabId; $user->load(0); $message = $Tagparser->parsetags($token_msg, $user); $subject = $Tagparser->parsetags($token_subject, $user); $email = $frontendEventNotification; $emails = explode(";", $email); foreach ($emails as $email) { JUTility::sendMail($DT_mailfrom, $DT_fromname, $email, $subject, $message, 1); } } else { $mainframe->redirect("index.php?option=com_dtregister&controller=eventmanage&Itemid={$Itemid}&task=edit&cid[]=" . $row->slabId, $row->error); } $mainframe->redirect("index.php?option=com_dtregister&controller=eventmanage&Itemid={$Itemid}"); } }
function confirm() { global $Itemid, $mainframe, $xhtml, $xhtml_url; $this->view->setModel($this->getModel('field')); $this->view->setModel($this->getModel('fieldtype')); $step = JRequest::getVar('step', 0); if ($step === "confirm") { if (isset($_REQUEST['partial_payment'])) { if ($_REQUEST['partial_payment'] == 'full') { $paying_amount = JRequest::getVar('paying_amount', 0); } else { $paying_amount = JRequest::getVar('partial_payment_amount', 0); } } else { $paying_amount = JRequest::getVar('paying_amount', 0); } if ($paying_amount > 0) { $paid_amount = DT_Session::get('register.User.fee.paid_amount') + $paying_amount; } else { $paid_amount = DT_Session::get('register.User.fee.paid_amount'); } if (DT_Session::get('register.User.0') === false) { DT_Session::set('register.User.fee.paying_amount', $paying_amount); DT_Session::set('register.User.fee.paid_amount', $paid_amount); $user = DT_Session::get('register.User'); DT_Session::clear('register.User'); DT_Session::set('register.User.process', $user['process']); unset($user['process']); DT_Session::set('register.User.0', $user); } else { } $paymethod = DT_Session::get('register.payment.method'); if ($paying_amount <= 0) { $function = DT_Session::get('register.User.process'); $tableUser = $this->getModel('user')->table; $tableUser->{$function}(DT_Session::get('register')); $messageTask = $function; $mainframe->redirect("index.php?option=com_dtregister&controller=message&Itemid={$Itemid}&task=" . $messageTask); } else { $mainframe->redirect(JRoute::_("index.php?option=com_dtregister&controller=payment&task=methods", $xhtml_url)); } } $eventId = JRequest::getVar('eventId', DT_Session::get('register.User.eventId')); $this->view->assign('header_eventId', $eventId); $event =& DtrTable::getInstance('Event', 'Table'); $event->load($eventId); $fieldtype = $this->getModel('fieldtype'); $viewMemFields = ""; if (DT_Session::get('register.User.type') == 'G') { $back = JRoute::_("index.php?option=com_dtregister&Itemid=" . $Itemid . "&eventId=" . $eventId . "&controller=user&task=edit&back=1&userId=" . DT_Session::get('register.User.userId')); $type = 'B'; $members = DT_Session::get('register.User.members'); $i = 0; if (is_array($members)) { foreach ($members as $key => $member) { $viewMemFields .= "<tr><td colspan='2'> </td></tr><tr><td colspan='3'><u>" . JText::_('DT_MEMBER') . ($i + 1) . " </u></td></tr>"; $viewMemFields .= $event->viewFields('M', DT_Session::get('register.User.members.' . $key), false, 'frmcart', false); $i++; } } } else { $back = JRoute::_("index.php?option=com_dtregister&Itemid=" . $Itemid . "&eventId=" . $eventId . "&controller=user&task=edit&back=1&userId=" . DT_Session::get('register.User.userId')); $type = 'I'; } $TableUser =& DtrTable::getInstance('Duser', 'Table'); $TableUser->create(DT_Session::get('register.User')); $feeObj = new DT_Fee($event, $TableUser); $feeObj->setPaidAmount(DT_Session::get('register.User.fee.paid_amount')); $feeObj->getFee(false); $feesession = $feeObj; unset($feesession->TableEvent); unset($feesession->TableUser); DT_Session::set('register.User.fee', (array) $feesession); $this->view->assign('feeObj', $feeObj); $this->view->assign('back', $back); $this->view->assign('eventId', $eventId); $event->load($eventId); $this->view->assign('viewFields', $event->viewFields($type, DT_Session::get('register.User'), false, 'frmcart', false)); $this->view->assign('viewMemFields', $viewMemFields); $this->view->assign('partial_payment_enable', $event->partial_payment_enable); $this->display(); }
function restoreFromPayment($paypal_session_id = 0) { $database =& JFactory::getDBO(); $sql = "select * from #__dtregister_session where id={$paypal_session_id}"; $database->setQuery($sql); $database->query(); // echo $database->getQuery(); $row = $database->loadObjectList(); $data = unserialize($row[0]->data); $dt_userId = $row[0]->user_id; $session =& JFactory::getSession(); $_SESSION = $data; $session->getToken(true); //$session->fork(); $session->set('session.timer.start', strtotime('now')); $session->set('session.counter', 1); $session->set('session.timer.last', strtotime('now')); $session->set('session.timer.now', strtotime('now')); $session->set('__dtregister', $data['__dtregister']); $_SESSION['__dtregister'] = $data['__dtregister']; DT_Session::set('register.restore.userId', $dt_userId); DT_Session::set('register.restore.processed', $row[0]->processed); DT_Session::set('register.restore.id', $paypal_session_id); //prd($data); //pr($session->getExpire()); //pr($session->getStores()); //pr($session->getState()); //pr($session); }
function form() { global $Itemid; if (DT_Session::get('register.User.process')) { $this->view->assign('header_eventId', DT_Session::get('register.User.0.eventId')); $this->header_eventId = DT_Session::get('register.User.0.eventId'); } if (DT_Session::get('register.User.process')) { include JPATH_SITE . DS . 'components' . DS . 'com_dtregister' . DS . 'views' . DS . 'user' . DS . 'tmpl' . DS . 'event_header.php'; } else { ?> <div class="componentheading"><?php echo JText::_('DT_EVENT_REGISTRATION'); ?> : <?php echo JText::_('DT_PAYMENT'); ?> </div> <?php } global $mainframe, $Itemid; $userIndex = DT_Session::get('register.Setting.current.userIndex'); if ($userIndex !== false && $userIndex != "") { DT_Session::clear('register.User.' . $userIndex . '.TableEvent'); DT_Session::clear('register.User.' . $userIndex . '.TableUser'); } $billingInfo = DT_Session::get('register.payment.billing'); if (isset($_REQUEST['paymentmethod'])) { if ($_REQUEST['paymentmethod'] == "pay_later") { DT_Session::set('register.payment.method', $_REQUEST['pay_later_option']); } else { DT_Session::set('register.payment.method', $_REQUEST['paymentmethod']); } } $no_billing = array('GoogleCheckout', 'paypal', 'pay_later', 'saferpay', 'Eway', 'psigate'); $paymentClass = DT_Session::get('register.payment.method'); if (!is_numeric($paymentClass)) { require_once JPATH_SITE . '/components/com_dtregister/lib/payment/' . $paymentClass . '.php'; $payment = new $paymentClass(); } else { } if (empty($billingInfo) && (!in_array($paymentClass, $no_billing) || !is_numeric($paymentClass) && $payment->bywebservice) && $_REQUEST['paymentmethod'] != "pay_later" && !is_numeric($paymentClass)) { $mainframe->redirect(JRoute::_("index.php?option=com_dtregister&controller=payment&task=billinginfo&Itemid=" . $Itemid, false)); } $tableUser = $this->getModel('user')->table; $paymentClass = DT_Session::get('register.payment.method'); if (isset($_REQUEST['paymentmethod']) && $_REQUEST['paymentmethod'] == "pay_later") { $paymethod = DT_Session::get('register.payment.method'); $tableUser->registerall(DT_Session::get('register'), $paymethod); $mainframe->redirect(JRoute::_("index.php?option=com_dtregister&controller=message&task=paylater&Itemid=" . $Itemid, false)); } else { require_once JPATH_SITE . '/components/com_dtregister/lib/payment/' . $paymentClass . '.php'; // prd($billingInfo); $payment->setBillinginfo($billingInfo); if (DT_Session::get('register.User.process') == "") { $function = 'registerall'; $messageTask = 'thanks'; $count = count(DT_Session::get('register.User')); $payment->confirmNum = DT_Session::get('register.User.0.confirmNum'); if ($count == 1) { $payment->description = $this->evtTable->title; } else { $payment->description = JText::_('DT_EVENT_PAYMENT_DESCRIPTION'); } } else { $function = DT_Session::get('register.User.process'); $payment->confirmNum = DT_Session::get('register.User.0.confirmNum'); $payment->description = $this->evtTable->title; } $success = $payment->process(); if ($payment->bywebservice) { if ($success === true) { $paymethod = DT_Session::get('register.payment.method'); if (DT_Session::get('register.User.process') === false || DT_Session::get('register.User.process') == "") { $function = 'registerall'; $messageTask = 'thanks'; } else { $messageTask = DT_Session::get('register.User.process'); $function = DT_Session::get('register.User.process'); } $tableUser->{$function}(DT_Session::get('register'), $paymethod); $mainframe->redirect(JRoute::_("index.php?option=com_dtregister&controller=message&Itemid={$Itemid}&task=" . $messageTask, false)); } else { if ($success === false) { $payment->afterFailed(); echo $payment->tryAgain(); } } } } $this->view->setLayout('form'); $this->view->display(); }
function notify() { if ($this->validate_ipn() && ($_REQUEST['payment_status'] == 'Completed' || $_REQUEST['payment_status'] == 'Pending' || $_REQUEST['payment_status'] == 'Processed')) { $this->transactionId = $_REQUEST['txn_id']; DT_Session::set('register.payment.transactionId', $this->transactionId); return true; } else { return true; } }
function group_registration() { global $mainframe; if (isset($_POST['formsubmit'])) { DT_Session::set('register.User.memtot', JRequest::getVar('memtot', 1)); $eventId = DT_Session::get('register.User.eventId'); $event = $this->getModel('event')->table; $event->load($eventId); if ($event->group_registration_type != "detail") { $mainframe->redirect("index.php?option=com_dtregister&controller=user&task=billing"); } else { $mainframe->redirect("index.php?option=com_dtregister&controller=user&task=member"); } //prd($_SESSION); } else { DT_Session::clear('register'); $search = JRequest::getVar('search'); $eventId = $search['eventId']; DT_Session::set('register.User.type', 'G'); DT_Session::set('register.User.eventId', $eventId); DT_Session::set('register.User.members', array()); } // Check for capacity registration for a particular event $eventTable = $this->getModel('event')->table; $eventTable->load($eventId); $registered = $eventTable->getTotalregistered($eventId); $max_registrations = $eventTable->max_registrations; if ($max_registrations > $registered) { $availableSpots = $max_registrations - $registered; } elseif ($max_registrations != 0) { $mainframe->redirect("index.php?option=com_dtregister&controller=user", JText::_('DT_ALERT_FULL_EVENT')); exit; } JToolBarHelper::save('group_registration', JText::_('DT_NEXT_STEP')); $this->view->assign('eventId', $eventId); $this->view->setLayout('memtotform'); $this->view->display(); }
function price_header() { $layout = JRequest::getVar('dttmpl', 'price_header'); if (isset($_REQUEST['Field'])) { $userIndex = DT_Session::get('register.Setting.current.userIndex'); if (isset($_REQUEST['memberIndex'])) { $memberIndex = JRequest::getVar('memberIndex', 0); DT_Session::set('register.User.' . $userIndex . '.members.' . $memberIndex . '.fields', $_REQUEST['Field']); } else { DT_Session::set('register.User.' . $userIndex . '.fields', $_REQUEST['Field']); if (isset($_REQUEST['username'])) { DT_Session::set('register.User.' . $userIndex . '.username', $_REQUEST['username']); DT_Session::set('register.User.' . $userIndex . '.password', $_REQUEST['password']); } if (isset($_REQUEST['discount_code']) && $_REQUEST['discount_code'] != "") { $eventId = JRequest::getVar('eventId', DT_Session::get('register.Event.eventId')); $event = $this->getModel('event')->table; $event->load($eventId); $discount_code_id = $event->validate_code($_REQUEST['discount_code']); if ($discount_code_id !== false) { DT_Session::set('register.User.' . $userIndex . '.discount_code_id', $discount_code_id); } else { DT_Session::set('register.User.' . $userIndex . '.discount_code_id', false); $this->view->assign('discountCodeError', $event->TableEventdiscountcode->TableDiscountcode->error); } } else { DT_Session::set('register.User.' . $userIndex . '.discount_code_id', 0); } } } $this->view->setLayout($layout); $this->view->display(); die; }
function afterpayment() { prd($_REQUEST); $this->transactionId = $_REQUEST['ewayTrxnReference']; DT_Session::set('register.payment.transactionId', $this->transactionId); $this->confirmNum = $_SESSION['register']['billingInfo']['confirmNum']; unset($_SESSION['register']['billingInfo']['confirmNum']); }
function process() { $this->setFields(); $fields = $this->formatfields(); $this->url; $ch = curl_init($this->url); if ($this->godaddy_hosting) { curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); curl_setopt($ch, CURLOPT_PROXY, "http://proxy.shr.secureserver.net:3128"); } curl_setopt($ch, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response //curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1) curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim($fields, "& ")); // use HTTP POST to send form data curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response. ### $resp = curl_exec($ch); //execute post and get results $this->response = $resp; $this->parseResponse(); if ($this->responseParts[0] == 1) { $this->transactionId = $this->responseParts[6]; DT_Session::set('register.payment.transactionId', $this->transactionId); return true; } else { $res = $this->responseParts; switch ($res[0]) { case 1: $this->errorMsg = JText::_('DT_PAYMENT_SUCCESSFUL') . '<br />'; $this->errorMsg .= JText::_('DT_AUTHORIZATION_CODE') . ': ' . $res[4] . '<br />'; $this->errorMsg .= JText::_('DT_AMOUNT') . ': ' . $res[9] . '<br />'; $this->errorMsg .= JText::_('TRANS_ID') . ': ' . $res[6] . '<br />'; $this->errorMsg .= JText::_('DT_INVOICE_NUMBER') . ': ' . $res[7] . '<br /><br />'; break; case 2: if ($res[2] == 2 || $res[2] == 4) { $this->errorMsg = JText::_('DT_PAYMENT_DECLINED'); $this->errorMsg .= JText::_('DT_REASON') . ": " . $res[3] . "<br />"; } break; case 3: $this->errorMsg = $res[3]; echo JText::_('DT_REASON') . ": "; switch ($res[2]) { case 5: $this->errorMsg = JText::_('DT_AMOUNT_NOT_VALID'); break; case 6: case 37: $this->errorMsg = JText::_('DT_CARD_NUMBER_INVALID'); break; case 7: $this->errorMsg = JText::_('DT_EXP_DATE_INVALID'); break; case 11: $this->errorMsg = JText::_('DT_DUPLICATE_TRANSACTION'); break; case 13: $this->errorMsg = JText::_('DT_API_LOGIN_INVALID'); break; case 17: case 28: $this->errorMsg = JText::_('DT_MERCHANT_NOT_CONFIGURED'); break; case 19: case 20: case 21: case 22: case 23: case 25: case 26: case 57: case 58: case 59: case 60: case 61: case 62: case 63: $this->errorMsg = JText::_('DT_ERROR_OCCURRED'); $this->errorMsg .= '<a href="' . JRoute::_('index.php?option=com_dtregister&Itemid=' . $Itemid, $xhtml_url) . '">' . JText::_('DT_CLICK_HERE') . '</a>'; break; case 27: $this->errorMsg = JText::_('DT_AUTH_AVS_MISMATCH'); break; case 34: case 35: case 38: case 43: $this->errorMsg = JText::_('DT_AUTH_MERCH_SETUP_PROCESSOR'); break; case 49: $this->errorMsg = JText::_('DT_AUTH_MAX_ALLOWED'); break; case 50: $this->errorMsg = JText::_('DT_AUTH_TRANS_SETTLE_REFUNDED'); break; case 54: $this->errorMsg = JText::_('DT_AUTH_REF_TRANS'); break; case 55: $this->errorMsg = JText::_('DT_AUTH_SUM_CREDIT_REF_TRANS'); break; case 56: $this->errorMsg = JText::_('DT_AUTH_ECHECK_ONLY'); break; case 66: $this->errorMsg = JText::_('DT_AUTH_SECURITY_GUIDELINES'); break; case 68: $this->errorMsg = JText::_('DT_AUTH_XVERSION_INVALID'); break; case 69: $this->errorMsg = JText::_('DT_AUTH_XTYPE_INVALID'); break; case 78: $this->errorMsg = JText::_('DT_AUTH_XCARD_FAILED'); break; } break; } switch ($res[38]) { case 'N': $this->errorMsg = JText::_('DT_AUTH_CC_CODE_MISMATCH'); break; case 'P': $this->errorMsg = JText::_('DT_AUTH_CC_NOT_PROCESSED'); break; case 'S': $this->errorMsg = JText::_('DT_AUTH_CC_CODE_NOT_PRESENT'); break; case 'U': $this->errorMsg = JText::_('DT_AUTH_ISSUER_NOT_PROCESS'); break; } echo $this->errorMsg; return false; } prd($resp); }
function process() { $this->setFields(); $fields = $this->formatfields(); $this->url; $ch = curl_init($this->url); if ($this->godaddy_hosting) { curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); curl_setopt($ch, CURLOPT_PROXY, "http://proxy.shr.secureserver.net:3128"); } curl_setopt($ch, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response //curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1) curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim($fields, "& ")); // use HTTP POST to send form data curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response. ### $resp = curl_exec($ch); //execute post and get results $this->response = $resp; $this->parseResponse(); if ($this->responseParts['success'] == 'A') { $this->transactionId = $gatewaydata['TransactionID']; DT_Session::set('register.payment.transactionId', $this->transactionId); return true; } else { echo $this->responseParts['message']; return false; } prd($resp); }
function process() { /* session variables here only . */ DT_Session::set('register.payment.offline_process', true); return true; }
function registerall($users, $paymentmethod = "") { $data = $users['User']; $paylater =& DtrModel::getInstance('paylater', 'dtregisterModel'); $paylaterkeys = $paylater->getMethodkeys(); if (is_array($data)) { foreach ($data as $userIndex => $row) { $row['fee']['payment_method'] = $paymentmethod; if (in_array($paymentmethod, $paylaterkeys) || $paymentmethod == "offline_payment") { $row['fee']['paid_amount'] = 0; $row['fee']['paying_amount'] = 0; $row['fee']['paid_fee'] = 0; } if (DT_Session::get('register.payment.transactionId') !== false) { $row['transaction_id'] = DT_Session::get('register.payment.transactionId'); } if (count($row['fields']) > 0) { $this->register($row); // DT_Session::set('register.User.'.$userIndex.'.userId',0); DT_Session::set('register.User.' . $userIndex . '.userId', $this->userId); $this->{$this->_tbl_key} = ""; $this->TableFee->{$this->TableFee->_tbl_key} = ""; } } } }