phpScheduleIt
May 23, 2013, 07:55:25 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Paypal Integration  (Read 2914 times)
jaycee
Newbie
*

Karma: 0
Posts: 5


« on: December 07, 2008, 09:30:03 PM »

Hi,
Thank you for producing such a wonderful system.
I am trying to add a payment transaction through paypal but am stuck in the process. I have seen a previous similar thread at http://php.brickhost.com/forums/index.php?topic=2622.0 But my prices are not calculated on time basis but are fixed, based on packages. I have around 7 packages / schemes with 7 different prices. What I have done so far is to edit reservation.class.php, around line 459. I have added the paypal values in a database field and am calling the values from there.

Code:
/**
* Prints a message nofiying the user that their reservation was placed
* @param string $verb action word of what kind of reservation process just occcured
* @param array $dates dates that were added or modified.  Deletions are not printed.
*/
function print_success($verb, $dates = array()) {
echo '<script language="JavaScript" type="text/javascript">' . "\n"
. 'window.opener.document.location.href = window.opener.document.URL;' . "\n"
. '</script>';

$paypal_id = $row_palID['pal_id'];

$date_text = '';
for ($i = 0; $i < count($dates); $i++) {
$date_text .= Time::formatReservationDate($dates[$i], $this->start) . '<br/>';
}
CmnFns::do_message_box(translate('Your ' . $this->word . ' was successfully ' . $verb . $res['starttime'])
. (($this->type != 'd') ? ' ' . translate('for the follwing dates') . '<br /><br />' : '.')
. $date_text . '<br/><br/>'
. '
<FORM ACTION="https://www.paypal.com/cgi-bin/webscr" target=" mainWindow" onSubmit=" self.close();" METHOD="POST">
<input type="hidden" name="cmd" value="_s-xclick">
<input name="hosted_button_id" type="hidden" value="'. $paypal_id .'">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG_global.gif" border="0" name="submit" alt="">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">'

. '</FORM>'
. 'Your reservation is complete only when the payment is done.'
, 'width: 90%;');
}
   

Here comes a problem. If I add a physical value at
Code:
value="'. $paypal_id .'"
like
Code:
value="123456"
the value get passed, but if I use
Code:
"'. $paypal_id .'"
the resulting form value is
Code:
value=" "
. Can someone help me please
Thanks
Jay
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #1 on: December 08, 2008, 01:53:35 PM »

Is anything coming back from:
Code:
$row_palID['pal_id'];
?
Logged
jaycee
Newbie
*

Karma: 0
Posts: 5


« Reply #2 on: December 08, 2008, 02:31:17 PM »

Yes, When I echo  $row_palID['pal_id']; I get the right result. I did to this to see for debugging purpose and the result is fine.
Logged
jaycee
Newbie
*

Karma: 0
Posts: 5


« Reply #3 on: December 09, 2008, 01:03:41 AM »

I know this is not the right way, but in desperate emergency, can I have 7 reservation files ( i have 7 items to sell) each linked to 7 different class files with static pay pal values? If this is the case how can call individual files from schedule.php?

Logged
jaycee
Newbie
*

Karma: 0
Posts: 5


« Reply #4 on: December 09, 2008, 09:07:17 AM »

Nick,
Can you please help me!!  Embarrassed
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #5 on: December 09, 2008, 02:26:13 PM »

I have no idea how the paypal integration works, so my best suggestion would be to echo out anything that is different from the out of the box code by itself instead of concatenating it in the do_message_box()
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!