public function postCheckout()
 {
     $payer = PayPal::Payer();
     $payer->setPaymentMethod('paypal');
     $amount = PayPal::Amount();
     $amount->setCurrency('USD');
     $amount->setTotal(intval(\Cart::getTotal()) / 20);
     // This is the simple way,
     // you can alternatively describe everything in the order separately;
     // Reference the PayPal PHP REST SDK for details.
     $transaction = PayPal::Transaction();
     $transaction->setAmount($amount);
     $transaction->setDescription('Thanh Toán Mua Hàng Từ Couponia?');
     $redirectUrls = PayPal::RedirectUrls();
     $redirectUrls->setReturnUrl(\Redirect::getUrlGenerator()->route('paypal-done'));
     $redirectUrls->setCancelUrl(\Redirect::getUrlGenerator()->route('paypal'));
     $payment = PayPal::Payment();
     $payment->setIntent('sale');
     $payment->setPayer($payer);
     $payment->setRedirectUrls($redirectUrls);
     $payment->setTransactions(array($transaction));
     $response = $payment->create($this->_apiContext);
     $redirectUrl = $response->links[1]->href;
     return \Redirect::to($redirectUrl);
 }
Beispiel #2
0
 public function loadFromCart(Cart $cart)
 {
     $shopInfo = new ShopInfo($cart->module_srl);
     $this->cart_srl = $cart->cart_srl;
     $this->module_srl = $cart->module_srl;
     $this->member_srl = $cart->member_srl;
     $this->client_name = $cart->getBillingAddress()->firstname . ' ' . $cart->getBillingAddress()->lastname;
     $this->client_email = $cart->getBillingAddress()->email;
     $this->client_company = $cart->getBillingAddress()->company;
     $this->billing_address = (string) $cart->getBillingAddress();
     $this->shipping_address = (string) $cart->getShippingAddress();
     $this->payment_method = $cart->getPaymentMethodName();
     $this->shipping_method = $cart->getShippingMethodName();
     $this->shipping_variant = $cart->getShippingMethodVariant();
     $this->shipping_cost = $cart->getShippingCost();
     $this->total = $cart->getTotal(true);
     $this->vat = $shopInfo->getVAT() ? $shopInfo->getVAT() : 0;
     $this->order_status = Order::ORDER_STATUS_PENDING;
     $this->ip = $_SERVER['REMOTE_ADDR'];
     $this->currency = $shopInfo->getCurrency();
     if ($discount = $cart->getDiscount()) {
         $this->discount_min_order = $discount->getMinValueForDiscount();
         $this->discount_type = $shopInfo->getShopDiscountType();
         $this->discount_amount = $discount->getReductionValue();
         $this->discount_tax_phase = $discount->calculateBeforeApplyingVAT() ? 'pre_taxes' : 'post_taxes';
         $this->discount_reduction_value = $discount->getReductionValue();
     }
     if ($coupon = $cart->getCoupon()) {
         $this->coupon_discount_value = $cart->getCouponDiscount();
     }
 }
Beispiel #3
0
 /**
  * @see		ApplicationView::createUserInterface()
  */
 protected function createUserInterface()
 {
     parent::createUserInterface();
     $this->addStyle('/css/cart.css');
     $resourceBundle = Application::getInstance()->getBundle();
     $products = $this->cart->getProducts();
     if (count($products) == 0) {
         $this->contentPanel->addChild(new Heading(2))->addChild(new Text($resourceBundle->getString('CART_NO_PRODUCT')));
     } else {
         $this->contentPanel->addChild(new CartList())->setProductList($products);
         $totalParagraph = $this->contentPanel->addChild(new Paragraph())->addStyle('cart-total');
         //Total do carrinho
         $totalParagraph->addChild(new Strong())->addChild(new Text($resourceBundle->getString('CART_TOTAL')));
         $totalParagraph->addChild(new Span())->addChild(new Text(money_format($resourceBundle->getString('MONEY_FORMAT'), $this->cart->getTotal())));
         //Botão de checkout
         $totalParagraph->addChild(new Anchor('/?c=cart&a=checkout'))->addStyle('checkout')->addChild(new Text($resourceBundle->getString('CART_CHECKOUT')));
     }
 }
