Post by MattW » Fri Sep 02, 2011 5:12 pm

I've a customer who has tried to place and order and pay via SagePay, and the customer is based in Finland

The error the customer is getting from SagePay
> "This transaction attempt has failed. Please use the Proceed button go back to the web store from which you were purchasing. The details of the failure are given below.
>
> Status: INVALID
>
> Status Detail: 3018 : The GiftAid flag is invalid. If a value is supplied, should contain either 0 or 1."
I've looked at his city name, which in the shop is

Code: Select all

Vierumäki
however, looking at the error logs that SagePay is showing that the "ä" is being passed differently:

Code: Select all

Vierumäki
I'm using an unmodified 1.4.9.6 version of OpenCart.

Thanks,
Matt

Image


User avatar
New member

Posts

Joined
Sat Aug 28, 2010 11:37 am
Location - Sheffield

Post by MattW » Sun Sep 04, 2011 5:31 pm

Bump. Anyone else had this or know of a fix?

Image


User avatar
New member

Posts

Joined
Sat Aug 28, 2010 11:37 am
Location - Sheffield

Post by cocoamedia » Fri Oct 28, 2011 2:43 am

Bump.. I'm having errors with german Umlauts too... pleeaaaassseee Help!

http://www.cocoamedia.co.uk


User avatar
Newbie

Posts

Joined
Wed Jun 29, 2011 1:18 am
Location - UK

Post by olstar » Wed Nov 09, 2011 9:34 pm

We're having this issue also..

Anyone?

:(

Professional UK Based eCommerce - Our Free Opencart Mods - Our Premium Opencart Mods
Kashflow Integration


User avatar
New member

Posts

Joined
Tue Jul 05, 2011 3:53 pm


Post by olstar » Thu Nov 10, 2011 10:15 pm

We've made a fix..

its due to the encoding sagepay requires

http://www.opencart.com/index.php?route ... order=DESC

We've had to charge for it cos its taken us all morning to sort!

Professional UK Based eCommerce - Our Free Opencart Mods - Our Premium Opencart Mods
Kashflow Integration


User avatar
New member

Posts

Joined
Tue Jul 05, 2011 3:53 pm


Post by WildCakes » Thu Jan 12, 2012 1:40 am

Did anyone ever solve the The GiftAid flag is invalid issue. I'm having the same trouble, its being caused by accented characters such as À.

any help would be great

The above fix is not confirmed to be working in 1.5+

Newbie

Posts

Joined
Wed Jan 11, 2012 5:01 am

Post by docroesner » Tue Jan 24, 2012 2:14 am

WildCakes wrote:Did anyone ever solve the The GiftAid flag is invalid issue. I'm having the same trouble, its being caused by accented characters such as À.

any help would be great

The above fix is not confirmed to be working in 1.5+
I am not sure if I am allowed to post the fix for the version 1.5.1.3. It's a bit tricky.
SAGE stumbles upon these special characters of non english languages.
First collect all these in your language, for german it is: "ä","ö","ü","Ä","Ö","Ü","ß"
Then decide how you want to replace them, here: "ae","oe","ue","Ae","Oe","Ue","ss"

Then, in sagepay.php go to line 213 or search for the string "foreach($data as $key => $value)"
Below this line insert these 3 line of code:
$finde = array("ä","ö","ü","Ä","Ö","Ü","ß");
$ersetze = array("ae","oe","ue","Ae","Oe","Ue","ss");
$value = str_replace($finde, $ersetze, utf8_decode($value));

Then replace:
$crypt_data[] = $key . '=' . $value;
by
$crypt_data[] = $key . '=' . utf8_encode($value);

Probably not required to utf8_encode the data since they do not anylonger contain special characters unless there are
others unexpecteds.
That's it.
Now the SAGE screen displays the Müller as Mueller and doesn't complain anymore.

User avatar
New member

Posts

Joined
Sat Jan 21, 2012 11:17 pm


Post by greymatter » Fri Jun 29, 2012 9:57 pm

I've found my own little fix to this which appears to have worked.

In catalog/controller/payment/sagepay.php find the following:

Code: Select all

foreach($data as $key=> $val) {
     $crypt_data[] = $key . '=' . $str;
}
And replace with:

Code: Select all

foreach($data as $key => $val){
     $unwanted_array = array('Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o','ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y' );
     $val = strtr( $val, $unwanted_array );

     $crypt_data[] = $key . '=' . $val;
}
Will replace all foreign characters with the utf-8 equivalents.

Only tried this on a couple of test orders though.

Newbie

Posts

Joined
Wed Mar 07, 2012 11:04 pm
Who is online

Users browsing this forum: No registered users and 7 guests