Page 1 of 1

Code for redirecting payment via PayPal based on geozone cus

Posted: Sat Jul 19, 2014 3:40 pm
by PrPrO
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.

Kind regards and thank you in advance!
Matija

Re: Code for redirecting payment via PayPal based on geozone

Posted: Sat Jul 19, 2014 5:42 pm
by Celauran
I don't see why it wouldn't be. Use a variable for your PayPal account and populate the variable based on the payee's location.

Code: Select all

$paypal_account = ($payee_zone == 2) ? $account2 : $account1;
...
<form action="paypal.com/whatever">
	<input name="business" value="<?= $paypal_account; ?>">
	etc