我在 Magnto 1.9 中启用了 paypal 现在我想在我的 Observer 中调用另一个 paypal API,为此我需要 paypal 用户、密码和签名,我在启用 paypal 时已经保存了这些信息。
我想使用配置从管理员那里获取这些详细信息到我的代码中。
我试过下面的代码,但它不起作用。
$store = Mage::app()->getStore(Mage::app()->getStore()->getStoreId());
$Settings = Mage::getStoreConfig('paypal_payments/payment/required_settings/express',$store);
这可能吗?
最佳答案
终于找到答案了。
$store = Mage::app()->getStore(Mage::app()->getStore()->getStoreId());
$Email = Mage::getStoreConfig('paypal/general/business_paypal/general/business_accountaccount');
$UserName = Mage::getStoreConfig('paypal/wpp/api_username',$store);
$Password = Mage::getStoreConfig('paypal/wpp/api_password',$store);
$Signature = Mage::getStoreConfig('paypal/wpp/api_signature',$store);
通过上面的代码,我们可以获取商店明智的 PayPal 凭据。
我已经测试过了..
关于php - Magento:在代码中获取保存的 Paypal 凭证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52069235/