I want to integrate Paypal's two Merchant Accounts based on some conditions. I have already gone through https://stackoverflow.com/questions/5220744/creating-two-business-account-in-paypal-standard, but where I am not getting data what I would like to have like API Integration Settings so that I can override/change API value based on condition. I have found the following function where I can change API Values.

    //class: Mage_Paypal_Model_Config

public function __get($key)
            $underscored = strtolower(preg_replace('/(.)([A-Z])/', "$1_$2", $key));
            $value = Mage::getStoreConfig($this->_getSpecificConfigPath($underscored), $this->_storeId);
            $value = $this->_prepareValue($underscored, $value);
            $this->$key = $value;
            $this->$underscored = $value;
            echo $value."<br />";
            return $value;

Question: Is it the right way to change these settings or is there a better way to change these settings?

I want to change the following settings:

  • Merchant Country
  • Email Associated with PayPal Merchant Account
  • API/Integration Settings

PS. There is only one store

  • What sort of condition do you have? Commented Dec 9, 2013 at 13:42
  • @Tim, Geo Location Based Commented Dec 9, 2013 at 13:49
  • What are your requirements for this project? I had a similar project were they had three different paypal accounts based on the zip code during checkout (using only 1 store).
    – kab8609
    Commented Dec 14, 2013 at 15:00

1 Answer 1


to my mind the most elegant solution would be using different store views. Visually they can be identical but you can set different PayPal configurations for each.

You can initially switch user to the desired store view based on the geo location information of whatever you want.

  • Thanks Tim, but there is only one store. I can't use multiple store views based on requirements Commented Dec 10, 2013 at 4:42
  • 2
    What (I believe) Tim means is to have two store views, the only difference between them being the merchant configuration, and to switch between them based on geo location (e.g. in index.php, or controller_front_init_before observer).
    – Jan Tomka
    Commented Dec 13, 2013 at 12:58
  • Yes, right. I'd say controller_front_init_before with combination with GeoIP module github.com/tim-bezhashvyly/geoip Commented Dec 14, 2013 at 17:08
  • Thanx Tim & Jan. I will check that solution. Commented Dec 14, 2013 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.