Forums

PayPal form calculation

omidhz 07 Feb, 2010
Hello, I'mnew to ChornoForm and I just installed it yesterday and built the first form which I love it. I'm interested in the PayPal plugin, but first I need to know if it does what I need it to do.
I want to have a form for event registration and the form should calculate the fee that my visitor is suppose to pay based on visitors data entery in the form, for example number of people, number of days they want to attend and so on, then the data should be sent to PayPal for payment processing. Is chronoform able to do so, if yes, where can I find instructions on that. Thank you .
GreyHead 07 Feb, 2010
Hi omidhz,

Well, ChronoForms can help you do that. You will need to provide or write the code to do the calculation. You will need some PHP or JavaScript skills to do that though.

Bob
omidhz 07 Feb, 2010
Thanks Bob. I know JS and basic php coding such as calculation. What I need is how/where to enter the codings for the form to work properly and then transfer the data to Paypal?
GreyHead 07 Feb, 2010
Hi omidhz,

If you use JavaScript then you an add it in the Form JavScript box. If you want to use PHp after the Form is submitted then one of the OnSubmit Code boxes (probably 'before email').

Make sure that the result of the calculation ends up in the form results array. You can then pick it up in either the PayPal API plugin or the ReDirect plugin to send on to PayPal.

Bob
omidhz 07 Feb, 2010
OK, I will play with it today and see how I can get this to work for me.
Another question: where does the PayPal API plugin get the final number and other details from? will it get it directly from the form itself or do we need to have other php or JS codes to transfer the data to PayPal?
GreyHead 07 Feb, 2010
Hi omidhz,

You put a field name in the 'amount' box and it will take the value of that field.

Bob
omidhz 07 Feb, 2010
Thats great. Thanks.
omidhz 12 Feb, 2010
Hi again.
OK,
I'm done with my form. I setup a form and I used JS for calcuation. The Total shows in a text field on the same form. I just want to make sure that the PayPal plug in that is listed here: http://www.chronoengine.com/subscriptions.html is exactly what I need and it will work for me. Please let me know.
GreyHead 12 Feb, 2010
Hi omidhz,

Only you can answer that question; there is no way for me to know if it's exactly what you need.

Try it and see.

Bob
omidhz 13 Feb, 2010
Im getting the following error:

The PayPal API has returned an error!
Ack: Failure
Correlation ID: cdac128faf74d
Version: 56.0
Error Number: 10563
Short Message: Invalid Data
Long Message: This transaction cannot be processed. Please enter a valid credit card expiration month.
Error Number: 10562
Short Message: Invalid Data
Long Message: This transaction cannot be processed. Please enter a valid credit card expiration year.
Error Number: 81234
Short Message: Invalid Parameter
Long Message: ExpDate : Invalid Parameter

I have the credit card expiration month and year setup as two digit and four digit drop down list.
What may be causing this error? Any idea?
Thanks
GreyHead 13 Feb, 2010
Hi omidhz,

Impossible to say without seeing what is actually being submitted to PayPal.

If you turn on debugging then the plugin should display the request string that is being sent to PayPal and you can check this item by item against the PayPal specs.

It looks from the plugin code as though the month and date entries are concatenated together
"EXPDATE" => str_pad(urlencode( JRequest::getVar($params->get('EXPDATE_m'))), 2, '0', STR_PAD_LEFT).urlencode( JRequest::getVar($params->get('EXPDATE_y')))


Bob
gerryf 21 Feb, 2010
I will bet that the numbers are being submitted as text and not numbers...make sure the value is not in "quotes"
This topic is locked and no more replies can be posted.