当前位置: 首页>>代码示例>>PHP>>正文


PHP VirtueMartModelOrders类代码示例

本文整理汇总了PHP中VirtueMartModelOrders的典型用法代码示例。如果您正苦于以下问题:PHP VirtueMartModelOrders类的具体用法?PHP VirtueMartModelOrders怎么用?PHP VirtueMartModelOrders使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了VirtueMartModelOrders类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getOrderDetails

 public function getOrderDetails()
 {
     $orderModel = VmModel::getModel('orders');
     $orderDetails = 0;
     // If the user is not logged in, we will check the order number and order pass
     if ($orderPass = JRequest::getString('order_pass', false) and $orderNumber = JRequest::getString('order_number', false)) {
         $orderId = $orderModel->getOrderIdByOrderPass($orderNumber, $orderPass);
         if (empty($orderId)) {
             vmDebug('Invalid order_number/password ' . JText::_('COM_VIRTUEMART_RESTRICTED_ACCESS'));
             return 0;
         }
         $orderDetails = $orderModel->getOrder($orderId);
     }
     if ($orderDetails == 0) {
         $_currentUser = JFactory::getUser();
         $cuid = $_currentUser->get('id');
         // If the user is logged in, we will check if the order belongs to him
         $virtuemart_order_id = JRequest::getInt('virtuemart_order_id', 0);
         if (!$virtuemart_order_id) {
             $virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber(JRequest::getString('order_number'));
         }
         $orderDetails = $orderModel->getOrder($virtuemart_order_id);
         JLoader::register('Permissions', JPATH_VM_ADMINISTRATOR . '/helpers/permissions.php');
         if (!Permissions::getInstance()->check("admin")) {
             if (!empty($orderDetails['details']['BT']->virtuemart_user_id)) {
                 if ($orderDetails['details']['BT']->virtuemart_user_id != $cuid) {
                     echo 'view ' . JText::_('COM_VIRTUEMART_RESTRICTED_ACCESS');
                     return;
                 }
             }
         }
     }
     return $orderDetails;
 }
开发者ID:denis1001,项目名称:Virtuemart-2-Joomla-3-Bootstrap,代码行数:34,代码来源:invoice.php

示例2: getMyOrderDetails

 /**
  * This is a proxy function to return an order safely, we may set the getOrder function to private
  * Maybe the right place would be the controller, cause there are JRequests in it. But for a fast solution,
  * still better than to have it 3-4 times in the view.html.php of the views.
  * @author Max Milbers
  *
  * @return array
  */
 public function getMyOrderDetails($orderID = 0, $orderNumber = false, $orderPass = false)
 {
     $_currentUser = JFactory::getUser();
     $cuid = $_currentUser->get('id');
     $orderDetails = false;
     // If the user is not logged in, we will check the order number and order pass
     if (empty($cuid)) {
         $sess = JFactory::getSession();
         $orderNumber = vRequest::getString('order_number', $orderNumber);
         $tries = $sess->get('getOrderDetails.' . $orderNumber, 0);
         if ($tries > 5) {
             vmDebug('Too many tries, Invalid order_number/password ' . vmText::_('COM_VIRTUEMART_RESTRICTED_ACCESS'));
             return false;
         }
         // If the user is not logged in, we will check the order number and order pass
         if ($orderPass = vRequest::getString('order_pass', $orderPass)) {
             $orderId = $this->getOrderIdByOrderPass($orderNumber, $orderPass);
             if (empty($orderId)) {
                 echo vmText::_('COM_VIRTUEMART_RESTRICTED_ACCESS');
                 vmdebug('getMyOrderDetails COM_VIRTUEMART_RESTRICTED_ACCESS', $orderNumber, $orderPass, $tries);
                 $tries++;
                 $sess->set('getOrderDetails.' . $orderNumber, $tries);
                 return false;
             }
             $orderDetails = $this->getOrder($orderId);
         }
     } else {
         // If the user is logged in, we will check if the order belongs to him
         $virtuemart_order_id = vRequest::getInt('virtuemart_order_id', $orderID);
         if (!$virtuemart_order_id) {
             $virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber(vRequest::getString('order_number'));
         }
         $orderDetails = $this->getOrder($virtuemart_order_id);
         $user = JFactory::getUser();
         if (!vmAccess::manager('orders')) {
             if (!isset($orderDetails['details']['BT']->virtuemart_user_id)) {
                 $orderDetails['details']['BT']->virtuemart_user_id = 0;
             }
             if ($orderDetails['details']['BT']->virtuemart_user_id != $cuid) {
                 echo vmText::_('COM_VIRTUEMART_RESTRICTED_ACCESS');
                 return false;
             }
         }
     }
     return $orderDetails;
 }
开发者ID:thumbs-up-sign,项目名称:TuVanDuAn,代码行数:54,代码来源:orders.php

