Ejemplo n.º 1
0
 function showEndForm($pmconfigs, $order)
 {
     $mainframe =& JFactory::getApplication();
     $jshopConfig =& JSFactory::getConfig();
     $item_name = sprintf(_JSHOP_PAYMENT_NUMBER, $order->order_number);
     $notify_url = JURI::root() . "index.php?option=com_jshopping&controller=checkout&task=step7&act=notify&js_paymentclass=pm_ideal&no_lang=1";
     $return = JURI::root() . "index.php?option=com_jshopping&controller=checkout&task=step7&act=return&js_paymentclass=pm_ideal";
     $cancel_return = JURI::root() . "index.php?option=com_jshopping&controller=checkout&task=step7&act=cancel&js_paymentclass=pm_ideal";
     $params_data = $order->getPaymentParamsData();
     $bank_id = $params_data['bank_id'];
     $amount = intval($order->order_total * 100);
     $iDEAL = new iDEAL_Payment($pmconfigs['partnerid']);
     if ($pmconfigs['testmode']) {
         $iDEAL->setTestMode();
     }
     if ($iDEAL->createPayment($bank_id, $amount, $item_name, $return, $notify_url)) {
         $order1 =& JTable::getInstance('order', 'jshop');
         $order1->load($order->order_id);
         $order1->transaction = $iDEAL->getTransactionId();
         $order1->store();
         header("Location: " . $iDEAL->getBankURL());
         exit;
     } else {
         saveToLog("payment.log", "Error: Order ID " . $order->order_id . ". CODE: " . $iDEAL->getErrorCode() . ". MSG: " . $iDEAL->getErrorMessage());
         JError::raiseWarning("", $iDEAL->getErrorMessage());
         $mainframe->redirect(SEFLink('index.php?option=com_jshopping&controller=checkout&task=step5', 0, 1, $jshopConfig->use_ssl));
         exit;
     }
 }
Ejemplo n.º 2
0
 public function validateNotification($response, $post, $invoice)
 {
     require_once dirname(__FILE__) . '/lib/cls.ideal.php';
     $response = array();
     $response['valid'] = false;
     $transaction_id = aecGetParam('transaction_id', '', true, array('word', 'string', 'clear_nonalnum'));
     if (strlen($transaction_id)) {
         $mollieIdeal = new iDEAL_Payment($this->settings['partner_id']);
         $mollieIdeal->checkPayment($transaction_id);
         if ($mollieIdeal->getPaidStatus()) {
             $response['valid'] = true;
         } else {
             // error handling
             $response['error'] = true;
             $response['errormsg'] = 'iDEAL_Payment::checkPayment failed';
             $this->___logError("iDEAL_Payment::checkPayment failed", $mollieIdeal->getErrorCode(), $mollieIdeal->getErrorMessage());
         }
     }
     return $response;
 }