Thursday, November 21, 2013

Test Credit Card Numbers for Payment Gateways

Notes to Myself
MIGS (ANZ Bank, Bendigo Bank, Suncorp Bank, Commonwealth Bank CommWeb)
Card TypeNumberExpiry DateCCV
MasterCard512345678901234605/17123
MasterCard531358100012343005/17123
VISA400555000000000105/17123
VISA455701234567890205/17123
AMEX34567890123456405/171234
Bankcard (Australian Domestic)561090123456789905/17123
Diners Club3012345678901905/17123

Saturday, January 19, 2013

Magento - How to switch Base URLs without modifying the Database

As Magento keeps its base URL in database, there is no easy way of accessing the same database from two different URLs(dev/ staging) or moving the same database to staging environment from development without updating core_config_data table.

After fiddling around with Magento core, I found that getBaseUrl() is responsible of retrieving base URL. So If we could override getBaseUrl() method to get the base URL from dev or staging environments without depending on the database, then we could keep database records with live settings.

Below code will explain how I achieved this task and the code itself is explainable.

1. app/etc/modules/My_Configurator.xml

    
        
            true
            local
        
    


2. app/code/local/My/Configurator/etc/config.xml

    
        
            
                
                    My_Configurator_Model_Store
                
            
        
    


3. app/code/local/My/Configurator/Model/Store.php


Note: Make sure you disable this extension from production server as we want to run getBaseUrl() method from the Core.

Happy Coding..