示例3: plgVmOnPaymentNotification

 /**
  * @return bool|null
  */
 function plgVmOnPaymentNotification()
 {
     //$this->_debug = true;
     if (!class_exists('VirtueMartModelOrders')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
     }
     $paypal_data = JRequest::get('post');
     if (!isset($paypal_data['invoice'])) {
         return FALSE;
     }
     $order_number = $paypal_data['invoice'];
     if (!($virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber($paypal_data['invoice']))) {
         return FALSE;
     }
     if (!($payments = $this->getDatasByOrderId($virtuemart_order_id))) {
         return FALSE;
     }
     $method = $this->getVmPluginMethod($payments[0]->virtuemart_paymentmethod_id);
     if (!$this->selectedThisElement($method->payment_element)) {
         return FALSE;
     }
     $this->_debug = $method->debug;
     $this->logInfo('paypal_data ' . implode('   ', $paypal_data), 'message');
     // _processIPN checks that  $res== "VERIFIED"
     if (!$this->_processIPN($paypal_data, $method)) {
         $this->logInfo('paypal_data _processIPN FALSE', 'message');
         return FALSE;
     }
     //$this->_storePaypalInternalData ($method, $paypal_data, $virtuemart_order_id, $payment->virtuemart_paymentmethod_id);
     $modelOrder = VmModel::getModel('orders');
     $order = array();
     /*
      * https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables
      * The status of the payment:
      * Canceled_Reversal: A reversal has been canceled. For example, you won a dispute with the customer, and the funds for the transaction that was reversed have been returned to you.
      * Completed: The payment has been completed, and the funds have been added successfully to your account balance.
      * Created: A German ELV payment is made using Express Checkout.
      * Denied: You denied the payment. This happens only if the payment was previously pending because of possible reasons described for the pending_reason variable or the Fraud_Management_Filters_x variable.
      * Expired: This authorization has expired and cannot be captured.
      * Failed: The payment has failed. This happens only if the payment was made from your customer’s bank account.
      * Pending: The payment is pending. See pending_reason for more information.
      * Refunded: You refunded the payment.
      * Reversed: A payment was reversed due to a chargeback or other type of reversal. The funds have been removed from your account balance and returned to the buyer. The reason for the reversal is specified in the ReasonCode element.
      * Processed: A payment has been accepted.
      * Voided: This authorization has been voided.
      *
      */
     $lang = JFactory::getLanguage();
     $order['customer_notified'] = 1;
     // 1. check the payment_status is Completed
     if (strcmp($paypal_data['payment_status'], 'Completed') == 0) {
         // 2. check that txn_id has not been previously processed
         if ($this->_check_txn_id_already_processed($payments, $paypal_data['txn_id'], $method)) {
             return FALSE;
         }
         // 3. check email and amount currency is correct
         if (!$this->_check_email_amount_currency($payments, $this->_getMerchantEmail($method), $paypal_data)) {
             return FALSE;
         }
         // now we can process the payment
         $order['order_status'] = $method->status_success;
         $order['comments'] = JText::sprintf('VMPAYMENT_PAYPAL_PAYMENT_STATUS_CONFIRMED', $order_number);
     } elseif (strcmp($paypal_data['payment_status'], 'Pending') == 0) {
         $key = 'VMPAYMENT_PAYPAL_PENDING_REASON_FE_' . strtoupper($paypal_data['pending_reason']);
         if (!$lang->hasKey($key)) {
             $key = 'VMPAYMENT_PAYPAL_PENDING_REASON_FE_DEFAULT';
         }
         $order['comments'] = JText::sprintf('VMPAYMENT_PAYPAL_PAYMENT_STATUS_PENDING', $order_number) . JText::_($key);
         $order['order_status'] = $method->status_pending;
     } elseif (strcmp($paypal_data['payment_status'], 'Refunded') == 0 and isset($method->status_refunded)) {
         if ($this->_is_full_refund($payments, $paypal_data)) {
             $order['comments'] = JText::sprintf('VMPAYMENT_PAYPAL_PAYMENT_STATUS_REFUNDED', $order_number);
             $order['order_status'] = $method->status_refunded;
         } else {
             $order['comments'] = JText::sprintf('VMPAYMENT_PAYPAL_PAYMENT_STATUS_PARTIAL_REFUNDED', $order_number);
             $order['order_status'] = isset($method->status_partial_refunded) ? $method->status_partial_refunded : 'R';
         }
     } elseif (isset($paypal_data['payment_status'])) {
         $order['order_status'] = $method->status_canceled;
     } else {
         /*
          * a notification was received that concerns one of the payment (since $paypal_data['invoice'] is found in our table),
          * but the IPN notification has no $paypal_data['payment_status']
          * We just log the info in the order, and do not change the status, do not notify the customer
          */
         $order['comments'] = JText::_('VMPAYMENT_PAYPAL_IPN_NOTIFICATION_RECEIVED');
         $order['customer_notified'] = 0;
     }
     $this->_storePaypalInternalData($method, $paypal_data, $virtuemart_order_id, $payments[0]->virtuemart_paymentmethod_id);
     $this->logInfo('plgVmOnPaymentNotification return new_status:' . $order['order_status'], 'message');
     $modelOrder->updateStatusForOneOrder($virtuemart_order_id, $order, TRUE);
     //// remove vmcart
     if (isset($paypal_data['custom'])) {
         $this->emptyCart($paypal_data['custom'], $order_number);
     }
     //die();
 }
开发者ID:SeventF,项目名称:ikea.com,代码行数:100,代码来源:paypal.php

示例4: plgVmOnPaymentNotification

	function plgVmOnPaymentNotification() {

		//https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNandPDTVariables/

		if (!class_exists('VirtueMartModelOrders')) {
			require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php');
		}
		$paypal_data = JRequest::get('post');

		//Recuring payment return rp_invoice_id instead of invoice
		if (array_key_exists('rp_invoice_id', $paypal_data)) {
			$paypal_data['invoice'] = $paypal_data['rp_invoice_id'];
		}
		if (!isset($paypal_data['invoice'])) {
			return FALSE;
		}

		$order_number = $paypal_data['invoice'];
		if (!($virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber($paypal_data['invoice']))) {
			return FALSE;
		}

		if (!($payments = $this->getDatasByOrderId($virtuemart_order_id))) {
			return FALSE;
		}

		$this->_currentMethod = $this->getVmPluginMethod($payments[0]->virtuemart_paymentmethod_id);
		if (!$this->selectedThisElement($this->_currentMethod->payment_element)) {
			return FALSE;
		}

		$orderModel = VmModel::getModel('orders');
		$order = $orderModel->getOrder($virtuemart_order_id);

		$paypalInterface = $this->_loadPayPalInterface();
		$paypalInterface->setOrder($order);
		$paypalInterface->debugLog($paypal_data, 'PaymentNotification, paypal_data:', 'debug');
		$paypalInterface->debugLog($order_number, 'PaymentNotification, order_number:', 'debug');
		$paypalInterface->debugLog($payments[0]->virtuemart_paymentmethod_id, 'PaymentNotification, virtuemart_paymentmethod_id:', 'debug');
        $order_history = $paypalInterface->processIPN($paypal_data, $payments);
		if (!$order_history) {
			return false;
		} else {
			$this->_storePaypalInternalData( $paypal_data, $virtuemart_order_id, $payments[0]->virtuemart_paymentmethod_id);
			$paypalInterface->debugLog('order_number:'.$order_number.' new_status:' . $order_history['order_status'], 'plgVmOnPaymentNotification', 'debug');

			$orderModel->updateStatusForOneOrder($virtuemart_order_id, $order_history, TRUE);
			//// remove vmcart
			if (isset($paypal_data['custom'])) {
				$this->emptyCart( $paypal_data['custom'], $order_number );
			}
		}
	}
开发者ID:sergy444,项目名称:joomla,代码行数:53,代码来源:paypal.php

