Forums

How to add Paypal payment on an existing form calculating amount ?

Repitol 19 Jan, 2015
Hi,
I use a form that calculates an amount to be paid according to fields edited by the user.
This form uses LoadJS action.
when all the form is filled, it shows the amount to be paid.

I'd like that total amount could be paid using Paypal but I really don't know how to do this and could not find a link to solve my problem.
Can anyone help ?
Regards
Repitol 20 Jan, 2015
Hi everybody
at this moment my form does well the job to calculate the total amount. The field name is "total-a-payer"
So i tried to add Paypal redirect action in Events
Item name field(*) : paypal (I use a submit button called paypal at the end of the form)
Amount field(*) : total_a_payer

but doing that, when I fill the form and click on Paypal button, the amount in Paypal payment page is wrong.
It is 2x or 3x or 4x ... the amount given in "total-a-payer"

Where are my mistakes ?
Best regards
GreyHead 21 Jan, 2015
Hi Repitol,

The 'Trial' versions of the Payment Gateway actions randomise the amounts. Please see this FAQ

Bob
Repitol 21 Jan, 2015
Hi Bob,
I just bought the extension. Do I have to validate the website again (it is already validated "ChronoForms 5 domains Subscription")
to use it ?
Thanks
GreyHead 21 Jan, 2015
Hi Repitol,

I'm not sure - you don't need to revalidate the site, I think that Max emails you an updated version of the action.

Bob
Repitol 21 Jan, 2015
Ok Bob, I wait for Max email, then.
I have an optional question linked to my problem.
Every year, the domain name for my website change, because the website is about a ski race cup.
So, in 2014 it was www.2emecoupe.... and in 2015 it is www.3emecoupe....
That's a problem for my validation isn't it ?
Repitol 21 Jan, 2015
I have an issue
We couldn't validate your key because of some wrong data used
I tried to validate the Paypal plugin on a website already validated with Chronoforms 5 subscriptions using instant Key.
It failed.
GreyHead 21 Jan, 2015
Hi Repitol,

I said earlier that I think Max sends you a new 'full' version of the PayPal action.

At present I think that he will transfer validations from one domain to another if you ask him.

Bob
Repitol 21 Jan, 2015
Well, the fact is I didn't receive any mail from Max :?
GreyHead 21 Jan, 2015
Hi Repitol,

Sorry, I don't know how he manages those actions. All you can do is email him using the Contact Us menu above.

Bob
Repitol 21 Jan, 2015
Bob,
it's ok for the plugin, Max sent it and I was able to install the plugin on the form
but I have a bug now I didn't have with the Trial plugin.
the total amount field is automatically filled regarding to what the user edit in the form
the LoadJS event was set to add € to the amount (eg : total to be paid : 200 ) see code at the end of this post

with that "€" sigle on the total-amount field - Paypal has a problem.

Le lien que vous avez utilisé pour accéder au système PayPal contient un montant d'objet incorrectement formaté.


Paypal does not recognize the amount (I think the plugin add the euro sigle as it is already added - so the amount is probably 200€€)

Maybe I can fix it in Paypal redirect Event with "Currency Code" empty ?
here is my LoadJS Event
window.addEvent('domready', function() {
$('total_soiree_restaurant').addEvent('change', rekenen1);
$('total_club').addEvent('change', rekenen1);
  $('total_coupe').addEvent('change', rekenen1);
   $('total_ski_seul').addEvent('change', rekenen1);
    $('total_buffet').addEvent('change', rekenen1);
     $('total_soiree_montagne').addEvent('change', rekenen1);
      $('total_ski_libre').addEvent('change', rekenen1);
});
function rekenen1(){
 $('total_a_payer').value = parseInt($('total_soiree_restaurant').value * 40)+ parseInt($('total_club').value * 15) + parseInt($('total_coupe').value * 30) + parseInt($('total_ski_seul').value * 22) + parseInt($('total_buffet').value * 25) + parseInt($('total_soiree_montagne').value * 60) + parseInt($('total_ski_libre').value * 22) + '€'}
Repitol 30 Jan, 2015
It's okay now, I had a problem with Paypal plugin that is not able to "read" the amount field because that field contains € sigle (it is automatically added with the code)
what is weird is it didn't cause any problem on the trial version
so, I just erased € from the LoadJS action and it's ok

My last problem is about to manage "submit the form" and "Pay with Paypal"
how can I do to make possible to submit the form directly when people don't choose to pay with Paypal
and to submit it only after Payment for user choosing the Paypal option.

Actually, I have the 2 buttons on the form, but they are independant.
- If user clics on submit, he looses the ability to pay the amount with Paypal
- if he clics on Pay with Paypal, he goes to the payment page but doesn't subit the form

Repitol
Repitol 05 Feb, 2015
I open a new ticket for this question, I think that's better 😉
This topic is locked and no more replies can be posted.