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.