Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Magento Credit card number mismatch with credit card type exception
 
jrottman
Jr. Member
 
Total Posts:  3
Joined:  2011-12-01
 

I am working with the magento api and I have run into a bit of an issue with creating an order. I have been able to get everything up to creating the order to work correctly. The issue that I am seeing is when I call the method to create the order I always get the exception: Credit card number mismatch with credit card type.

I am running Magento ver. 1.6.2.0

I have verified that the card I am testing with works via the magento frontend.

Any help with this is greatly appreciated.

This is the test code that I am using:

<?php
    $proxy 
= new SoapClient('http://localhost/index.php/api/soap/?wsdl');
    
$sessionId $proxy->login('shopapi''test123');
     
    
// Create a quote, get quote identifier
    
$shoppingCartId $proxy->call$sessionId'cart.create');
     
    
// Set customer, for example guest
    
$customerAsGuest = array(
        
"firstname" => "testFirstname",
        
"lastname" => "testLastName",
        
"email" => "test@test.com",
        
//"website_id" => "0",
        //"store_id" => "0",
        
"mode" => "guest"
    
);
    
$resultCustomerSet $proxy->call($sessionId'cart_customer.set', array( $shoppingCartId$customerAsGuest) );
     
    
// Set customer addresses, for example guest's addresses
    
$arrAddresses = array(
        array(
            
"mode" => "shipping",
            
"firstname" => "testFirstname",
            
"lastname" => "testLastname",
            
"company" => "testCompany",
            
"street" => "testStreet",
            
"city" => "testCity",
            
"region" => "CA",
            
"postcode" => "90049",
            
"country_id" => "US",
            
"telephone" => "0123456789",
            
"fax" => "0123456789",
            
"is_default_shipping" => 0,
            
"is_default_billing" => 0
        
),
        array(
            
"mode" => "billing",
            
"firstname" => "testFirstname",
            
"lastname" => "testLastname",
            
"company" => "testCompany",
            
"street" => "testStreet",
            
"city" => "testCity",
            
"region" => "CA",
            
"postcode" => "90049",
            
"country_id" => "US",
            
"telephone" => "0123456789",
            
"fax" => "0123456789",
            
"is_default_shipping" => 0,
            
"is_default_billing" => 0
        
)
    );
    
$resultCustomerAddresses $proxy->call($sessionId"cart_customer.addresses", array($shoppingCartId$arrAddresses));
     
    
// add products into shopping cart
    
$arrProducts = array(
        array(
            
"product_id" => "1",
            
"qty" => 1
        
)
    );
    
$resultCartProductAdd $proxy->call($sessionId"cart_product.add", array($shoppingCartId$arrProducts));
     
     
    
// get list of products
    
$shoppingCartProducts $proxy->call($sessionId"cart_product.list", array($shoppingCartId));
    
     
    
// set payment method
    
$paymentMethod = array(
        
"method" => "authorizenet",
        
"cc_type" => 'MC',
        
"cc_number" =>'5555555555554444' ,
        
"cc_exp_month" => 9,
        
"cc_exp_year" => 2014,
        
"cc_cid" => 123     
    
);
    
$resultPaymentMethod $proxy->call($sessionId"cart_payment.method", array($shoppingCartId$paymentMethod));
    
    
    
// create order
    
$resultOrderCreation $proxy->call($sessionId,"cart.order",array($shoppingCartId));
    
var_dump($resultOrderCreation);
?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
jrottman
Jr. Member
 
Total Posts:  3
Joined:  2011-12-01
 

Just looking to see if anyone has any update on why this would not work.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mitul69
Jr. Member
 
Total Posts:  1
Joined:  2012-01-22
 

Hello There

I have same problem can you please help me..?

Thanks

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