Magento 在paypal标准中创建两个业务帐户

Magento 在paypal标准中创建两个业务帐户,magento,paypal,account,Magento,Paypal,Account,谁能告诉我如何创建两个业务帐户?事实上,我想要这样的功能,如果我的购物车总额超过100美元,我想把它传递给我的第一个商户帐户,否则我想传递第二个商户电子邮件。我知道,这是可行的。当页面重定向到paypal时,我必须根据cart total发送不同的电子邮件。我想创建一个saparate模块,通过该模块,我可以提供两封商户电子邮件,以便根据cart total.TIA使用这两封输入的电子邮件,是否有帮助?查看有关使用两个Authorize.net帐户的信息。贝宝的概念是相同的。在model Mag

谁能告诉我如何创建两个业务帐户?事实上,我想要这样的功能,如果我的购物车总额超过100美元,我想把它传递给我的第一个商户帐户,否则我想传递第二个商户电子邮件。我知道,这是可行的。当页面重定向到paypal时,我必须根据cart total发送不同的电子邮件。我想创建一个saparate模块,通过该模块,我可以提供两封商户电子邮件,以便根据cart total.TIA使用这两封输入的电子邮件,是否有帮助?

查看有关使用两个Authorize.net帐户的信息。贝宝的概念是相同的。在model Mage_Paypal_model_标准中,有一个名为getConfig的方法:

这看起来是你最好的选择。此时,您应该能够调用:

$this->getCheckout()->getQuote();
获取报价对象。使用它来决定加载哪个Paypal信息。将paypal信息保存在数据库中的另一个路径下,比如说paypal/config\u alt,并根据需要返回


希望有帮助

最后,我在system.xml中添加了标记as

<business_account2 translate="label comment tooltip">
    <label>Email Associated with PayPal Merchant Account more than 100 amount</label>
    <comment><![CDATA[<a href="http://www.magentocommerce.com/paypal">Start accepting payments via PayPal!</a>]]></comment>
    <tooltip>Don't have a PayPal account? Simply enter your email address.</tooltip>
    <config_path>paypal/general/business_account2</config_path>
    <show_in_default>1</show_in_default>
    <show_in_website>1</show_in_website>
    <sort_order>10</sort_order>
    <frontend_class>validate-email</frontend_class>
</business_account2>

$result=$api->getStandardCheckoutRequest之后;在Payment/Model/Standard.php中,我在核心文件中做了这些更改,但正如大家所知,我必须使用本地文件夹创建这些文件。我希望这对您有所帮助。

创建system.xml并粘贴

<config>
  <sections>
    <paypal>
        <groups>
            <account translate="label">
                <label>Merchant Account</label>
                <fieldset_css>paypal-config</fieldset_css>
                <frontend_type>text</frontend_type>
                <sort_order>0</sort_order>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <fields>
                    <business_account2 translate="label comment tooltip">
                        <label>Email Associated with PayPal Merchant Account more than 5 amount</label>
                        <comment><![CDATA[<a href="http://www.magentocommerce.com/paypal">Start accepting payments via PayPal!</a>]]></comment>
                        <tooltip>Don't have a PayPal account? Simply enter your email address.</tooltip>
                        <config_path>paypal/general/business_account2</config_path>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <sort_order>10</sort_order>
                        <frontend_class>validate-email</frontend_class>
                    </business_account2>
                </fields>
            </account>
        </groups>
    </paypal>
  </sections>
</config>
<config>
    <modules>
        <My_CustomPaypal>
            <version>1.0.0</version>
            <depends>
            <!-- no dependencies -->
            </depends>
        </My_CustomPaypal>
    </modules>
    <global>
        <models>
          <paypal>
              <rewrite>
                  <standard>My_CustomPaypal_Model_Standard</standard>
              </rewrite>
          </paypal>
        </models>
        <resources />
        <extraconfig />
        <blocks />
    </global>
</config>
然后创建config.xml并粘贴

<config>
  <sections>
    <paypal>
        <groups>
            <account translate="label">
                <label>Merchant Account</label>
                <fieldset_css>paypal-config</fieldset_css>
                <frontend_type>text</frontend_type>
                <sort_order>0</sort_order>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <fields>
                    <business_account2 translate="label comment tooltip">
                        <label>Email Associated with PayPal Merchant Account more than 5 amount</label>
                        <comment><![CDATA[<a href="http://www.magentocommerce.com/paypal">Start accepting payments via PayPal!</a>]]></comment>
                        <tooltip>Don't have a PayPal account? Simply enter your email address.</tooltip>
                        <config_path>paypal/general/business_account2</config_path>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <sort_order>10</sort_order>
                        <frontend_class>validate-email</frontend_class>
                    </business_account2>
                </fields>
            </account>
        </groups>
    </paypal>
  </sections>
</config>
<config>
    <modules>
        <My_CustomPaypal>
            <version>1.0.0</version>
            <depends>
            <!-- no dependencies -->
            </depends>
        </My_CustomPaypal>
    </modules>
    <global>
        <models>
          <paypal>
              <rewrite>
                  <standard>My_CustomPaypal_Model_Standard</standard>
              </rewrite>
          </paypal>
        </models>
        <resources />
        <extraconfig />
        <blocks />
    </global>
</config>

然后重写standard.php并声明getStandardCheckoutFormFields方法,在该方法中必须按照上述注释中所述的方式放置逻辑。您肯定会得到私有方法_getAggregatedCartSummary的错误,所以重新定义它,就像在核心中一样,只是作用域是公共的。完成。

如果Paypal T&C允许您拥有多个业务帐户,您应该检查他们。事实上,我有两个sendbox商户帐户,我已经使用这两个不同的帐户结账,金额从买家帐户中扣除。但现在我想根据购物车总数使用这两种方法。我只能在paypal设置的admin->config中输入一封电子邮件,我想获得两个电子邮件地址,并想在redirect.php块中进行更改。但是thxthx joseph,我感谢您,但实际上我想提供两个电子邮件地址,以便管理员可以通过对system.xml进行更改来输入两封电子邮件。现在看看standard.php中的getStandardCheckoutFormFields使用$api=Mage::getModel'paypal/api_standard'->setConfigObject$this->getConfig;为了获得api_标准,这里使用了config。现在在这个函数中调用了getStandardCheckoutRequest,从这里不返回business_account 2。第二封电子邮件存储在core_config_数据中,路径为'paypal/general/business_account2'。getStandardCheckoutFormFields此函数用于block/redirect.php中向paypal提供变量。现在,我想覆盖定义getStandardCheckoutFormFields的模型,并根据我的要求返回变量business。我想要最终的合计,包括我认为必须使用Mage::getSingleton'checkout/session'->getQuote->getGrandTotal;,对吗?如果您在$request['business2']='test.com'中写入getStandardCheckoutRequest;然后它将返回block/redirect.php,并根据那里的条件更改电子邮件。但我不知道如何从核心配置数据中获取价值,我在核心配置数据中插入了路径。Tiayooo我使用以下Mage::getStoreConfig'paypal/general/business_account2'获取数据;