Example #1
0
 /**
  * Verify security token
  *
  * @param 	string	string token
  * @param   int     Transaction ID
  * @return	bool
  */
 public static function verifySecurityToken($token, $tId)
 {
     if (!Cart_Helper::isNonNegativeInt($tId, false)) {
         throw new Exception(Lang::txt('COM_CART_NO_TRANSACTION_FOUND'));
     }
     return md5(self::$securitySalt . $tId) == $token;
 }
Example #2
0
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * HUBzero is a registered trademark of Purdue University.
 *
 * @package   hubzero-cms
 * @author    Ilya Shunko <*****@*****.**>
 * @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
 * @license   http://opensource.org/licenses/MIT MIT
 */
// No direct access
defined('_HZEXEC_') or die;
$states = Cart_Helper::getUsStates();
$this->css();
?>

<header id="content-header">
	<h2>Checkout: shipping information</h2>
</header>

<?php 
if (!empty($this->notifications)) {
    $view = new \Hubzero\Component\View(array('name' => 'shared', 'layout' => 'notifications'));
    $view->notifications = $this->notifications;
    $view->display();
}
?>
Example #3
0
 /**
  * Set selected saved shipping addresses for this user
  *
  * @param int saved address ID
  * @return bool
  */
 public function setSavedShippingAddress($saId)
 {
     // check if the address correct
     if (!Cart_Helper::isNonNegativeInt($saId)) {
         throw new Exception(Lang::txt('COM_CART_INCORRECT_SAVED_SHIPPING_ADDRESS'));
     }
     $sql = "SELECT * FROM `#__cart_saved_addresses` WHERE `saId` = " . $this->_db->quote($saId);
     $this->_db->setQuery($sql);
     $this->_db->query();
     if ($this->_db->getNumRows() < 1) {
         throw new Exception(Lang::txt('COM_CART_INCORRECT_SAVED_SHIPPING_ADDRESS'));
     }
     $sql = "UPDATE `#__cart_transaction_info` ti, (SELECT * FROM `#__cart_saved_addresses` WHERE `saId` = " . $this->_db->quote($saId) . ") sa\n\t\t\t\tSET\n\t\t\t\tti.`tiShippingToFirst` = sa.`saToFirst`,\n\t\t\t\tti.`tiShippingToLast` = sa.`saToLast`,\n\t\t\t\tti.`tiShippingAddress` = sa.`saAddress`,\n\t\t\t\tti.`tiShippingCity` = sa.`saCity`,\n\t\t\t\tti.`tiShippingState` = sa.`saState`,\n\t\t\t\tti.`tiShippingZip` = sa.`saZip`\n\n\t\t\t\tWHERE ti.`tId` = {$this->cart->tId}";
     $this->_db->setQuery($sql);
     $this->_db->query();
     return true;
 }