PHP Developers Network

Redirect payment to PP regarding on geozone;paying if needed
Page 1 of 1

Author:  PrPrO [ Mon Jul 21, 2014 1:50 pm ]
Post subject:  Redirect payment to PP regarding on geozone;paying if needed

Hello everyone,

I need some help with what I see in my mind as a somehow simple code.
I have an extension on Joomla, called EShop, and what I want to do is, when a customer from one geozone(preset) buys something via our cart, he pays through one PayPal account, and when a customer from another geozone buys something, it redirects its payment to another PP account.

So, lets say customer 1 is from the US, 1st geozone, and customer 2 from, lets say, Spain, 2nd geozone.
Customer 1 buys a product and pays on PayPal acc #1, customer 2 buys the same product, but pays on PayPal acc #2.

Is it possible?
In my head it is, but I got very rusty during time with programming so I need major help :D I could even pay if needed to write the code.(I would need the whole code working, can't write anything by myself -.-)

Here is the begining fo the code that might work:
Use a variable for your PayPal account and populate the variable based on the payee's location.
Syntax: [ Download ] [ Hide ]
$paypal_account = ($payee_zone == 2) ? $account2 : $account1;
<form action="">
        <input name="business" value="<?= $paypal_account; ?>">

Kind regards and thank you in advance!

Author:  sterban [ Tue Jul 22, 2014 10:14 am ]
Post subject:  Re: Redirect payment to PP regarding on geozone;paying if ne ... jex/ip.sql
Just save the file in your database

The following script outputs the full country name of the current visitor.
so in your php script paypal account

its recommended to use destructor and constructor as well as check $servername to avoid xxs - goodluck ^^

just add
if ($countryName === "united states") {print "uspaypalaccountus"}
elseif ($countryName === "spain") {print "uspaypalaccountspain"}


$server = ''; // MySQL hostname
$username = ''; // MySQL username
$password = ''; // MySQL password
$dbname = ''; // MySQL db name

$db = mysql_connect($server, $username, $password) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());

$sql = 'SELECT
ip2nationCountries c,
ip2nation i
c.code =
i.ip DESC
LIMIT 0,1';

list($countryName) = mysql_fetch_row(mysql_query($sql));

// Output full country name
echo $countryName;


resource/info -

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group