Post by RichMo » Fri Jul 20, 2012 6:31 pm

Hi,

I've installed the Cardsave direct integration module and it seems to be working fine. It has a major drawback for me though and Cardsave tell me they will not help....

If you enter an invalid card number, leave a field blank etc, the error message is really crude. It just gives a popup saying "CardSave Error (30): Input variable errors".

That is fine for a techie, but that is really not a nice way to tell the end user there is a mistake. I want to get rid of the popup and have a message display on the page, perhaps highlighting the field that needs attention.

Below are the message I have recieved from Cardsave support...
Its not so much looking for code to modify, you would need to create code that responded to the server responses.
So for example.
Our server responds with "CardSave Error (30): Input variable errors"
Your code would see this and intercept with the message you would like it to say.
have a look somewhere serverResult.php coding if you can get in it
..........
Unfortunately we don't support any customization of shopping cart coding,
I advised it can be done but this is something you will have to research and complete independently from CardSave.
There seems to be no "serverResult.php" anywhere in their module or opencart, so I really do not know where to begin looking. Anyone got an idea?

New member

Posts

Joined
Tue Jul 10, 2012 5:54 pm

Post by RichMo » Mon Jul 23, 2012 10:19 pm

Ok, well I seem to have found a solution.. If there's anyone better at Javascript than me who could make the message appear on the page instead of a popup, that would be appreciated.

If anyone just wants to edit the message in the popup, just find the template file /templates/payment/cardsave_direct.tpl

At the bottom of this is some Javascript. Find the line "alert(json['error']);"

Replace it with the following...

Code: Select all

if (json['error'] == "CardSave Error (30) :Input variable errors") {
					alert("Your more friendly message here");
				} else {
					alert(json['error']);
				}

New member

Posts

Joined
Tue Jul 10, 2012 5:54 pm
Who is online

Users browsing this forum: No registered users and 5 guests