how to add error message - Paypal pro

nycps 22 Mar, 2012
Hi all -

So my form works just as it should. I am using the paypal component and when all the information is added properly it works just fine. The problem is when the information is inputted incorrectly.

If the customer puts in a bogus credit card number (ie too many or too few digits) and paypal rejects, there is no indication as to what the problem is. They are just moved to the top of the page. All the information is still there in the form but they go no where.

So how do I add a message that let's them know that there is a problem?
GreyHead 24 Mar, 2012
Hi nycps,

Which version of ChronoForms are you using? You can find the version from Site Admin | Extensions | Install/Uninstall | Components in Joomla! 1.5 or Site Admin | Extensions | Extension Manager | Manage in Joomla! 1.6/1.7/2.5.

Bob
nycps 26 Mar, 2012
version 4.0 RC3.21
nycps 01 Apr, 2012
Hi greyhead! I was wondering if you might have an answer to the question? Just ran into another customer who was having problems and we had to complte the purchase for him. And we used the form perfectly, so he was clearly adding a space or something. Anyway to prompt errors?
GreyHead 01 Apr, 2012
Hi nycps,

Looking at the code I think that the messages are added to the $form->data array like this:
$form->data['_PLUGINS_']['paypal_pro']['transaction_id']
$form->data['_PLUGINS_']['paypal_pro']['error_message']
$form->data['_PLUGINS_']['paypal_pro']['error_code'] 
$form->data['_PLUGINS_']['paypal_pro']['correlation_id'] 
$form->data['_PLUGINS_']['paypal_pro']['avs_code'] 
So displaying one or more of these in a message to the user should be what you need.

Bob
nycps 03 Apr, 2012
thanks for the response bob, but where do i add this? I see you have put $form->data but where is that?
GreyHead 03 Apr, 2012
Hi nycps,

That's the ChronoForms data array. It's set up for you.

What to you want to do with the message? The PayPal plug-in provides the data but leaves it up to you what to do with it.

Bob
nycps 09 Apr, 2012
THanks for the quick response, unfortunately I've been kinda swamped here with other stuff.

I would like the user to get a message of "you've entered an illegal character in xxx field"

or something like that so that they know they have made a mistake. or "credit card # not valid, plese be sure not to enter any spaces or dashes" etc.
GreyHead 09 Apr, 2012
Hi nypcs,

Form the look of them both of those are errors that you would check with custom serverside validation (and probably client-side validation too) before sending any data to PayPal.

And I don't think that PayPal will always give you this level of feedback either.

Bob
This topic is locked and no more replies can be posted.