示例5: plgVmOnPaymentNotification

	/**
	 * @return bool|null
	 */
	function plgVmOnPaymentNotification () {

		if (!class_exists ('VirtueMartModelOrders')) {
			require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php');
		}
		$paypal_data = JRequest::get ('post');
		if (!isset($paypal_data['invoice'])) {
			return NULL;
		}
		$order_number = $paypal_data['invoice'];
		if (!($virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber ($paypal_data['invoice']))) {
			return NULL;
		}

		$vendorId = 0;
		if (!($payment = $this->getDataByOrderId ($virtuemart_order_id))) {
			return NULL;
		}

		$method = $this->getVmPluginMethod ($payment->virtuemart_paymentmethod_id);
		if (!$this->selectedThisElement ($method->payment_element)) {
			return FALSE;
		}

		$this->_debug = $method->debug;
		if (!$payment) {
			$this->logInfo ('getDataByOrderId payment not found: exit ', 'ERROR');
			return NULL;
		}
		$this->logInfo ('paypal_data ' . implode ('   ', $paypal_data), 'message');

		$this->_storePaypalInternalData ($method, $paypal_data, $virtuemart_order_id, $payment->virtuemart_paymentmethod_id);
		$modelOrder = VmModel::getModel ('orders');
		$order = array();
		$error_msg = $this->_processIPN ($paypal_data, $method, $virtuemart_order_id);
		$this->logInfo ('process IPN ' . $error_msg, 'message');

		if (!(empty($error_msg))) {
			$order['customer_notified'] = 0;
			$order['order_status'] = $method->status_canceled;
			$order['comments'] = 'process IPN ' . $error_msg;
			/** @var $modelOrder array() */
			$modelOrder->updateStatusForOneOrder ($virtuemart_order_id, $order, TRUE);
			$this->logInfo ('process IPN ' . $error_msg . ' ' . $order['order_status'] , 'ERROR');
			return NULL;
		}
		else {
			$this->logInfo ('process IPN OK', 'message');
		}
		/*
			 * https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables
			 * The status of the payment:
			 * Canceled_Reversal: A reversal has been canceled. For example, you won a dispute with the customer, and the funds for the transaction that was reversed have been returned to you.
			 * Completed: The payment has been completed, and the funds have been added successfully to your account balance.
			 * Created: A German ELV payment is made using Express Checkout.
			 * Denied: You denied the payment. This happens only if the payment was previously pending because of possible reasons described for the pending_reason variable or the Fraud_Management_Filters_x variable.
			 * Expired: This authorization has expired and cannot be captured.
			 * Failed: The payment has failed. This happens only if the payment was made from your customer’s bank account.
			 * Pending: The payment is pending. See pending_reason for more information.
			 * Refunded: You refunded the payment.
			 * Reversed: A payment was reversed due to a chargeback or other type of reversal. The funds have been removed from your account balance and returned to the buyer. The reason for the reversal is specified in the ReasonCode element.
			 * Processed: A payment has been accepted.
			 * Voided: This authorization has been voided.
			 *
			 */
		if (empty($paypal_data['payment_status']) || ($paypal_data['payment_status'] != 'Completed' && $paypal_data['payment_status'] != 'Pending')) {
			//return false;
		}
		$lang = JFactory::getLanguage ();
		$order['customer_notified'] = 1;

		if (strcmp ($paypal_data['payment_status'], 'Completed') == 0) {
			$order['order_status'] = $method->status_success;
			$order['comments'] = JText::sprintf ('VMPAYMENT_PAYPAL_PAYMENT_STATUS_CONFIRMED', $order_number);
		}
		elseif (strcmp ($paypal_data['payment_status'], 'Pending') == 0) {
			$key = 'VMPAYMENT_PAYPAL_PENDING_REASON_FE_' . strtoupper ($paypal_data['pending_reason']);
			if (!$lang->hasKey ($key)) {
				$key = 'VMPAYMENT_PAYPAL_PENDING_REASON_FE_DEFAULT';
			}
			$order['comments'] = JText::sprintf ('VMPAYMENT_PAYPAL_PAYMENT_STATUS_PENDING', $order_number) . JText::_ ($key);
			$order['order_status'] = $method->status_pending;
		}
		else {
			$order['order_status'] = $method->status_canceled;
		}

		$this->logInfo ('plgVmOnPaymentNotification return new_status:' . $order['order_status'], 'message');

		$modelOrder->updateStatusForOneOrder ($virtuemart_order_id, $order, TRUE);
		//// remove vmcart
		$this->emptyCart ($paypal_data['custom'], $order_number);
		//die();
	}
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:97,代码来源:paypal.php

