示例#1
0
 function getMscInfo($msc_id, $osePaymentCurrency, $option = 0)
 {
     $node = oseMscTree::getNode($msc_id);
     $ext = array();
     $node = self::getExtSpecificPayment($node, $msc_id, 'a', $osePaymentCurrency, $option);
     return $node;
 }
    function get_gcoform($orderInfo)
    {
        $parameters =& JComponentHelper::getParams('com_osemsc');
        $google_checkout_id = $parameters->get('google_checkout_id');
        $html = array();
        if (empty($google_checkout_id)) {
            $html['form'] = "";
            return $html;
        }
        /*
        $db = &JFactory::getDBO();
        require_once (JPATH_ADMINISTRATOR . DS . "components" . DS . "com_osemsc" . DS . "warehouse" . DS . "public.php");
        $query = "SELECT name FROM `#__osemsc_acl` WHERE id = '{$msc_id}'";
        $db->setQuery($query);
        $msc_name = $db->loadResult();
        $query = "SELECT * FROM `#__osemsc_ext` WHERE id = '{$msc_id}' AND type='msc'";
        $db->setQuery($query);
        $msc_data = $db->loadObject();
        $msc_data = publicTools::parseParams($msc_data);
        */
        $msc_id = $orderInfo->entry_id;
        $node = oseMscTree::getNode($msc_id, 'obj');
        $msc_name = $node->title;
        $payment = oseMscAddon::getExtInfo($msc_id, 'payment', 'obj');
        $price = $orderInfo->payment_price;
        $currency = $orderInfo->payment_currency;
        $order_id = $orderInfo->order_id;
        $order_number = $orderInfo->order_number;
        //$renewal_discounts = $msc_data->renewal_discounts;
        //$promotion_code = $msc_data->promotion_code;
        //$promotion_discounts = $msc_data->promotion_discounts;
        //if ($user_promotion_code == $promotion_code)
        //{
        //	$amount = $amount * (1-$promotion_discounts/100);
        //}
        // Check if the user is a member of the membership
        //require_once(JPATH_ADMINISTRATOR.DS."components".DS."com_osemsc".DS."warehouse".DS."api.php");
        //$api=new OSEMSCAPI();
        ////if ($api->is_member($msc_id, $user_id)==true)
        //{
        //	if (!empty($renewal_discounts))
        //	{
        //		$amount = $amount * (1-$renewal_discounts/100);
        //		$a1= $a1 * (1-$renewal_discounts/100);
        //	}
        //}
        // Renewal discounts ends
        $vendor_image_url = "";
        $app =& JFactory::getApplication();
        $currentSession = JSession::getInstance('none', array());
        $stores = $currentSession->getStores();
        if ($currency == "GBP") {
            $country_code = "UK";
        } elseif ($currency == "USD") {
            $country_code = "US";
        }
        $url = "https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/" . $google_checkout_id;
        $post_variables = array("item_name_1" => JText::_('Order ID: ') . $order_id, "item_description_1" => JText::_('Payment for Membership Type: ') . $msc_name . "||" . $order_number, "item_merchant_id_1" => $order_id, "item_quantity_1" => "1", "item_price_1" => $price, "item_currency_1" => $currency, "continue_url" => JURI::base() . "index.php?option=com_osemsc&view=member&result=success");
        $html['form'] = '<form action="' . $url . '" method="post" target="_self" id="google" name="google"><input type="hidden" name="phpMyAdmin" value="octl53wDFSC-rSEy-S6gRa-jWtb" />';
        $html['form'] .= '<input id="gco-image" type="image" name="Google Checkout" alt="Fast checkout through Google"
				src="components/com_osemsc/assets/images/checkout.png?merchant_id=' . $google_checkout_id . '&style=white&variant=text&loc=en_US"/>';
        foreach ($post_variables as $name => $value) {
            $html['form'] .= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />';
        }
        $html['form'] .= '</form>';
        return $html;
    }
示例#3
0
 function getParentChildren($msc_id)
 {
     $node = oseMscTree::getNode($msc_id, 'obj');
     $db = oseDB::instance();
     oseDB::lock(' #__osemsc_acl READ;');
     $query = " SELECT *,CONCAT('(',ordering,')',title) AS displayText FROM `#__osemsc_acl`" . " WHERE parent_id = {$node->parent_id} ";
     $db->setQuery($query);
     //oseExit($db->_sql);
     $objs = oseDB::loadList();
     oseDB::unlock();
     return $objs;
 }
 function generateDesc($order_id)
 {
     $where = array(' order_id = ' . (int) $order_id);
     $orderItems = $this->getOrderItem($where, 'obj');
     $node = oseMscTree::getNode($orderItems->entry_id, 'obj');
     return JText::_('PAYMENT_FOR_ORDER') . $node->title . ' ' . JText::_('ORDER_ID') . ' ' . $order_id;
 }