Page 1 of 1

I need help on my code

Posted: Mon Aug 19, 2013 4:16 am
by Man of God
kindly look at this code, it is not calling up the payment gateway. Please help

Code: Select all

<?php
defined('_JEXEC') OR die('Restricted Area');
error_reporting(0);
 
class vikBookingPayment {
     
    private $order_info;
     
    public function __construct ($order) {
        $this->order_info=$order;
    }

    /** This is the method showPayment() */    
    public function showPayment () {
        
	$depositmess="";
 
	      	    	
	$form="<form action=\"https://cipg.diamondbank.com/cipg/MerchantServices/MakePayment.aspx" method="post" target="_top" id="upay_form" name="upay_form" >";
	$form.="<input type=\"hidden\" name=\"mercId\" value=\"0111\"/>";
	$form.="<input type=\"hidden\" name=\"currCode\" value=\"566\"/>";
	$form.="<input type=\"hidden\" name=\"amt\" value=\"".$this->order_info['total_to_pay']."\"/>";
	$form.="<input type=\"hidden\" name=\"orderId\" value=\"".$this->order_info['transaction_name']."\"/>";
	$form.="<input type=\"hidden\" name=\"prod\" value=\"".$this->order_info['rooms_name']."\"/>";
	$form.="<input type=\"hidden\" name=\"email\" value=\"".$this->order_info['account_name']."\"/>";

    	$form.="<input type=\"submit\" name=\"submit\" value=\"Pay\"/>";
    	

        $form.="</form>";
	if($this->order_info['leave_deposit']) {

			$depositmess="<p><strong>".JText::_('VBLEAVEDEPOSIT')." ".number_format($this->order_info['total_to_pay'], 2)." ".$this->order_info['currency_symb']."</strong></p><br/>";

		}

		//output form

		echo $depositmess;

		echo $this->order_info['payment_info']['note'];

		echo $form;

		

		return true;

    	 
     }

}

?>

Re: I need help on my code

Posted: Mon Aug 19, 2013 4:25 am
by requinix
Well, I do see a big ol' syntax problem with

Code: Select all

 $form="<form action=\"https://cipg.diamondbank.com/cipg/MerchantServices/MakePayment.aspx" method="post" target="_top" id="upay_form" name="upay_form" >";
that line.

Re: I need help on my code

Posted: Mon Aug 19, 2013 4:39 am
by Man of God
Please correct me. Please. I am not that good with php. But i am trying.

Re: I need help on my code

Posted: Mon Aug 19, 2013 12:42 pm
by requinix
Step 1: Learn PHP.
Step 2: Escape the inner quotes.