Beispiel #4
0
                $unit = 'Rupees ';
            };
        
        array_walk($this->products, $callback);
        return $unit .round($total, 2);
    }
}

$my_cart = new Cart;
// Add some items to the cart
$my_cart->add('butter', 1);
$my_cart->add('milk', 3);
$my_cart->add('eggs', 6);
$my_cart->getArray(); //Array ( [butter] => 1 [milk] => 3 [eggs] => 6 ) 
// Print the total with a 5% sales tax.
print $my_cart->getTotal(0.05) . "\n";
// The result is 54.29
?>
<?php
#Example #2 Passing function parameters by reference
function add_some_extra(&$string)
{
    $string .= 'and something extra.'. "\n\n";
}
$str = "\n\n" . 'This is a string, ';
add_some_extra($str);
echo $str;    // outputs 'This is a string, and something extra.'
//if passed not by reference it will outputs 'This is a string' only.
?>
<?php
#Example #2 Passing function parameters by reference
Beispiel #5
0
 /**
  * cart model to maitain items array
  * in cart befor it is been posted to 
  * the purchases table
  */
 public function doAddToCart()
 {
     $basket = new Cart();
     $mcart = "";
     $basket->addItem($_POST['ppid'], $_POST['ppname'], $_POST['pcatname'], $_POST['pqty'], $_POST['pprice']);
     $myItems = $basket->getContents();
     // the basket get arrays of items in the cart
     $quantity = $_POST['pqty'];
     $subTotal = $basket->getTotal();
     // the basket gets the total of the items as subtotal
     $vat = 0.05 * $subTotal;
     // calculates the vat
     $total = $subTotal + $vat;
     $mcart .= "<table id='minicart-a' summary='Employee Pay Sheet'>\n    <thead>\n    \t<tr>\n            <th width='10%' scope='col'>ItemID</th>\n        \t<th width='35%' scope='col' >Description</th>\n            <th width='20%' scope='col'>Qty</th>\n            <th width='10%' scope='col'>Cost</th>\n            <th width='10%' scope='col'>Total</th>\n            \n        </tr>\n    </thead>\n    <tbody>";
     //print_r($item['itemName']);
     $qt = 0;
     foreach ($myItems as $item) {
         $myproduct = Items::find_by_id($item['itemId']);
         //print_r($myproduct);
         $mcart .= "<tr>\n              \n              <td>" . $item['itemName'] . "</td>\n              <td>" . $myproduct->item_description . "</td>\n              <td><span>\n                <input type='text' name='qty' id='qty" . $qt . "' value='" . $item['itemQuantity'] . "' style='width:40px; padding:2px; height:36px; text-align:center; '  />\n              </span>&nbsp;&nbsp;<span><a href='#' class='modifyqty' prodid='" . $item['itemId'] . "' prodqty='" . $item['itemQuantity'] . "'  tprice='" . $item['itemPrice'] . "' count ='" . $qt . "' ><img src='public/icons/Refresh16.png' width='18' height='18' /></a></span>&nbsp;&nbsp;<span><a href='#' class='deleteitem' prodid='" . $item['itemId'] . "'  ><img src='public/icons/Delete16.png' width='18' height='18' /></a></span></td>\n              <td>&#8358;" . number_format($item['itemPrice'], 2, '.', ',') . "</td>\n              <td>&#8358;" . number_format($item['itemTotal'], 2, '.', ',') . "</td>\n            </tr>";
         $qt++;
     }
     /**
      * foreach($myItems as $item){
      *     	$mcart .="<tr>
      *         	<td>".$item['itemQuantity']."</td>
      *             <td>".$item['itemName']."</td>
      *             <td>&#8358;".$item['itemName']."</td>
      *             <td>".number_format($item['itemPrice'],2,'.',',')."</td>
      *             <td><span class='bold'>&#8358;".number_format($item['itemTotal'],2,'.',',')."</span></td>
      *             <td><span class='bold'>x</span></td>
      *         </tr>
      *         
      *         ";
      * 	}
      */
     $mcart .= "<tr>\n        \t<td>&nbsp;</td>\n            <td>&nbsp;</td>\n            <td>&nbsp;</td>\n            <td>&nbsp;</td>\n            <td>&nbsp;</td>\n        </tr>       \n\t    <tr>\n          <td>&nbsp;</td>\n          <td colspan='3' align='right'><h3 class='black'>SubTotal:</h3></td>\n          <td colspan='3' align='right'><span class='bold'>&#8358;" . number_format($subTotal, 2, '.', ',') . "</span></td>\n        </tr>\n        <tr>\n          <td>&nbsp;</td>\n          <td colspan='3' align='right'><h3 class='black'>VAT(5%):</h3></td>\n          <td colspan='3' align='right'><span class='bold'>&#8358;" . number_format($vat, 2, '.', ',') . "</span></td>\n        </tr>\n        <tr>\n          <td>&nbsp;</td>\n          <td colspan='3' align='right'><h3><span class='black'>Total:</span></h3></td>\n          <td colspan='3' align='right'><div class='divider'></div><h3 class='bold'>&#8358;" . number_format($total, 2, '.', ',') . "</h3><div class='divider'></div><div class='divider'></div></td>\n        </tr>\n        <tr>\n        \t<td>&nbsp;</td>\n            <td colspan='3' align='right'><span style='margin:5px'><a href='#'>view cart</a></span></td>\n            <td colspan='3'><span style='margin:5px'><a href='#'>Check out</a></span></td>\n            </tr>\n    </tbody>\n</table>";
     print_r($mcart);
 }