示例6: plgVmOnPaymentNotification

 /**
  * @return bool|null
  */
 function plgVmOnPaymentNotification()
 {
     //$this->_debug = true;
     if (!class_exists('VirtueMartModelOrders')) {
         require VMPATH_ADMIN . DS . 'models' . DS . 'orders.php';
     }
     $virtuemart_paymentmethod_id = vRequest::getInt('pm', 0);
     //$this->_debug=true;
     if (!($this->_currentMethod = $this->getVmPluginMethod($virtuemart_paymentmethod_id))) {
         return NULL;
         // Another method was selected, do nothing
     }
     if (!$this->selectedThisElement($this->_currentMethod->payment_element)) {
         return FALSE;
     }
     $order_number = vRequest::getString('on', '');
     if (empty($order_number)) {
         return FALSE;
     }
     if (!($virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber($order_number))) {
         return FALSE;
     }
     if (!($payments = $this->getDatasByOrderId($virtuemart_order_id))) {
         return FALSE;
     }
     $this->debugLog('OK', 'plgVmOnPaymentNotification', 'debug');
     if (!class_exists('SofortLib')) {
         require VMPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'sofort' . DS . 'sofort' . DS . 'library' . DS . 'sofortLib.php';
     }
     $sofortLib_Notification = new SofortLib_Notification();
     $this->sofortLog($sofortLib_Notification);
     $transactionId = $sofortLib_Notification->getNotification();
     if ($sofortLib_Notification->isError()) {
         $this->debugLog('SOFORT notification return Error ' . $sofortLib_Notification->getError(), 'plgVmOnPaymentNotification', 'error');
     }
     //no valid parameters/xml
     if (empty($transactionId)) {
         $this->debugLog('no transaction ID for order number ' . $order_number, 'plgVmOnPaymentNotification', 'error');
     }
     if (empty($transactionId) || $sofortLib_Notification->isError()) {
         return FALSE;
     }
     $this->debugLog($transactionId, 'plgVmOnPaymentNotification Transaction ID ', 'debug');
     $sofortLib_TransactionData = new SofortLib_TransactionData(trim($this->_currentMethod->configuration_key));
     $this->sofortLog($sofortLib_TransactionData);
     $sofortLib_TransactionData->setTransaction($transactionId)->sendRequest();
     // check that secret , and order are identical
     $security = vRequest::getString('security', '');
     if ($security != $payments[0]->security) {
         $this->debugLog("security token received: " . $security . " security token expected: " . $payments[0]->security, 'plgVmOnPaymentNotification', 'error');
         return false;
     }
     $paymentMethod = $sofortLib_TransactionData->getPaymentMethod();
     if ($paymentMethod != self::SU_SOFORTBANKING) {
         $this->debugLog("Payment method is " . $paymentMethod . " Should be SU" . 'plgVmOnPaymentNotification', 'error');
         return false;
     }
     $sofort_data['sofort_response_amount'] = $sofortLib_TransactionData->getAmount();
     $sofort_data['sofort_response_currency'] = $sofortLib_TransactionData->getCurrency();
     // check that the amount is the same
     if (!$this->_checkAmountAndCurrency($sofort_data, $payments)) {
         return false;
     }
     $modelOrder = VmModel::getModel('orders');
     $order_history = array();
     $status = 'status_' . $sofortLib_TransactionData->getStatus();
     //$this->debugLog('plgVmOnPaymentNotification getStatus:' .$status. ' '.var_export($method, true) , 'message');
     $order_history['customer_notified'] = true;
     $order_history['order_status'] = $this->_currentMethod->{$status};
     $order_history['comments'] = vmText::_('VMPAYMENT_SOFORT_RESPONSE_STATUS_REASON_' . $sofortLib_TransactionData->getStatusReason());
     $sofort_data['sofort_response_status_reason'] = $sofortLib_TransactionData->getStatusReason();
     $sofort_data['sofort_response_transaction'] = $sofortLib_TransactionData->getTransaction();
     $sofort_data['payment_name'] = str_replace(array('\\t', '\\n'), '', $this->renderPluginName($this->_currentMethod));
     $sofort_data['virtuemart_order_id'] = $payments[0]->virtuemart_order_id;
     $sofort_data['order_number'] = $payments[0]->order_number;
     $sofort_data['virtuemart_paymentmethod_id'] = $payments[0]->virtuemart_paymentmethod_id;
     $sofort_data['sofort_response_status'] = $sofortLib_TransactionData->getStatus();
     $sofort_data['sofort_response_status_reason'] = $sofortLib_TransactionData->getStatusReason();
     $this->debugLog(var_export($sofort_data, true), 'plgVmOnPaymentNotification storePSPluginInternalData ', 'debug');
     $this->storePSPluginInternalData($sofort_data);
     $modelOrder->updateStatusForOneOrder($payments[0]->virtuemart_order_id, $order_history, false);
 }
开发者ID:virtuemart-fr,项目名称:virtuemart-fr,代码行数:85,代码来源:sofort.php

