• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Javascript to PHP to Paypal

Javascript to PHP to Paypal 14 years 11 months ago #7798

Can someone help me please.

Reading thru various postings, i managed to get a form working to pass a value of $200 correctly but when paypal receives it, it appears as $2. Any guidance pls?


DETAILS
1. A drop box "course" selection is made. A hidden field "cost" is given a value based on the outcome of a selection drop box "course".
Additional Attributes
onchange="calculate_price(this)";

Form Layout
<script type="text/javascript">
var course = new Array();
course['A'] = '200.00';
course['B'] = '200.00';
course['C'] = '333.00';
 
function calculate_price(what)
{
document.getElementById('cost').value = course[what.value];
}
</script>

2. The "cost" is passed to paypal based on the following script after the form is processed:
if (isset($_POST['form']['cost']))
{
 $business = 'myemail@yahoo.com';
 $item_name = 'Course Registration';
 $currency_code = 'USD';
 $amount = $_POST['form']['cost'][0];
 $notify_url = 'http://www.mywebsite.com'
 header('Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business='.$business.'&item_name='.$item_name.'&currency_code='.$currency_code.'&amount='.$amount.&notify_url='.$notify_url.');
 exit();
}


Why did paypal receive it as $2 but the form submission states $200?

Thank you.
The administrator has disabled public write access.

Re:Javascript to PHP to Paypal 14 years 10 months ago #7879

Hi, can somebody help me on this? I am not a programmer, I only have this 1 last issue to resolve. any ideas please? Thank you.
The administrator has disabled public write access.

Re:Javascript to PHP to Paypal 14 years 10 months ago #7880

  • bogdanc
  • bogdanc's Avatar
  • OFFLINE
  • Moderator
  • Posts: 669
  • Thank you received: 11
Hello,

You can try using the PayPal plug-in for RSForm! Pro. Here is a link where you will find a description for the plug-in:

www.rsjoomla.com/joomla-plugins/rsform-p...1-joomla-paypal.html

Regards!
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!