I need help on my code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Man of God
Forum Newbie
Posts: 2
Joined: Mon Aug 19, 2013 4:00 am

I need help on my code

Post 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;

    	 
     }

}

?>
Last edited by requinix on Mon Aug 19, 2013 4:24 am, edited 1 time in total.
Reason: please use [syntax=php] tags when posting PHP code
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: I need help on my code

Post 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.
Man of God
Forum Newbie
Posts: 2
Joined: Mon Aug 19, 2013 4:00 am

Re: I need help on my code

Post by Man of God »

Please correct me. Please. I am not that good with php. But i am trying.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: I need help on my code

Post by requinix »

Step 1: Learn PHP.
Step 2: Escape the inner quotes.
Post Reply