示例7: plgVmOnPaymentNotification

 function plgVmOnPaymentNotification()
 {
     if (!class_exists('VirtueMartModelOrders')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
     }
     outToLog('#plgVmOnPaymentNotification: started');
     $merchant_key = $this->getMerchantKeyForOos();
     if (!$merchant_key) {
         $msg = "No OOS secret key found in configuration";
         outToLog($msg);
         throw new Exception($msg);
     }
     $encrypted_request = file_get_contents('php://input');
     //$encrypted_request = $_POST['encrypted_request'];
     outToLog('#plgVmOnPaymentNotification: encrypted_request base64 = ' . base64_encode($encrypted_request));
     //$encrypted_request = base64_decode($encrypted_request);
     $decrypted_request = $this->decrypt_aes128_ecb_pkcs5($encrypted_request, $merchant_key);
     outToLog("#plgVmOnPaymentNotification: using secret key {$merchant_key}");
     outToLog("#plgVmOnPaymentNotification: decrypted_request: [{$decrypted_request}]");
     $json_request = json_decode($decrypted_request, true);
     if (!$json_request) {
         $msg = 'Failed decrypting secret text or decoding JSON';
         outToLog("#plgVmOnPaymentNotification: {$msg}");
         throw new Exception($msg);
     }
     $ordersArray = $json_request['payments'];
     outToLog('#plgVmOnPaymentNotification: num orders = ' . count($ordersArray));
     if (!$ordersArray) {
         return false;
     }
     $jsonResponsePayments = array();
     for ($i = 0; $i < count($ordersArray); $i++) {
         $orderRecord = $ordersArray[$i];
         outToLog('RESPONSE: order ' . ($i + 1) . ' = ' . $orderRecord["orderId"]);
         $oosPayment = array("pay_for" => $orderRecord["orderId"], "order_amount" => $orderRecord["amount"], "order_currency" => "RUB", "paymentDateTime" => date('l jS \\of F Y h:i:s A'), "state" => $orderRecord['state']);
         $order_amount = $this->to_float($oosPayment['order_amount']);
         $orderId = $oosPayment['pay_for'];
         if (!$orderId) {
             continue;
         }
         $vmOrderId = VirtueMartModelOrders::getOrderIdByOrderNumber($orderId);
         if (!$vmOrderId) {
             array_push($jsonResponsePayments, array("orderId" => $orderId, "action" => RESPONSE_ACTION_REJECT));
             continue;
         }
         $vmPayments = $this->getDatasByOrderId($vmOrderId);
         if (!$vmPayments) {
             continue;
         }
         $vmPM = $this->getVmPluginMethod($vmPayments[0]->virtuemart_paymentmethod_id);
         if (!$this->selectedThisElement($vmPM->payment_element)) {
             continue;
         }
         $this->logInfo('oos_data ' . implode('   ', $oosPayment), 'message');
         $error = '';
         //$pay_for = $order_number;
         $order_currency = $oosPayment['order_currency'];
         //проверяем pay запрос
         $localOrder = array('customer_notified' => 1, 'order_status' => $vmPM->status_pending);
         //получаем данные
         outToLog('RESPONSE: virtuemart_order_id = ' . $vmOrderId . ' order_number = ' . $orderId . '$order_amount = ' . $order_amount);
         if ($merchant_key != $this->_getSecretWord($vmPM)) {
             $error .= JText::_('PLG_OOS_VM2_ERROR_3') . '<br>';
         }
         if (empty($order_amount)) {
             $error .= JText::_('PLG_OOS_VM2_ERROR_5') . '<br>';
         } else {
             if (!is_numeric($order_amount)) {
                 $error .= JText::_('PLG_OOS_VM2_ERROR_4') . '<br>';
             }
         }
         if (empty($order_currency)) {
             $error .= JText::_('PLG_OOS_VM2_ERROR_6') . '<br>';
         } else {
             if (strlen($order_currency) > 4) {
                 $error .= JText::_('PLG_OOS_VM2_ERROR_7') . '<br>';
             }
         }
         //если нет ошибок
         if (!$error) {
             if ($orderId) {
                 //сверяем строчки хеша (присланную и созданную нами)
                 $state = $oosPayment['state'];
                 $responseAction = null;
                 if ($state == 'err') {
                     $jtext = JText::_('PLG_OOS_VM2_ERROR_11');
                     $localOrder['order_status'] = $vmPM->status_canceled;
                     outToLog('RESPONSE: order[order_status] = ' . $localOrder['order_status'] . ', comment = ' . $jtext);
                     $localOrder['comments'] = sprintf($jtext, $orderId);
                     $responseAction = RESPONSE_ACTION_CONFIRM;
                 } else {
                     if ($state == 'rej') {
                         $jtext = JText::_('PLG_OOS_VM2_ERROR_12');
                         $localOrder['order_status'] = $vmPM->status_canceled;
                         outToLog('RESPONSE: order[order_status] = ' . $localOrder['order_status'] . ', comment = ' . $jtext);
                         $localOrder['comments'] = sprintf($jtext, $orderId);
                         $responseAction = RESPONSE_ACTION_CONFIRM;
                     } else {
                         if ($state == 'ref') {
                             $jtext = JText::_('PLG_OOS_VM2_ERROR_13');
//.........这里部分代码省略.........
开发者ID:Pashkinz92,项目名称:oos,代码行数:101,代码来源:oos.php

示例8: display

 public function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $pathway = $mainframe->getPathway();
     $task = JRequest::getWord('task', 'list');
     $layoutName = JRequest::getWord('layout', 'list');
     $this->setLayout($layoutName);
     $_currentUser = JFactory::getUser();
     $document = JFactory::getDocument();
     if (!empty($tpl)) {
         $format = $tpl;
     } else {
         $format = JRequest::getWord('format', 'html');
     }
     $this->assignRef('format', $format);
     if ($format == 'pdf') {
         $document->setTitle(JText::_('COM_VIRTUEMART_INVOICE'));
         //PDF needs more RAM than usual
         $memory_limit = ini_get('memory_limit');
         if ($memory_limit < 40) {
             @ini_set('memory_limit', '40M');
         }
     } else {
         if ($layoutName == 'details') {
             $document->setTitle(JText::_('COM_VIRTUEMART_ACC_ORDER_INFO'));
             $pathway->additem(JText::_('COM_VIRTUEMART_ACC_ORDER_INFO'));
         } else {
             $document->setTitle(JText::_('COM_VIRTUEMART_ORDERS_VIEW_DEFAULT_TITLE'));
             $pathway->additem(JText::_('COM_VIRTUEMART_ORDERS_VIEW_DEFAULT_TITLE'));
         }
     }
     $orderModel = VmModel::getModel('orders');
     if ($layoutName == 'details') {
         $order_list_link = FALSE;
         $cuid = $_currentUser->get('id');
         // 			if(!empty($cuid)){
         $order_list_link = JRoute::_('index.php?option=com_virtuemart&view=orders&layout=list');
         // 			} else {
         // 				$order_list_link = false;
         // 				$order_list_link = JRoute::_('index.php?option=com_virtuemart&view=orders');;
         // 			}
         $this->assignRef('order_list_link', $order_list_link);
         if (empty($cuid)) {
             // If the user is not logged in, we will check the order number and order pass
             if ($orderPass = JRequest::getString('order_pass', false)) {
                 $orderNumber = JRequest::getString('order_number', false);
                 $orderId = $orderModel->getOrderIdByOrderPass($orderNumber, $orderPass);
                 if (empty($orderId)) {
                     echo JText::_('COM_VIRTUEMART_RESTRICTED_ACCESS');
                     return;
                 }
                 $orderDetails = $orderModel->getOrder($orderId);
             }
         } else {
             // If the user is logged in, we will check if the order belongs to him
             $virtuemart_order_id = JRequest::getInt('virtuemart_order_id', 0);
             if (!$virtuemart_order_id) {
                 $virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber(JRequest::getString('order_number'));
             }
             $orderDetails = $orderModel->getOrder($virtuemart_order_id);
             if (!class_exists('Permissions')) {
                 require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
             }
             if (!Permissions::getInstance()->check("admin")) {
                 if (!empty($orderDetails['details']['BT']->virtuemart_user_id)) {
                     if ($orderDetails['details']['BT']->virtuemart_user_id != $cuid) {
                         echo JText::_('COM_VIRTUEMART_RESTRICTED_ACCESS');
                         return;
                     }
                 }
             }
         }
         if (empty($orderDetails['details'])) {
             echo JText::_('COM_VIRTUEMART_ORDER_NOTFOUND');
             return;
         }
         $userFieldsModel = VmModel::getModel('userfields');
         $_userFields = $userFieldsModel->getUserFields('account', array('captcha' => true, 'delimiters' => true), array('delimiter_userinfo', 'user_is_vendor', 'username', 'password', 'password2', 'agreed', 'address_type'));
         $orderbt = $orderDetails['details']['BT'];
         $orderst = array_key_exists('ST', $orderDetails['details']) ? $orderDetails['details']['ST'] : $orderbt;
         $userfields = $userFieldsModel->getUserFieldsFilled($_userFields, $orderbt);
         $_userFields = $userFieldsModel->getUserFields('shipment', array(), array('delimiter_userinfo', 'username', 'email', 'password', 'password2', 'agreed', 'address_type'));
         $shipmentfields = $userFieldsModel->getUserFieldsFilled($_userFields, $orderst);
         $shipment_name = '';
         if (!class_exists('vmPSPlugin')) {
             require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
         }
         JPluginHelper::importPlugin('vmshipment');
         $dispatcher = JDispatcher::getInstance();
         $returnValues = $dispatcher->trigger('plgVmOnShowOrderFEShipment', array($orderDetails['details']['BT']->virtuemart_order_id, $orderDetails['details']['BT']->virtuemart_shipmentmethod_id, &$shipment_name));
         $payment_name = '';
         if (!class_exists('vmPSPlugin')) {
             require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
         }
         JPluginHelper::importPlugin('vmpayment');
         $dispatcher = JDispatcher::getInstance();
         $returnValues = $dispatcher->trigger('plgVmOnShowOrderFEPayment', array($orderDetails['details']['BT']->virtuemart_order_id, $orderDetails['details']['BT']->virtuemart_paymentmethod_id, &$payment_name));
         if ($format == 'pdf') {
             $invoiceNumberDate = array();
             $return = $orderModel->createInvoiceNumber($orderDetails['details']['BT'], $invoiceNumberDate);
//.........这里部分代码省略.........
开发者ID:romuland,项目名称:khparts,代码行数:101,代码来源:view.html.php

示例9: plgVmOnPaymentNotification

 function plgVmOnPaymentNotification()
 {
     if (!class_exists('VirtueMartModelOrders')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
     }
     $mb_data = JRequest::get('post');
     if (!isset($mb_data['transaction_id'])) {
         //$this->logInfo (__FUNCTION__ . ' transaction_id not set: ' . $mb_data['transaction_id'], 'message');
         return;
     }
     $order_number = $mb_data['transaction_id'];
     if (!($virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber($mb_data['transaction_id']))) {
         $this->logInfo(__FUNCTION__ . ' Can\'t get VirtueMart order id', 'message');
         return;
     }
     if (!($payment = $this->getDataByOrderId($virtuemart_order_id))) {
         $this->logInfo(__FUNCTION__ . ' Can\'t get payment type', 'message');
         return;
     }
     $method = $this->getVmPluginMethod($payment->virtuemart_paymentmethod_id);
     if (!$this->selectedThisElement($method->payment_element)) {
         $this->logInfo(__FUNCTION__ . ' payment method not selected', 'message');
         return FALSE;
     }
     if (!$payment) {
         $this->logInfo('getDataByOrderId payment not found: exit ', 'ERROR');
         return NULL;
     }
     $this->_storeInternalData($method, $mb_data, $virtuemart_order_id);
     $modelOrder = VmModel::getModel('orders');
     $vmorder = $modelOrder->getOrder($virtuemart_order_id);
     $order = array();
     $error_msg = $this->_processStatus($mb_data, $vmorder, $method);
     if ($error_msg) {
         $order['customer_notified'] = 0;
         $order['order_status'] = $method->status_canceled;
         $order['comments'] = 'process IPN ' . $error_msg;
         $modelOrder->updateStatusForOneOrder($virtuemart_order_id, $order, TRUE);
         $this->logInfo('process IPN ' . $error_msg, 'ERROR');
     } else {
         $this->logInfo('process IPN OK', 'message');
     }
     if (empty($mb_data['payment_status']) || $mb_data['payment_status'] != 'Completed' && $mb_data['payment_status'] != 'Pending') {
         // can't get status or payment failed
         //return false;
     }
     $order['customer_notified'] = 1;
     if (strcmp($mb_data['payment_status'], 'Completed') == 0) {
         $order['order_status'] = $method->status_success;
         $order['comments'] = JText::sprintf('VMPAYMENT_MONEYBOOKERS_PAYMENT_STATUS_CONFIRMED', $order_number);
     } elseif (strcmp($mb_data['payment_status'], 'Pending') == 0) {
         $order['comments'] = JText::sprintf('VMPAYMENT_MONEYBOOKERS_PAYMENT_STATUS_PENDING', $order_number);
         $order['order_status'] = $method->status_pending;
     } else {
         $order['order_status'] = $method->status_canceled;
     }
     $this->logInfo('plgVmOnPaymentNotification return new_status:' . $order['order_status'], 'message');
     $modelOrder->updateStatusForOneOrder($virtuemart_order_id, $order, TRUE);
     //// remove vmcart
     $this->emptyCart($payment->user_session, $mb_data['transaction_id']);
 }
开发者ID:Arturogcalleja,项目名称:herbolario,代码行数:61,代码来源:moneybookers.php

示例10: ipn

	/**
	 * IPN_Handler
	 *
	 * This trigger is invoked whenever a new notification needs to be processed,
	 * and will call the IPN API
	 *
	 *
	 */
	private function ipn () {
		// ERP mode turns off all automated authorization and capture functionality
		// as well as IPN reception and / or polling, and disables any admin UI functionality that may trigger
		//If the authorization is done by ERP then the IPN URL set in amazon should not be this one.
		// we keep it anyway, for testing purposes
		if ($this->isERPModeEnabled() and $this->isAuthorizationDoneByErp()) {
			return;
		}
		// Fetch all HTTP request headers
		$headers = getallheaders();
		$body = file_get_contents('php://input');


		$this->debugLog($headers, 'AMAZON IPN HEADERS debug', 'debug');
		$this->debugLog($body, 'AMAZON IPN BODY debug', 'debug');

		$this->loadAmazonClass('OffAmazonPaymentsNotifications_Client');
		$this->loadVmClass('VirtueMartModelOrders', JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php');

		try {
			$client = new OffAmazonPaymentsNotifications_Client();
			$notification = $client->parseRawMessage($headers, $body);
		} catch (OffAmazonPaymentsNotifications_InvalidMessageException $e) {
			$this->debugLog($e->getMessage() . __FUNCTION__ . ' $body', 'error');
			header("HTTP/1.1 503 Service Unavailable");
			exit(0);
		}
		$notificationType = $notification->getNotificationType();
		$this->debugLog($notificationType, 'ipn', 'debug');

		if (!$this->isValidNotificationtype($notificationType)) {
			$this->debugLog($notificationType, 'ipn NOT isValidNotificationtype', 'error');
			return;
		}

		$notificationClass = 'amazonHelper' . $notificationType;
		$notificationFile = JPATH_SITE . DS . 'plugins' . DS . 'vmpayment' . DS . 'amazon' . DS  . 'helpers' . DS . strtolower($notificationType . '.php');
		if (!file_exists($notificationFile)) {
			$this->debugLog("Unknown notification Type: " . $notificationType, __FUNCTION__, 'error');
			return false;
		}
		if (!class_exists($notificationClass)) {
			require(JPATH_SITE . DS . 'plugins' . DS . 'vmpayment' . DS . 'amazon' . DS  . 'helpers' . DS . 'helper.php');
			require($notificationFile);
		}

		$this->debugLog($notificationType, 'ipn', 'debug');


		$notificationResponse = new $notificationClass($notification, $this->_currentMethod);
		$this->debugLog("<pre>" . var_export($notificationResponse->amazonData, true) . "</pre>", __FUNCTION__, 'debug');


		if (!($order_number = $notificationResponse->getReferenceId())) {
			$this->debugLog('no ReferenceId IPN received', $notificationClass, 'error');
			return true;
		}

		if (!($virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber($order_number))) {
			$this->debugLog('Received a ' . $notificationClass . ' with order number ' . $order_number . ' but no order in DB with that number', $notificationClass, 'error');
			return true;
		}
		$orderModel = VmModel::getModel('orders');
		$order = $orderModel->getOrder($virtuemart_order_id);


		if (!($payments = $this->getDatasByOrderId($virtuemart_order_id))) {
			// we ignore it because we receive also notification when refund/capture is done in the Amazon BE, and there is no valid reference
			//$this->debugLog('Received a ' . $newClass . ' with order number ' . $order_number . 'but no order in DB with that number in AMAZON payment table', $newClass, 'error');
			return true;
		}

		$amazonState = $notificationResponse->onNotificationUpdateOrderHistory($order, $payments);
		$this->storeAmazonInternalData($order, NULL, NULL, $notification, NULL, $notificationResponse->getStoreInternalData());

		$nextOperation = $notificationResponse->onNotificationNextOperation($order, $payments, $amazonState);
		if ($nextOperation === false) {
			return;
		}
		if (!function_exists($nextOperation)) {
			//$this->debugLog('Trying to call ' . $nextOperation .  ' but the function does not exists: Programming error', $notificationClass, 'error');

		}
		$this->$nextOperation($payments, $order);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:93,代码来源:amazon.php

示例11: update_status

 function update_status($status, $order_id, $text = 'VMPAYMENT_SEB_PAYMENT_CANCELED')
 {
     if ($order_id) {
         // send the email only if payment has been accepted
         if (!class_exists('VirtueMartModelOrders')) {
             require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
         }
         $modelOrder = new VirtueMartModelOrders();
         $order['order_status'] = $status;
         $order['virtuemart_order_id'] = $order_id;
         $order['customer_notified'] = 1;
         $order['comments'] = JTExt::sprintf($text, $order_id);
         $modelOrder->updateStatusForOneOrder($order_id, $order, true);
     }
 }
开发者ID:jflash,项目名称:moodulid25,代码行数:15,代码来源:seb.php

示例12: plgVmOnPaymentResponseReceived

  function plgVmOnPaymentResponseReceived (&$html) {
    if (!class_exists ('VirtueMartCart')) {
			require(JPATH_VM_SITE . DS . 'helpers' . DS . 'cart.php');
		}
		if (!class_exists ('shopFunctionsF')) {
			require(JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php');
		}
		if (!class_exists ('VirtueMartModelOrders')) {
			require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php');
    }

    $virtuemart_paymentmethod_id = JRequest::getInt ('pm', 0);
		$order_number = JRequest::getString ('on', 0);
    
    if (!($method = $this->getVmPluginMethod ($virtuemart_paymentmethod_id))) {
      return NULL; // Another method was selected, do nothing
    }
    if (!$this->selectedThisElement ($method->payment_element)) {
			return NULL;
    }
    
    if (!($virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber ($order_number))) {
			return NULL;
    }
 		$db = JFactory::getDBO ();
		$_q = 'SELECT * FROM `' . $this->_tablename . '` '
			. 'WHERE `virtuemart_order_id` = ' . $virtuemart_order_id;
		$db->setQuery ($_q);
		if (!($paymentData = $db->loadObject ())) {
			// JError::raiseWarning(500, $db->getErrorMsg());
		}
    vmdebug ('HEIDELPAY paymentdata', $paymentData);
		$cart = VirtueMartCart::getCart ();
    $cart->emptyCart ();
 
		if ($paymentData->processing_result == "NOK") {
			vmError ('VMPAYMENT_HEIDELPAY_PAYMENT_FAILED','VMPAYMENT_HEIDELPAY_PAYMENT_FAILED');
			vmError (" - " . $paymentData->comment," - " . $paymentData->comment);
		} else {
			vmInfo ('VMPAYMENT_HEIDELPAY_PAYMENT_SUCESS');
			$html  = "<h3>".JText::sprintf ('VMPAYMENT_HEIDELPAY_ORDER_NR') . ': ' . $order_number . " </h3>" ; 
			$tmpkom	= preg_replace("/\(-/", '<a href="', $paymentData->comment);
			$tmpkom	= preg_replace('/-\)/', '" target="_blank">Barcode runterladen</a>', $tmpkom );
			$html .= $tmpkom;
			
			
		}
		// if payment is in test mode
		if ($paymentData->transaction_mode != "LIVE") {
			vmInfo('VMPAYMENT_HEIDELPAY_PAYMENT_TESTMODE');
		}
		$orgSecret = $this->createSecretHash ($order_number, $method->HEIDELPAY_SECRET);
		$order['comments']="";
		if ($virtuemart_order_id) {
			$order['customer_notified'] = 0;
			$order['order_status'] = $this->getStatus ($method, $paymentData->processing_result);
			$modelOrder = VmModel::getModel ('orders');
			$orderitems = $modelOrder->getOrder ($virtuemart_order_id);
			$nb_history = count ($orderitems['history']);
			if ($orderitems['history'][$nb_history - 1]->order_status_code != $order['order_status']) {
				if ($method->HEIDELPAY_CONFIRM_EMAIL == 1 or ($method->HEIDELPAY_CONFIRM_EMAIL == 2 and $paymentData->processing_result == "ACK")) {
					$order['customer_notified'] = 1;
					$order['comments'] = JText::sprintf ('VMPAYMENT_HEIDELPAY_EMAIL_SENT') . "<br />";
				}
				$order['comments'] .= $paymentData->comment;

				/*
				* Verify Payment response
				*/
				if ($orgSecret != $paymentData->secret_hash) {
					$order['customer_notified'] = 0;
					$order['comments'] = "Hash verification error, suspecting manipulation. IP: " . $paymentData->response_ip;
					$order['order_status'] = '';
				}

				$modelOrder->updateStatusForOneOrder ($virtuemart_order_id, $order, TRUE);
			}
		}

		return TRUE;
	}
开发者ID:sergy444,项目名称:joomla,代码行数:81,代码来源:heidelpay.php

示例13: check

 function check()
 {
     if (empty($this->order_number)) {
         if (!class_exists('VirtueMartModelOrders')) {
             require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
         }
         $this->order_number = VirtueMartModelOrders::generateOrderNumber((string) time());
     }
     if (empty($this->order_pass)) {
         $this->order_pass = 'p_' . substr(md5((string) time() . $this->order_number), 0, 5);
     }
     return parent::check();
 }
开发者ID:Roma48,项目名称:abazherka_old,代码行数:13,代码来源:orders.php

示例14: plgVmOnUpdateOrderPayment

 /**
 * Save updated order data to the method specific table
 *
 * @param array   $_formData Form data
 * @return mixed, True on success, false on failures (the rest of the save-process will be
 * skipped!), or null when this method is not actived.
 *
 	public function plgVmOnUpdateOrderPayment(  $_formData) {
 	return null;
 	}
 
 	/**
 * Save updated orderline data to the method specific table
 *
 * @param array   $_formData Form data
 * @return mixed, True on success, false on failures (the rest of the save-process will be
 * skipped!), or null when this method is not actived.
 *
 	public function plgVmOnUpdateOrderLine(  $_formData) {
 	return null;
 	}
 
 	/**
 * plgVmOnEditOrderLineBE
 * This method is fired when editing the order line details in the backend.
 * It can be used to add line specific package codes
 *
 * @param integer $_orderId The order ID
 * @param integer $_lineId
 * @return mixed Null for method that aren't active, text (HTML) otherwise
 *
 	public function plgVmOnEditOrderLineBEPayment(  $_orderId, $_lineId) {
 	return null;
 	}
 
 	/**
 * This method is fired when showing the order details in the frontend, for every orderline.
 * It can be used to display line specific package codes, e.g. with a link to external tracking and
 * tracing systems
 *
 * @param integer $_orderId The order ID
 * @param integer $_lineId
 * @return mixed Null for method that aren't active, text (HTML) otherwise
 *
 	public function plgVmOnShowOrderLineFE(  $_orderId, $_lineId) {
 	return null;
 	}
 
 	/**
 * This event is fired when the  method notifies you when an event occurs that affects the order.
 * Typically,  the events  represents for payment authorizations, Fraud Management Filter actions and other actions,
 * such as refunds, disputes, and chargebacks.
 *
 * NOTE for Plugin developers:
 *  If the plugin is NOT actually executed (not the selected payment method), this method must return NULL
 *
 * @param         $return_context: it was given and sent in the payment form. The notification should return it back.
 * Used to know which cart should be emptied, in case it is still in the session.
 * @param int     $virtuemart_order_id : payment  order id
 * @param char    $new_status : new_status for this order id.
 * @return mixed Null when this method was not selected, otherwise the true or false
 *
 * @author Valerie Isaksen
 *
 *
 	public function plgVmOnPaymentNotification() {
 	return null;
 	}
 
 	/**
 * plgVmOnPaymentResponseReceived
 * This event is fired when the  method returns to the shop after the transaction
 *
 *  the method itself should send in the URL the parameters needed
 * NOTE for Plugin developers:
 *  If the plugin is NOT actually executed (not the selected payment method), this method must return NULL
 *
 * @param int     $virtuemart_order_id : should return the virtuemart_order_id
 * @param text    $html: the html to display
 * @return mixed Null when this method was not selected, otherwise the true or false
 *
 * @author Valerie Isaksen
 *
 *
 	function plgVmOnPaymentResponseReceived(, &$virtuemart_order_id, &$html) {
 	return null;
 	}
 */
 function plgVmOnPaymentNotification()
 {
     if (!class_exists('VirtueMartModelOrders')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
     }
     $virtuemart_paymentmethod_id = JRequest::getInt('virtuemart_paymentmethod_id', '');
     $order_number = JRequest::getString('mer_txn', '');
     $status = JRequest::getString('f_code', '');
     if (!isset($order_number)) {
         return;
     }
     $method = $this->getVmPluginMethod($virtuemart_paymentmethod_id);
//.........这里部分代码省略.........
开发者ID:atomtechnologyltd,项目名称:Joomla_2.5,代码行数:101,代码来源:paynetz.php

示例15: getMyOrderDetails

    /**
     * This is a proxy function to return an order safely, we may set the getOrder function to private
     * Maybe the right place would be the controller, cause there are JRequests in it. But for a fast solution,
     * still better than to have it 3-4 times in the view.html.php of the views.
     * @author Max Milbers
     *
     * @return array
     */
    public function getMyOrderDetails($orderID = 0, $orderNumber = false, $orderPass = false){

        $_currentUser = JFactory::getUser();
        $cuid = $_currentUser->get('id');

		$orderDetails = false;
        // If the user is not logged in, we will check the order number and order pass
        if(empty($orderID) and empty($cuid)){
            // If the user is not logged in, we will check the order number and order pass
            if ($orderPass = vRequest::getString('order_pass',$orderPass)){
                $orderNumber = vRequest::getString('order_number',$orderNumber);
                $orderId = $this->getOrderIdByOrderPass($orderNumber,$orderPass);
                if(empty($orderId)){
                    echo vmText::_('COM_VIRTUEMART_RESTRICTED_ACCESS');
					vmdebug('getMyOrderDetails COM_VIRTUEMART_RESTRICTED_ACCESS',$orderPass,$orderNumber);
                    return false;
                }
                $orderDetails = $this->getOrder($orderId);
            }
        }
        else {
            // If the user is logged in, we will check if the order belongs to him
            $virtuemart_order_id = vRequest::getInt('virtuemart_order_id',$orderID) ;
            if (!$virtuemart_order_id) {
                $virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber(vRequest::getString('order_number'));
            }
            $orderDetails = $this->getOrder($virtuemart_order_id);

			$user = JFactory::getUser();
			if(!$user->authorise('core.admin','com_virtuemart')){
                if(!isset($orderDetails['details']['BT']->virtuemart_user_id)){
                    $orderDetails['details']['BT']->virtuemart_user_id = 0;
                }
                //if(!empty($orderDetails['details']['BT']->virtuemart_user_id)){
                vmdebug('getMyOrderDetails',$cuid,$orderDetails['details']['BT']->virtuemart_user_id);
                if ($orderDetails['details']['BT']->virtuemart_user_id != $cuid) {
                    echo vmText::_('COM_VIRTUEMART_RESTRICTED_ACCESS');
                    return false;
                }
                //}
            }

        }
        return $orderDetails;
    }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:53,代码来源:orders.php


注:本文中的VirtueMartModelOrders类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。