Beispiel #6
0
 public function postCheckout(Request $request)
 {
     \DB::beginTransaction();
     $customer = Customer::create($request->all());
     $order = $customer->orders()->create(['quantity' => \Cart::getTotalQuantity(), 'total' => \Cart::getTotal(), 'shipped' => false]);
     foreach (\Cart::getContent() as $cart) {
         $order->details()->create(['deal_id' => $cart->id, 'quantity' => $cart->quantity, 'price' => $cart->price]);
     }
     $order->push();
     $customer->push();
     \DB::commit();
     \Cart::clear();
     return view('frontend.checkout.done')->with('categories', Category::all());
 }
Beispiel #7
0
    {
        $this->p[$k] = (double) $p;
    }
    public function getTotal($tax)
    {
        $sum = 0;
        array_walk($this->p, function ($val) use($tax, &$sum) {
            $sum += $val * ($tax + 1.0);
        });
        return $sum;
    }
}
$cart = new Cart();
$cart->addProduct('apple', 10);
$cart->addProduct('rasberry', 45);
echo $cart->getTotal(0.196);
var_dump('------- static private-------');
$sum = function ($v) {
    return function () use($v) {
        return ++$v;
    };
};
$r = $sum(10);
echo $r();
$r = $sum(10);
echo $r();
var_dump('---------- Exemple de contexte global pour une variable PHP');
$val = 10;
function baz()
{
    $val = 11;
 public function action_credit()
 {
     if (!$this->check_logged()) {
         \Messages::error('You must be logged in if you want to continue with your order.');
         \Response::redirect(\Uri::create('order/checkout/address'));
     }
     if (!\Input::post()) {
         throw new \HttpNotFoundException();
     }
     if (\Input::post('order_type') == 'payment') {
         \Response::redirect(\Uri::create('order/checkout/payment'));
     }
     $credit_account = \Order\Model_Order::credit_account(null, \Cart::getTotal('price'));
     if (\Input::post('order_type') != 'credit') {
         \Messages::error('There was an error while trying to save your order.');
         \Response::redirect(\Input::referrer(\Uri::create('order/checkout/cost')));
     }
     if (!$credit_account['credit'] || $credit_account['over_limit']) {
         \Messages::error("You don't have permission for this action.");
         \Response::redirect(\Input::referrer(\Uri::create('order/checkout/cost')));
     }
     $user = \Sentry::user();
     if ($order = $this->save_order()) {
         $payment = \Payment\Model_Payment::forge();
         $payment->order_id = $order->id;
         $payment->total_price = $order->total_price;
         $payment->method = 'credit';
         $payment->status = 'ordered';
         $payment->status_detail = 'Credit Account';
         $payment->save();
         $this->autoresponder($user, $order);
         \Response::redirect(\Input::referrer(\Uri::create('order/checkout/complete/' . $order->id)));
     }
     \Messages::error('There was an error while trying to save your order.');
     \Response::redirect(\Input::referrer(\Uri::create('order/checkout/cost')));
 }
Beispiel #9
0
 public function action_credit()
 {
     if (!$this->check_logged()) {
         \Messages::error('You must be logged in if you want to continue with your order.');
         \Response::redirect(\Uri::create('order/checkout/address'));
     }
     if (!\Input::post()) {
         throw new \HttpNotFoundException();
     }
     if (\Input::post('order_type') == 'payment') {
         \Response::redirect(\Uri::create('order/checkout/payment'));
     }
     $credit_account = \Order\Model_Order::credit_account(null, \Cart::getTotal('price'));
     if (\Input::post('order_type') != 'credit') {
         \Messages::error('There was an error while trying to save your order.');
         \Response::redirect(\Input::referrer(\Uri::create('order/checkout/cost')));
     }
     if (!$credit_account['credit'] || $credit_account['over_limit']) {
         \Messages::error("You don't have permission for this action.");
         \Response::redirect(\Input::referrer(\Uri::create('order/checkout/cost')));
     }
     $items = \Cart::items();
     $user = \Sentry::user();
     if ($order = $this->save_order()) {
         $payment = \Payment\Model_Payment::find_one_by_order_id($order->id);
         if (!isset($payment)) {
             $payment = \Payment\Model_Payment::forge();
         }
         $total_price = $order->total_price ? $order->total_price + $order->shipping_price - $order->discount_amount : $order['total_price'] + $order['shipping_price'] - $order['discount_amount'];
         $payment->set(array('order_id' => $order->id, 'total_price' => $total_price, 'method' => 'credit', 'status' => 'ordered', 'status_detail' => 'Credit Account'));
         $payment->save();
         $this->autoresponder($user, $order);
         \Response::redirect(\Input::referrer(\Uri::create('order/checkout/complete/' . $order->id)));
     }
     \Messages::error('There was an error while trying to save your order.');
     \Response::redirect(\Input::referrer(\Uri::create('order/checkout/cost')));
 }
Beispiel #10
0
    /**
     * Test cart when a product becomes unavailable (deleted / out of stock)
     * after the user has already added it to the cart
     */
    public function testCartTotal_WithUnavailableProducts()
    {
        $module_srl = 107;
        $cart_srl = 774;
        $deleted_product_srl = 133;

        // Act: delete one product from xe_products but keep it in cart
        $product_repository = new ProductRepository();
        $args = new stdClass();
        $args->product_srl = $deleted_product_srl;
        $product_repository->deleteProduct($args);

        $cart = new Cart($cart_srl);

        // Assert
        // 1. Check that cart has expected products
        $this->assertEquals(1, count($cart->getProducts(NULL, TRUE))); // When $onlyAvailable is true, count just availablel products
        $this->assertEquals(2, count($cart->getProducts())); // Default, , show all products

        // 3. Check that item total is correct
        $this->assertEquals(29.99, $cart->getItemTotal()); // Count just available products

        // 4. Check global total is correct (includes shipping +10)
        $this->assertEquals(39.99, $cart->getTotal(), '', 0.01); // Count just available products
    }
Beispiel #11
0
<?php

namespace CoR2;

$promo = Promo::init();
$cart = new Cart();
$cart->setPromo($promo);
$cart->add('A0001', 1);
$cart->add('A0002', 2);
$cart->add('B0001', 1);
$cart->add('B0002', 2);
$cart->add('C0001', 1);
$cart->add('C0002', 2);
$cart->calculate();
$cart->listAll();
echo $cart->getTotal(), "\n";
class Cart
{
    protected static $_priceTable = ['A0001' => 100, 'A0002' => 150, 'B0001' => 300, 'B0002' => 200, 'C0001' => 200, 'C0002' => 200];
    protected $_total = 0;
    protected $_items = [];
    protected $_promo = null;
    public function setPromo(Promo $promo)
    {
        $this->_promo = $promo;
    }
    public function add($sn, $quantity)
    {
        $price = static::$_priceTable[$sn];
        $price = $this->_promo->calculate($sn, $price);
        $this->_items[$sn] = [$price, $quantity];
    /**
     * Handles all IPN notifications from Paypal
     */
    public function notify($cart)
    {
        // 1. Retrieve all POST data received and post back to paypal, to make sure
        // the request sender is not fake

        // Do not retrieve data with Context::getRequestVars() because it skips empty values
        // causing the Paypal validation to fail
        $args = $_POST;
        if(__DEBUG__)
        {
            ShopLogger::log("Received IPN Notification: " . http_build_query($args));
        }

        $response = $this->postDataBackToPaypalToValidateSenderIdentity($args);

        if($response->isVerified())
        {
            ShopLogger::log("Successfully validated IPN data");

            $payment_info = $this->getIPNPaymentInfo($args);

            if(!$payment_info->isRelatedToCartPayment())
                return;

            // 2. If the source of the POST is correct, we now need to check that data is also valid
            if(!$order = $this->orderCreatedForThisTransaction($payment_info->txn_id))
            {
                // check that receiver_email is your Primary PayPal email
                if(!$payment_info->paymentReceiverIsMe($this->business_account))
                {
                    ShopLogger::log("Possible fraud - invalid receiver email: " . $payment_info->receiver_email);
                    $this->markTransactionAsFailedInUserCart(
                        $payment_info->cart_srl,
                        $payment_info->txn_id,
                        "There was a problem processing your payment. Your order could not be completed."
                    );
                    return;
                }

                // check the payment_status is Completed
                if(!$payment_info->paymentIsComplete())
                {
                    ShopLogger::log("Payment is not completed. Payment status [" . $payment_info->payment_status. "] received");
                    $this->markTransactionAsFailedInUserCart(
                        $payment_info->cart_srl,
                        $payment_info->txn_id,
                        "Your payment was not completed. Your order was not created."
                    );
                    return;
                }

                $cart = new Cart($payment_info->cart_srl);
                if(!$payment_info->paymentIsForTheCorrectAmount($cart->getTotal(), $cart->getCurrency()))
                {
                    ShopLogger::log("Invalid payment. " . PHP_EOL
                        . "Payment amount [" . $payment_info->payment_amount . "] instead of " . $cart->getTotal() . PHP_EOL
                        . "Payment currency [" . $payment_info->payment_currency . "] instead of " . $cart->getCurrency()
                    );
                    $this->markTransactionAsFailedInUserCart(
                        $payment_info->cart_srl,
                        $payment_info->txn_id,
                        "Your payment was invalid. Your order was not created."
                    );
                    return;
                }

                // 3. If the source of the POST is correct, we can now use the data to create an order
                // based on the message received
                $this->createNewOrderAndDeleteExistingCart($cart, $payment_info->txn_id);
            }
        }
        else
        {
            ShopLogger::log("Invalid IPN data received: " . $response);
        }

    }
Beispiel #13
0
	/**
	 * Process the payment
	 *
	 * @param Cart $cart
	 * @param      $error_message
	 * @return bool|mixed
	 */
	public function processPayment(Cart $cart, &$error_message)
    {
		$cc_number = Context::get('cc_number');
		$cc_exp_month = Context::get('cc_exp_month');
		$cc_exp_year = Context::get('cc_exp_year');
		$cc_cvv = Context::get('cc_cvv');

		// Unset credit card info so that XE won't put it in session
		Context::set('cc_number', NULL);
		Context::set('cc_exp_month', NULL);
		Context::set('cc_exp_year', NULL);
		Context::set('cc_cvv', NULL);

		if(!$cc_number)
		{
			$error_message = "Please enter you credit card number"; return FALSE;
		}
		if(!$cc_exp_month || !$cc_exp_year)
		{
			$error_message = "Please enter you credit card expiration date"; return FALSE;
		}
		if(!$cc_cvv)
		{
			$error_message = "Please enter you credit card verification number"; return FALSE;
		}

		$cc_number = str_replace(array(' ', '-'), '', $cc_number);
		if (!preg_match ('/^4[0-9]{12}(?:[0-9]{3})?$/', $cc_number) // Visa
			&& !preg_match ('/^5[1-5][0-9]{14}$/', $cc_number) // MasterCard
			&& !preg_match ('/^3[47][0-9]{13}$/', $cc_number) // American Express
			&& !preg_match ('/^6(?:011|5[0-9]{2})[0-9]{12}$/', $cc_number) //Discover
		){
			$error_message = 'Please enter your credit card number!';
		}

		$cc_exp = sprintf('%02d%d', $cc_exp_month, $cc_exp_year);

        $transaction = new AuthorizeNetAim($this->api_login_id, $this->transaction_key);
		// 1. Set payment info
		$transaction->amount = $cart->getTotal();
        $transaction->card_num = $cc_number;
        $transaction->exp_date = $cc_exp;
		$transaction->invoice_num = $cart->cart_srl;

		// 2. Set billing address info
		$transaction->first_name = $cart->getCustomerFirstname();
		$transaction->last_name = $cart->getCustomerLastname();
		$transaction->company = $cart->getBillingAddress()->company;
		$transaction->address = $cart->getBillingAddress()->address;
		$transaction->city = $cart->getBillingAddress()->city;
		$transaction->zip = $cart->getBillingAddress()->postal_code;
		$transaction->country = $cart->getBillingAddress()->country;
		$transaction->email = $cart->getBillingAddress()->email;

		// 3. Set shipping address info
		$transaction->ship_to_first_name = $cart->getShippingAddress()->firstname;
		$transaction->ship_to_last_name = $cart->getShippingAddress()->lastname;
		$transaction->ship_to_company = $cart->getShippingAddress()->company;
		$transaction->ship_to_address = $cart->getShippingAddress()->address;
		$transaction->ship_to_city = $cart->getShippingAddress()->city;
		$transaction->ship_to_zip = $cart->getShippingAddress()->postal_code;
		$transaction->ship_to_country = $cart->getShippingAddress()->country;

        $response = $transaction->authorizeAndCapture();

        if ($response->approved) {
            return TRUE;
        } else {
			ShopLogger::log("Authorize.NET transaction failed: " . print_r($response, TRUE));
            $error_message = "There was a problem with charging your credit card; Please try again or try a different payment method";
            return FALSE;
        }
    }
    function _checkout_step_2($values = null, $errors = null)
    {
        $cart = new Cart('shopping_cart');
        //get promo discount
        $discount_text = '';
        if (isset($_SESSION['order']['promo_code'])) {
            $discount = $cart->getDiscount($_SESSION['order']['promo_code']);
            if ($discount > 0) {
                $discount_text = '...including -$' . number_format($discount, 2) . ' discount.';
            }
        } else {
            $discount = 0;
        }
        //get total
        $total = number_format($cart->getTotal() + $cart->getTax() - $discount, 2);
        //get taxes
        $taxes = number_format($cart->getTax(), 2);
        $output = '	
		<div id="checkout">
		<div id="summary"><h3 class="price">$' . $total . '</h3>
		<i>...including FREE shipping.<br />
		...including $' . $taxes . ' taxes.<br />
		' . $discount_text . '</i></div>
		<p id="step">step 2 of 2</p>
		<form action="" method="post">
		<input type="hidden" name="step" value="2" />
		
		<h3>Shipping Information</h3>
		
		<p>Shipping is <strong>FREE</strong></p>
		
		<h3>Payment Information</h3>
		
		<table border="0" id="checkout">
			<tr>
				<td class="label" nowrap="1"><label for="cc_name">Name:</label></td>
				<td class="field"><input type="text" name="order[cc_name]" size="30" value="' . htmlentities($values['order']['cc_name']) . '" /> ' . $this->_field_error($errors, 'cc_name') . '</td>
			</tr>
			<tr>
				<td class="label" nowrap="1"><label for="cc_type">Card Type:</label></td>
				<td class="field">
					<select name="order[cc_type]">
						<option value="">-- Select Card --</option>	
						' . str_replace('value="' . $values['order']['cc_type'] . '"', 'value="' . $values['order']['cc_type'] . '" selected="selected"', $this->_cc_type_options()) . '
					</select> ' . $this->_field_error($errors, 'cc_type') . '
				</td>
			</tr>
			<tr>
				<td class="label" nowrap="1"><label for="cc_number">Card Number:</label></td>
				<td class="field"><input type="text" name="order[cc_number]" size="30" value="' . htmlentities($values['order']['cc_number']) . '" /> ' . $this->_field_error($errors, 'cc_number') . '</td>
			</tr>
			<tr>
				<td class="label" nowrap="1"><label for="cc_cvv">CVV:</label></td>
				<td class="field"><input type="text" name="order[cc_cvv]" size="4" value="' . htmlentities($values['order']['cc_cvv']) . '" /> ' . $this->_field_error($errors, 'cc_cvv') . ' <a href="javascript:void(0);" onclick="$(\'cvv\').toggle();">what is this?</a>
				
				<div id="cvv" style="display: none;">
					<p>For MasterCard or Visa, it\'s the last three digits in the signature area on the back of your card. For American Express, it\'s the four digits on the front of the card.
				</div>
				
				</td>
			</tr>
			<tr>
				<td class="label" nowrap="1"><label for="cc_exp_month">Expiration Date:</label></td>
				<td class="field">
					<select name="order[cc_exp_month]">
						<option value="">-- Month --</option>
						' . str_replace('value="' . $values['order']['cc_exp_month'] . '"', 'value="' . $values['order']['cc_exp_month'] . '" selected="selected"', $this->_cc_exp_month_options()) . '
					</select> ' . $this->_field_error($errors, 'cc_exp_month') . '
			
					<select name="order[cc_exp_year]">
						<option value="">-- Year --</option>	
						' . str_replace('value="' . $values['order']['cc_exp_year'] . '"', 'value="' . $values['order']['cc_exp_year'] . '" selected="selected"', $this->_cc_exp_year_options()) . '
					</select> ' . $this->_field_error($errors, 'cc_exp_year') . '
				</td>
			</tr>
		</table>
		
		<hr />
		
		<p>
			<input class="button" type="submit" value="Complete my purchase" /> or 
			<a href="/products/types">cancel, and continue shopping</a>
		</p>
		
		</form>
		</div>
		';
        return $output;
    }