diff --git a/app/code/community/Amazon/Payments/Helper/Data.php b/app/code/community/Amazon/Payments/Helper/Data.php index 313e4d6..d3e3448 100644 --- a/app/code/community/Amazon/Payments/Helper/Data.php +++ b/app/code/community/Amazon/Payments/Helper/Data.php @@ -255,4 +255,22 @@ public function getAdminConfig($path) } } + /** + * Get admin/default store id + */ + public function getAdminStoreId() + { + if ($code = Mage::getSingleton('adminhtml/config_data')->getStore()) { + return Mage::getModel('core/store')->load($code)->getId(); + } + elseif ($code = Mage::getSingleton('adminhtml/config_data')->getWebsite()) { + $website_id = Mage::getModel('core/website')->load($code)->getId(); + return Mage::app()->getWebsite($website_id)->getDefaultStore()->getId(); + } + else + { + return Mage::app()->getDefaultStoreView()->getId(); + } + } + } \ No newline at end of file diff --git a/app/code/community/Amazon/Payments/Model/SimplePath.php b/app/code/community/Amazon/Payments/Model/SimplePath.php index 2439a12..ab975fc 100644 --- a/app/code/community/Amazon/Payments/Model/SimplePath.php +++ b/app/code/community/Amazon/Payments/Model/SimplePath.php @@ -219,7 +219,7 @@ public function autoEnable() */ public function getListenerUrl() { - $url = Mage::getUrl('amazon_payments/simplepath', array('_store' => 1, '_forced_secure' => true)); + $url = Mage::getUrl('amazon_payments/simplepath', array('_store' => Mage::helper('amazon_payments')->getAdminStoreId(), '_forced_secure' => true)); // Add index.php $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB, true); return str_replace($baseUrl, $baseUrl . 'index.php/', $url); diff --git a/app/code/community/Amazon/Payments/Model/System/Config/Backend/Popupcomment.php b/app/code/community/Amazon/Payments/Model/System/Config/Backend/Popupcomment.php index 1a0361c..fa1c61d 100644 --- a/app/code/community/Amazon/Payments/Model/System/Config/Backend/Popupcomment.php +++ b/app/code/community/Amazon/Payments/Model/System/Config/Backend/Popupcomment.php @@ -23,8 +23,8 @@ public function getCommentText(Mage_Core_Model_Config_Element $element, $current