【问题标题】:Magento Check if Payment Paid in Success PageMagento 检查付款是否在成功页面中支付
【发布时间】:2014-09-03 05:38:59
【问题描述】:

请告诉我如何在支付成功屏幕上找到支付成功或失败的信息。请给我发送代码 sn-p。

他们上面的要求是在完成付款后,我们需要在不改变管理界面中的订单状态的情况下向客户提供可下载的链接。

提前致谢,

P.Karthikeyan

【问题讨论】:

    标签: php magento paypal payment


    【解决方案1】:

    创建结构和文件:

    app/etc/modules/Myproyect_Mymodule.xml
    app/code/local/Myproyect/Mymodule
    app/code/local/Myproyect/Mymodule/etc/config.xml
    app/code/local/Myproyect/Mymodule/Model/Mymodel.php
    

    创建 xml 文件以设置模块:app/etc/modules/Myproyect_Mymodule.xml

    <?xml version="1.0"?>
    <config>
        <modules>
            <Myproyect_Mymodule>
                <active>true</active>
                <codePool>local</codePool>
            </Myproyect_Mymodule>
        </modules>
    </config>
    

    在这里您将看到挂钩配置。在“事件”选项卡中,您可以通过设置事件的名称(第 21 行)、您的模块(第 23 行)和类的方法(第 26 行)来将任何观察者添加到任何事件。

    app/code/local/Myproyect/Mymodule/etc/config.xml:
    
    <?xml version="1.0"?>
    <config>
        <modules>
            <Myproyect_Mymodule>
                <version>0.0.1</version>
            </Myproyect_Mymodule>
        </modules>
        <global>
            <helpers>
                <mymodule>
                    <class>Myproyect_Mymodule_Helper</class>
                </mymodule>
            </helpers>
            <models>
                <mymodule>
                    <class>Myproyect_Mymodule_Mymodel</class>
                </mymodule>
            </models>
            <events>
                <!-- here the event to hook: -->
                <checkout_onepage_controller_success_action>
                    <observers>
                        <mymodule_model_mymodel>
                            <type>model</type>
                            <class>Myproyect_Mymodule_Model_Mymodel</class>
                            <method>myModelMethod</method>
                        </mymodule_model_mymodel>
                    </observers>
                </checkout_onepage_controller_success_action>
           </events>
        </global>
    </config>
    

    在第 6 行,您必须为指定的事件创建要执行的方法。 app/code/local/MyProject/MyModulo/Model/MyModel.php:

    class Myproyect_Mymodule_Model_Mymodel extends Mage_Core_Model_Abstract
    {
    
        public function myModelMethod()
        {
             // acciones.
        }
    
    }
    

    【讨论】:

      猜你喜欢
      • 2022-01-05
      • 2011-07-29
      • 2013-03-21
      • 2014-07-21
      • 2013-01-17
      • 2021-10-07
      • 2014-02-21
      • 2013-01-24
      • 2013-02-22
      相关资源
      最近更新 更多