Only 10 credits posting to db

16 years 1 week ago #3478 by billybojangles
Hello

I need some help please..  No matter what option I choose from the drop down after the payment is sent via PayPal the user account is ONLY credited 10 vodes.

I noticed right under my amount list that
<input type="hidden" name="item_number" value="1" /> and in the vodes.php I found this

// process the payment

if ($item_number == 1) {

// Vodes

// 10 Euros = 100 vodes
$credit = ceil($payment_amount)*10;

Am I suppose to change that? or redefine the item_number somehow?


Here is my vodes.html.php

<?php
/**
* @Vodes
* @Copyright (C) 2005 Emir Sakic, www.sakic.net
* @All Rights Reserved
*/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

global $vode_config;

class HTML_vodes {

function header() {
?>

<table class="contentpaneopen">
<tr>
<td class="contentheading" width="100%">Buy Credits</td>
</tr>
</table>
<table class="contentpaneopen">
<tr>
<td valign="top">
<?php
}

function footer() {
?>
</td>
</tr>
</table>
<table border="0" align="center"><tbody><tr><td><p><img src="images/stories/level1.png" border="0" /> </p><p> </p></td><td> </td><td><p><img src="images/stories/level2.png" border="0" /> </p><p> </p></td></tr><tr><td> </td><td> </td><td> </td></tr><tr><td><p><img src="images/stories/level3.png" border="0" /></p><p> </p></td><td> </td><td><p> <img src="images/stories/level4.png" border="0" /></p><p> </p></td></tr></tbody></table>
<?php
}

function display_vodes_form($item) {
global $my, $vode_config;

echo _VODE_INTRO;
echo "

";

if (!$my->username) {
echo "<font color=\"red\"><b>"._VODE_NOT_LOGGED_IN."</b>
";
echo _VODE_PAY_INFO;
echo "</font>

";
}
?>
<script language="JavaScript" type="text/javascript">
<!--
function checkform(){
if ((document.payment.os0.value=='') || (document.payment.os0.value==' ')){
alert('<?php echo _VODE_USERNAME_EMPTY; ?>');
return false;
} else {
return true;
}
}
//-->
</script>

<?php
if ($vode_config->sandbox == 1) {
?>
<form name="payment" action=" www.sandbox.paypal.com/cgi-bin/webscr " method="post" onsubmit="javascript: return checkform();">
<input type="hidden" name="business" value="<?php echo $vode_config->sandbox_email; ?>" />
<?php
} else {
?>
<form name="payment" action=" www.paypal.com/cgi-bin/webscr " method="post" onsubmit="javascript: return checkform();">
<input type="hidden" name="business" value="<?php echo $vode_config->paypal_email; ?>" />
<?php
}
?>
<b><?php echo _VODE_VODES; ?></b>



<b><?php echo _VODE_AMOUNT; ?>:</b>

<select name="amount">
<option value="14.95">14.95 $ (15 <?php echo _VODE_VODES; ?>)</option>
<option value="27.95">27.95 $ (30 <?php echo _VODE_VODES; ?>)</option>
<option value="0.99">.99 $ (50 <?php echo _VODE_VODES; ?>)</option>
<option value="89.95">89.95 $ (100 <?php echo _VODE_VODES; ?>)</option>
</select>
<input type="hidden" name="item_number" value="1" />
<input type="hidden" name="item_name" value="Credits" />




<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="on0" value="username" />
<b><?php echo _VODE_USERNAME_LABEL; ?>:</b>

<input type="text" class="inputbox" size="20" name="os0" value="<?php echo $my->username; ?>" />

<small><?php echo _VODE_USERNAME_CHECK; ?></small>

<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="notify_url" value="<?php echo $GLOBALS; ?>/index.php?option=com_vodes&task=paypal" />
<input type="hidden" name="return" value="<?php echo $GLOBALS; ?>/index.php?option=com_vodes&task=complete" />
<input type="hidden" name="cancel_return" value="<?php echo $GLOBALS; ?>/index.php?option=com_vodes&task=cancel" />
<input type="hidden" name="tax" value="0" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="no_shipping" value="1" />


<input type="image" src="components/com_vodes/images/x-click-but23.gif" border="0" name="submit" alt="Payments with PayPal - it's fast, free and secure!" />
</form>

<?php echo _VODE_FOOTER; ?>

<?php
}

function display_complete() {
?>
<p><b><font color="#FF0000"><?php echo _VODE_THANKS; ?></font></b>



<?php echo _VODE_COMPLETE; ?></p>
<?php
}

function display_cancel() {
?>
<p><b><font color="#FF0000"><?php echo _VODE_CANCELLED; ?></font></b>



<?php echo _VODE_TRY_LATER; ?></p>
<?php
}

}

?>

Please Log in or Create an account to join the conversation.

16 years 1 week ago #3489 by rakib
I guess only changing
$credit = ceil($payment_amount)*10; 
to 
$credit = 10; 
in vodes.php would suffice.

Please Log in or Create an account to join the conversation.

16 years 1 week ago #3485 by billybojangles
Wow that's awesome support 4 days and no help!  I'll make sure to promote your product.. 

Please Log in or Create an account to join the conversation.

16 years 6 days ago - 16 years 6 days ago #3501 by Saka

Wow that's awesome support 4 days and no help!  I'll make sure to promote your product.. 

Remember this is a free component, nobody has any obligation to sit here and answer your questions, especially not about modifying the code.

Rakib, thanks for your answers.

Emir Sakic
www.sakic.net

Please Log in or Create an account to join the conversation.

About us

We provide high quality Joomla components created by a co-founder and original core developer of Joomla. For over a decade, our products have been used by more than 20.000 webmasters around the world.

Stay in touch