How do I change the language code for PayPal?

The language code for the PayPal site is defined in the button using a hidden field.

So for English language use
<input type=’hidden’ name=’lc’ value=’US’ />

Possible values are France(FR), Spain (ES), Italy (IT), Germany (DE), China (CN), English (US).

The customer should hopefully see the login page in the defined language.

To change the language code, go to the file ipnfunction.php open in a text editor and you should see the default language code of
<input type=’hidden’ name=’lc’ value=’US’ />

Change the value to what ever code you require and upload the file back to your server.

Creating a mySQL Database in cPanel (new style)

Log in to your Cpanel

Log into cPanel and click on the mySQL database link.

Create A New Database

Scroll down to where it says ‘new database’ and enter your choosen database name in the field and click on ‘Create Database’

MySql Account Maintenance Page 

Each step in the process will take you back and forth to the mySQL Maintenace page to verify that you have set up the process correctly and you will be able to see the information you have created.

Here you will see you have added the database.

Click on the Go Back button.

Enter Username and Password

Scroll down to username and password and enter your information.  Click on create user.

Back to MySql Account Maintenance Page 

The username and password have been created for you database.  Click on the Go Back button to return.

Add username to database

Scroll down to add users to your databases.

If there are no users or databases previously created you will only see one in each selection.

Choose the username that you want to add.  Note that the username previously created “myusername” has been shortened to “myusern”  This is the name that you need to use in the config.php file. 

Example: “vonnamia_myusern” not “vonnamia_myusername”

Select the Database you created from the list.

Select the Checkbox “All Privileges”.

Click Add User To Database

MySql Account Maintenance 

This will take you back to the MySql Account Maintenance page for verification, you will see the shortened Username there.

Click on the Go Back button and you will see the contents of your finished Database.

Running the install.php file

At this point you have created the database, created a user and allocated the user to the database.

You can now create the tables using the install.php script supplied with the zip file.

You will need to have the following information available :

database name
database username
database password
database host (usually local host but refer to your host documentation if you are not sure)

When you run the install.php file in your browser you will be presented with boxes as follows :

Create a mySQL database with GoDaddy hosting

This describes creating a database with GoDaddy hosting

First, start by logging into your GoDaddy account:

Click on my hosting account (dropdown under “hosting”)

Click on “manage account” under the correct hosting account domain

Once you’re in the “hosting control center” click on “mysql” from the “databases” dropdown menu

Click the “create database” button

Choose MySQL version 4 or 5, and then enter a description (can be anything), database/user name (must be very unique, or you’ll have to try again), and password (must use at least one capital letter and a number)

(NOTE: you may have to wait 5-10 minutes while the database is setup )

Click the little pencil icon to edit/view database details

Write down or copy the “Host Name:” this will go in the wp-config.php file in place of “localhost”

In your web browser, go to the installation script install.php and fill in the details:

Create a mySQL database using cpanel (old style)

This tutorial will take you step-by-step through the process of creating a database for use with withinweb applications using CPanel.

First, login to your cpanel control panel.

You should see a large number of icons, one of which will be mySQL Database

Click on this and you will be taken to the mySQL Account Maintenance page.  You may also see other database details listed if you have created other database before.

Add User

You need to first add a user name and a password.

Click the Add User button

Note that your host will usually add a prefix to the user name, so this will become something like wptemp_Podz

Create your database

You should now be looking at the screen below. Note that you – the User – are listed in a box at the top, and also below the line too.

Enter the name of the database where database name is listed. Then click Add Db

The database is now created.

Allocate the user to the database

The two pieces of information you just added are now here on this screen: the user name and the database name.

If you have other databases and users, the whole screen may look different, but this small part will look the same.

Look at the two drop-down boxes.

The User box MUST contain the name that you added first above. (Note that for each name you put in, the CPanel has added a prefix.) If you need to, click the drop down to get the name you added to appear in the left hand box. The same applies to the database: – get the name of the database in the box too.

When finished, click the button that says Add User to Db.

This is REALLY important – nothing will work unless you click that button.

You should see this.

At this point you have created the database, created a user and allocated the user to the database.

You can now create the tables using the install.php script supplied with the zip file.

You will need to have the following information available :

database name
database username
database password
database host (usually local host but refer to your host documentation if you are not sure)

When you run the install.php file in your browser you will be presented with boxes as follows :

Logging in and session errors

With PHP-eSeller, PHP-SecureArea or PHP-KeyCodes, if you get an error during installation where the admin keeps on logging out, it is usually because there is an issue with session variables on your server.

First check using the test file a_session_test.php  When the page is first loaded there will be a link, click the link and it should say ‘Welcome back’.  If it does not, then it means there is a sessions issue on your server.

There could be a number of reasons for this, usually it is caused by a configuration problem on the server.  There should be a folder on the server which is used to store sessions and somtimes the host has not set this correctly.  Or it could be that it is a shared server and the server does not know the path.

Contact your hosting and ask them to investigate.

Sometimes they will reply that you include the following code at the top of any PHP script that uses sessions:

session_save_path(“path to session folder”);

If you use session_save_path on the page that registers a variable, you have also to use session_save_path on all the pages, where you access the session-variable. Under win32 you can use the double \\ to specify eg “c:\\temp\\”

This is possible to do but is not really practical.

If they do reply with the above, it is worth asking them again to check the php.ini configuration and also ask if there is a global method where you can set the path and where you do not have to change every instance in the application.

One possible solution is to set the session.save_path in an .htaccess file.  You may not have access to the php.ini file so this may be the way to do it.  You can do that in the .htaccess file, which is kind of configuration file for Apache, and put it in your root web folder. 

