PayPal Error Code 11812 Prestashop Solution

On a Prestashop shop installation, using PayPal Module, non-latin language installation default.

After a customer attempted to make a payment with PayPal, I received an error email like this:

Error reporting from your PayPalAPI module
 
A client has encountered a problem with the module PayPalAPI, see the report:
 
PayPal response:
TIMESTAMP -> 2015-05-24T11:45:56Z
L_ERRORCODE0 -> 11812
L_SHORTMESSAGE0 -> Invalid Data
L_LONGMESSAGE0 -> The value of Description parameter has been truncated.
L_SEVERITYCODE0 -> Warning

In order to fix this, after a web search, I cam across this solution:

This can happen if you are using non-english characters in your product description.

PayPal accepts up to 127 characters for this field and UTF-8 may use up to 6 bytes per character.

So the solution is to change the length from 50 to 20 in /modules/paypal/express_checkout/process.php around lines 291 and 310:

//$fields['L_PAYMENTREQUEST_0_DESC'.$index] = Tools::substr(strip_tags($product['description_short']), 0, 50).'...';
$fields['L_PAYMENTREQUEST_0_DESC'.$index] = Tools::substr(strip_tags($product['description_short']), 0, 20).'...';

Found here.

Part 3 of my automatic Free Backup on MediaTemple Grid Server

Previously, I wrote about a daily backup of mysql database and files but also an automatic deletion of old backups via Shell Script (.sh file).

This was the code I had. Note, you will need to change the 000000 to your Grid server number and add password to mysql download command. Also note, I created a folder /backup-domains/ at /home/000000/data/ to store all my backups.

#!/bin/sh
echo "############### Backing up files on the system... ###############"
echo "Started at:"
date
 
backupfilename=server_file_backup_`date '+%Y-%m-%d'`
 
echo "----- First do the sql by deleting the old file and dumping the current data -----"
rm -f /home/000000/data/tmp/backup.sql
mysqldump -udb000000 -pMYPASSWORD -hinternal-db.s000000.gridserver.com --all-databases --add-drop-table > /home/000000/data/tmp/backup.sql
echo "## Completed mysql backup ##"
 
echo "----- Now tar, then zip up all files to be saved -----"
tar cvf /home/000000/data/backup-domains/${backupfilename}.tar /home/000000/domains/* /home/000000/etc/php.ini /home/000000/data/tmp/backup.sql
gzip /home/000000/data/backup-domains/${backupfilename}.tar
rm /home/000000data/backup-domains/${backupfilename}.tar
chmod 666 /home/000000/data/backup-domains/${backupfilename}.tar.gz
echo "## Completed data backup ##" 

echo "Completed at:"
date 
echo "############### Completed full backing up system... ###############"

Now I have added this, which will delete my old backup compressed files.

echo "----- Now delete older files -----"
find /home/0000000/data/backup-domains/server_file_backup_*.gz -maxdepth 1 -type f -mtime +30 -delete
echo "## Completed deleting of old mysql backups ##" 

This code will search for any files matching that pattern, which are older than 30 days, then delete them. If you desire a different timeframe just change the number. The frequency of backups is set via the cron job that runs this script, see previous post for those details.

Apple Airport external Drive setup for WAN access

Recently, my MacBook Pro screen just went blank and then the computer won’t boot. I realised the need for a backup, and with that, a working Time Machine that I can access from anywhere.

Devices and Software I am using:

  • Apple Airport Extreme
  • USB Hard Drive, attached to the Airport
  • PC running Windows Vista
  • Macs running latest OS
  • iOS devices using FileBrowser (Business) App

Setup the Airport Extreme.

Using Airport Utility on a Mac, go into the “Edit” menu and confirm the “Disk” tab has a partition. Check both “Enable File Sharing” & “Share disks over WAN”. Add any usernames and accounts that you want to have access.

Airport extreme WAN setup for external USB drive.

Airport extreme WAN setup for external USB drive.

Next, add port settings for redirection of correct port to the Disk. Quick Tip: The port IP of the Router is the port of the USB attached Hard Drive. If using a builtin or Standalone TimeMachine or NAS device it will have an IP of it’s own, therefore you will need to make a DHCP reservation for that IP before setting up the Port Settings. The “Port Settings” are found under the “Network” tab.

Port Settings in Airport Extreme

Port Settings in Airport Extreme

In my case, I use the DHCP range of 192.168.1.2 to 192.168.1.200, but there are other range options. Here are the setting I used for each port entry I wanted.

Personal Web Sharing – this is my website I setup via a Mac Apache server. A DHCP reservation was required for setup of this web server.
Screen Shot 2015-05-01 at 12.08.04 PM

AirPort Drive – as the title and main reason for this post.
Screen Shot 2015-05-01 at 12.07.38 PM

SMB 20445 – added for giving simple file server access on iOS and Windows.
Screen Shot 2015-05-01 at 12.07.26 PM

Please note that some Internet service providers or service packages may block certain ports.

You may also want to setup a Dynamic Global Hostname if your IP address frequently changes, found in “Internet Options” under “Internet” tab. Setup of that is a whole Post on it’s own.

Once you have completed the above steps, UPDATE your Airport and wait for it to come back.

Windows & Mac OS

Accessing the Drive should be simple if you don’t have any network problems, firewall or ISP blocks, with your computer.

On a Mac, in “Finder” -> “Go” -> “Connect to Server…” (Or shortcut “⌘K” will get the window). Type in either your IP address or dynamic url with the “:445″ at the end. An example in my case is smb://me.ddns.net:445 or smb://180.12.23.124:445 into the server address field. This Port might need to be “20445”.

On a PC, the same url address can be used in a window/browser or “Mount a network drive” by right clicking “My Computer”.

iOS App

There are many iOS apps with can be used for accessing file or web servers. I personally found FileBrowser a great option that allows lots of control and video playback. I tired the FREE (Lite) version and later upgraded to Business for my purposes.

In FileBrowser Business, under “Locations”, I added a new TC location. I put the Address “\\me.ddns.net” along with the username/password I set in the Airport Utility. I enabled “Auto List Shares” and “SMB Pipelining” along with the SMB Port Number “20445” my Global Port number.