<?php
include_once "lphp.php";
 

			$mylphp=new lphp;



		//if(getSettingsValue('vyourpay_mode')=='TEST')
		//{
			//$myorder["host"]       = "208.72.248.102";   //secure.linkpt.net for Live
			$myorder["host"]       = "staging.linkpt.net";

                        $myorder["result"]     = "LIVE";

//		}
//		else
//		{
//			$myorder["host"]       = "secure.linkpt.net";   //secure.linkpt.net for Live
//			$myorder["result"]     = "LIVE";
//		}
			$myorder["port"]       = "1129";

			//##Merchantinfo
			$myorder["keyfile"]    = "pem/1909778622.pem"; # Change this to the name and location of your certificate file
			$myorder["configfile"] ='1909778622'; # Change this to your store number
			//## Orderoptions

			 $myorder["ordertype"]    = "SALE" ; //The type of transaction. The possible values are SALE,PREAUTH,VOID,POSTAUTH,CREDIT, CALCSHIPPING

//			$yearlen=strlen($txtYY);
//
//			if($yearlen>2)
//			{
//				$CardYear= substr($txtYY,-2);
//			}
			# card info
			$myorder["cardnumber"]   = '4111111111111111' ;
			$myorder["cardexpmonth"] = '12';
			$myorder["cardexpyear"]  = '14';
			$myorder["cvmindicator"] = "provided";
			$myorder["cvmvalue"]     =  '123';
			//## Payment
			//$myorder["subtotal"]    = $totaltopay;
			//$myorder["tax"]         = number_format($totaltaxrate,2,".","");
			//$myorder["shipping"]    = number_format($shipping_cost,2,".","");
			//$myorder["vattax"]      = "0.00";
			$myorder["chargetotal"] = '21';
			// ## Billing
			$myorder["name"]      = 'Smitha';
			$myorder["address1"]  = 'Address';
			$myorder["address2"]  = 'Address2';
			$myorder["city"]      = 'galt';
			$myorder["state"]     = 'Albama';
			$myorder["country"]   = 'US';
			$myorder["phone"]     = '2131231';
			$myorder["email"]     = 'smitha.m@armiasystems.com';
			$myorder["fax"]    	  = '42342';
			$myorder["addrnum"]   = '';   # Required for AVS. The numeric portion of the street address If not provided, transactions will downgrade.
			$myorder["zip"]       ='35005'; # Required for AVS. Billing zip or postal code If not provided, transactions will downgrade.
			//$items = array();
			//$myorder["items"][0] = $items; # put array of items into hash

			$myorder["comments"] = "Item Purchase Information with  ".SITE_NAME." online store";

			$result = $mylphp->curl_process($myorder);  # use curl methods

                        echo "<pre>";
                        print_r($result);

			$transactionid		=	$result["r_ordernum"];



			if($transactionid != "" && $result["r_approved"] == "APPROVED") {
				$paymentsuccessful = true;
			}
			if ($result["r_approved"] != "APPROVED")	// transaction failed, print the reason
			{
				if($result["r_error"]=='<')
                                {
                                   $paymenterror = "Unable to process your payment. Try again later.";
                                }
                                  else
                                  {
                                    $paymenterror=$result["r_error"];
                                  }

				$msg_error=$paymenterror;
				$_SESSION['PAYMENT_ERROR']=$result["r_error"];
			}

?>