If you add :

php_value session.save_path /home/groups/f/f4/f4l/tmp/

where the folder name is the absolute path to the folder.  You should be able to get the absolute path by logging into your control panel.

Sending email from windows server

PHP-eSeller and PHP-KeyCodes can both be installed on a Windows Server which runs PHP and has a mySQL database.  This is quite a common arrangement now, and many hosting companies provide this, enabling PHP applications to be installed on Windows Servers.

Both applications need to send out emails from the server and this can be done by configuring PHP-eSeller and PHP-KeyCodes to use SMTP if the standard PHP email has not been set up.  This requires minor configuration changes to the config file which means entering the SMTP host, username, password.  All of these details should be available from your web site host if you donot know them.

You do not have to use the web server SMTP details, you can use an external SMTP mail service such as http://www.authsmtp.com.  Sometimes, these provide a better mail service than your host and may be more reliable.

What is IPN

Instant Payment Notification (IPN) is the method that PayPal uses to automatically notify a defined web page when a PayPal payment has been made. For a complete description refer to the PayPal IPN Manual which you can find on the http://www.paypal.com/ipn site.

The principle that PayPal uses is as follows : You first create a PayPal ‘buy now’ button and place it on your web page or create the buttons dynamically from a database. When someone clicks on your ‘buy now’ button, (or ‘proceed to checkout’ button in the case of a shopping cart system), PayPal posts data to the web page you defined during IPN set up. Your web page must then respond back to the paypal site.

After PayPal has confirmed the payment, it posts data back to your web page. Your web page then sends the data back to PayPal to act as a security handshake. Then PayPal will send ‘completed’ if payment has been correctly completed.

Once ‘completed’ has been received by your web page, you process the data in whatever way you want. The IPN method provides a relativly simple method of checking when a purchase has been made but remaining secure. The handshake principle of IPN makes it impossible to trick a web site that payment has been completed.

For digital goods, PHP-eSeller takes the IPN data from PayPal, carries out security checks to make sure the details are correct, then emails the purchaser with a username/password, all without any intervention by yourself. The purchaser is then able to login to a secure area where they can download their items.

The list of items which the purchaser sees does not have any urls as that could compromise the security. The list is made up of buttons which are then translated into filenames by PHP.

The purchaser only sees the files he has purchased and cannot access the file in any other way.

For physical goods the processing is not as complicated. It checks the details received from PayPal, sends a confirmation email to the purchaser if there are no problems, and stores the sales details in the database. Obviously, there is no login process required for physical goods.

PHP-KeyCodes custom field

When you sell pin codes or software licence codes using PHP-KeyCodes, you may want the customer to enter in some text during purchase which is returned to you in the purchase information. This might be the type of cellphone, or some other information that you require for you records.

PayPal has a field called ‘custom’ which is a pass through field where any data entered into the field will be passed unchanged to PayPal and returned inside the IPN data.

In PHP-KeyCodes, entering text into the custom field is returned with the IPN payment details and the data is stored in the tblsaleshistory table along with all the other PayPal details and the purchased licence codes.

To use this feature all you need to do is add an html input text field as shown in http://www.withinweb.com/phpkeycodes/handbuttons.php The maximum number of characters that can be entered is 255.

Creating a database user with myPHPAdmin

PHP-eSeller, PHP-SecureArea and PHP-KeyCodes all require a mySQL database and hence require a database username and password. Normally you will interact with the mySQL database using a control panel which will incorporate tools to easily create database and users. These facilities are provided by your web host and will be the best way to create database users.

However, with some web hosts it may be necessary to to create a user using myPHPAdmin.

To creating a user using the myPHPAdmin interface, asuming that you are logged in to myPHPAdmin with full previleges :

In a sql text box enter :

GRANT SELECT, INSERT, UPDATE, DELETE ON eseller.* TO eselleruser@localhost IDENTIFIED BY 'piggy911';
FLUSH PREVILEGES;

This above assumes that ‘eseller’ is the name of the database, ‘eselleruser’ is the name of the database user and ‘piggy911’ is the password.

This will create a user with select, insert, update and delete previlages which is all that is required for a normal user.

NOTE that to create tables the user needs to have create table privileges which can be given by changing the the sql to

GRANT ALL PRIVILEGES ON eseller.* TO eselleruser@localhost IDENTIFIED BY 'piggy911';
FLUSH PREVILEGES;

PayPal and eChecks

An eCheck is when the customer only has a bank account, and not a credit card or additional form of payment to back up their account should their account be overdrawn when PayPal tries to debit it, so PayPal doesn’t pay you for 3-5 days while they wait for the money to transfer.

All withinweb applications (PHP-SecureArea, PHP-eSeller, or PHP-Keycodes) are able to handle Checks and in addition, will automatically send an email to the purchaser informing them that they have paid by eCheck and that there will be a delay before purchase is complete. Once the eCheck has cleared the application (PHP-SecureArea, PHP-eSeller, or PHP-Keycodes) will complete the process in the normal way and send the appropriate emails to the customer all without intervention by yourself.

When we recieve an eCheck purchase we often send an additional email to the customer just to further explain the situation and maintain a relationship with the customer.

In fact there are many situations where there can be a delay in payment being completed. All these situations are automatically handled by Withinweb.com applications.

There can be customer service nightmares when people use eChecks in PayPal. Most customers don’t know what it is, and PayPal appears not to warn them. Providing that you inform the customer, there should not be a problem and you can maintain your relationship with the customer.