Magento Forum

   
How to add and configure new credit card types
 
Predrag
Jr. Member
 
Total Posts:  9
Joined:  2007-12-04
Croatia
 

Hi

I am trying to develop payment module for Croatian customers - to work with local payment provider. It showed up in System/Configuration/Payment Method menu and new added fields showed up in admin interface.

Now, I would like to add and configure new credit card types in Magento to use them with this new payment method.

As I understood - I can add regular expressions for credit cards in Payment/Model/Method/Cc.php through $ccTypeRegExpList - and function getCcTypes() in Payment/Model/Config.php is responsible for retrieving the array of credit card types but I do not understand from where the array of credit card types is actually retrieved i.e - where I have to actually add data for new credit card types.

Can anyone advise me how to do this ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

Try adding this to the config.xml file for your module

<config>
    <global>
        <
payment>
            <
cc>
                <
types>
                    <
XX>
                        <
code>XX</code>
                        <
name>Xcredit Xcard</name>
                        <
order>0</order>
                    </
XX>
                </
types>
            </
cc>
        </
payment>
    </global>
</
config>

 
Magento Community Magento Community
Magento Community
Magento Community
 
Predrag
Jr. Member
 
Total Posts:  9
Joined:  2007-12-04
Croatia
 

Thank you, it was helpful.

Anyway, except this modification I added XX in <cctypes> tag - in the same file (local config.xml):
<cctypes>AE,VI,MC,XX,DI</cctypes>

Also, I added XX in return array of the function getAllowedTypes() in local Cctype.php:

public function getAllowedTypes()
{
return array(’VI’, ‘MC’, ‘AE’, ’XX‘, ‘DI’, ‘OT’);
}

Then - new type of credit card showed up in admin interface.

Thanks again.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bstdevelopment
Member
 
Total Posts:  48
Joined:  2008-04-14
 

for client side validation for the new credit card types check:
http://www.magentocommerce.com/boards/viewthread/6273/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top