<?xml version="1.0" ?>
<!--
/**
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL).
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
* @category   	Payment Gateway
* @package    	MercadoPago
* @author      	Gabriel Matsuoka (gabriel.matsuoka@gmail.com)
* @copyright  	Copyright (c) MercadoPago [http://www.mercadopago.com]
* @license    	http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*/
-->
<config>
    <modules>
        <MercadoPago_Core>
            <version>2.3.0</version>
        </MercadoPago_Core>
    </modules>

    <global>
        <models>
            <mercadopago>
                <class>MercadoPago_Core_Model</class>
            </mercadopago>
        </models>
        <resources>
            <mercadopago_setup>
                <setup>
                    <module>MercadoPago_Core</module>
                    <class>Mage_Sales_Model_Resource_Setup</class>
                </setup>
            </mercadopago_setup>
        </resources>
        <blocks>
            <mercadopago>
                <class>MercadoPago_Core_Block</class>
            </mercadopago>
        </blocks>

        <helpers>
            <mercadopago>
                <class>MercadoPago_Core_Helper</class>
            </mercadopago>
        </helpers>

        <events>
            <admin_system_config_changed_section_payment>
                <observers>
                    <observer>
                        <class>MercadoPago_Core_Model_Observer</class>
                        <method>checkAndValidData</method>
                    </observer>
                </observers>
            </admin_system_config_changed_section_payment>
        </events>
        <sales>
            <quote>
                <totals>
                    <mercadopago>
                        <class>mercadopago/custom_finance_cost</class>
                        <before>grand_total</before>
                        <after>tax</after>
                    </mercadopago>
                    <discount_mercadopago>
                        <class>mercadopago/discount_coupon</class>
                        <before>grand_total</before>
                        <after>tax</after>
                    </discount_mercadopago>
                </totals>
            </quote>
            <order_invoice>
                <totals>
                    <mercadopago>
                        <class>mercadopago/custom_finance_cost_invoice</class>
                    </mercadopago>
                    <discount_mercadopago>
                        <class>mercadopago/discount_coupon_invoice</class>
                    </discount_mercadopago>
                </totals>
            </order_invoice>
            <order_creditmemo>
                <totals>
                    <mercadopago>
                        <class>mercadopago/custom_finance_cost_creditmemo</class>
                    </mercadopago>
                    <discount_mercadopago>
                        <class>mercadopago/discount_coupon_creditmemo</class>
                    </discount_mercadopago>
                </totals>
            </order_creditmemo>
        </sales>

        <fieldsets>
            <sales_convert_quote_address>
                <discount_coupon_amount><to_order>*</to_order></discount_coupon_amount>
                <base_discount_coupon_amount><to_order>*</to_order></base_discount_coupon_amount>
            </sales_convert_quote_address>
        </fieldsets>

    </global>


    <frontend>
        <routers>
            <mercadopago>
                <use>standard</use>
                <args>
                    <module>MercadoPago_Core</module>
                    <frontName>mercadopago</frontName>
                </args>
            </mercadopago>
        </routers>
        <translate>
            <modules>
                <mercadopago_core>
                    <files>
                        <default>MercadoPago_Core.csv</default>
                    </files>
                </mercadopago_core>
            </modules>
        </translate>
        <layout>
            <updates>
                <mercadopago_core>
                    <file>mercadopago.xml</file>
                </mercadopago_core>
            </updates>
        </layout>
    </frontend>


    <adminhtml>
        <translate>
            <modules>
                <mercadopago_core>
                    <files>
                        <default>MercadoPago_Core.csv</default>
                    </files>
                </mercadopago_core>
            </modules>
        </translate>
        <layout>
            <updates>
                <mercadopago_core>
                    <file>mercadopago.xml</file>
                </mercadopago_core>
            </updates>
        </layout>
    </adminhtml>

    <default>
        <payment>            
            <mercadopago>
                <country>mlb</country>
                <order_status_approved>processing</order_status_approved>
                <order_status_refunded>pending</order_status_refunded>
                <order_status_in_process>pending</order_status_in_process>
                <order_status_in_mediation>pending</order_status_in_mediation>
                <order_status_rejected>pending</order_status_rejected>
                <order_status_cancelled>pending</order_status_cancelled>
                <order_status_chargeback>pending</order_status_chargeback>
                <use_successpage_mp>1</use_successpage_mp>
                <logs>0</logs>
                <debug_mode>0</debug_mode>
            </mercadopago>

            <mercadopago_custom>
                <active>0</active>
                <model>mercadopago/custom_payment</model>
                <!-- nome do modulo na exibição para o comprador -->
                <title translate="label">Credit Card - Mercado Pago</title>
                <allowspecific>0</allowspecific>
                <banner_checkout>http://imgmp.mlstatic.com/org-img/MLB/MP/BANNERS/tipo2_468X60.jpg</banner_checkout>
                <sort_order>-2</sort_order>
                <payment_action>authorize</payment_action>
                <coupon_mercadopago>0</coupon_mercadopago>
            </mercadopago_custom>

            <mercadopago_customticket>
                <active>0</active>
                <model>mercadopago/customTicket_payment</model>
                <!-- nome do modulo na exibição para o comprador -->
                <title translate="label">Ticket - Mercado Pago</title>
                <allowspecific>0</allowspecific>
                <binary_mode>0</binary_mode>
                <banner_checkout>http://imgmp.mlstatic.com/org-img/MLB/MP/BANNERS/2014/230x60.png</banner_checkout>
                <sort_order>-1</sort_order>
                <payment_action>authorize</payment_action>
                <coupon_mercadopago>0</coupon_mercadopago>
            </mercadopago_customticket>

            <mercadopago_standard>
                <active>0</active>
                <model>mercadopago/standard_payment</model>
                <!-- nome do modulo na exibição para o comprador -->
                <title>Mercado Pago</title>
                <allowspecific>0</allowspecific>
                <banner_checkout>http://imgmp.mlstatic.com/org-img/MLB/MP/BANNERS/tipo2_468X60.jpg</banner_checkout>
                <sort_order>-1</sort_order>
                <installments>24</installments>
                <type_checkout>iframe</type_checkout>
                <auto_return>1</auto_return>
                <iframe_width>900</iframe_width>
                <iframe_height>700</iframe_height>
                <sandbox_mode>0</sandbox_mode>
            </mercadopago_standard>

        </payment>
    </default>

</config>
