Magento – SOAP API Checkout Error: Credit card number mismatch with credit card type

paypalpaypal-payflow-prosoap

Please note that this is not a duplicate question – the existing questions do not address the issue with the same level of specificity.

I am receiving the following error when attempting to process credit cards via PayPal PayFlow:

Fatal error: Uncaught SoapFault exception: [1008] Credit card number mismatch with credit card type.

I have fully configured PayFlow within Magento with test mode active using identical PayPal credentials to those used in another (fully functional, non-Magento) application.

I have a shopping cart active with a user and products successfully attached – I have tested this portion by submitting the test payment as a check order and it works fine.

Once the cart is ready, I attach payment details as follows:

$paymentMethod = array(
    'po_number' => null,
    'method' => 'verisign',
    'cc_cid' => '123',
    'cc_owner' => $customer['firstname'].' '.$customer['lastname'],
    'cc_number' => '4111111111111111',
    'cc_type' => 'VI',
    'cc_exp_year' => '2022',
    'cc_exp_month' => '12'
);
$proxy->shoppingCartPaymentMethod($sessionId, $cartId, $paymentMethod);

At this point, no errors have been thrown. The error occurs after the following code:

$proxy->shoppingCartOrder($sessionId, $cartId, null, null);

What could be causing this error? Are there any known starting points for fixing it? Thanks in advance!

Best Answer

I think this post on Stack Overflow is most immediately relevant to you.

The issue is PCI Compliance. Magento never saves credit card information in it's system for payment processing, since that would put customers' financial information at risk. Instead, it uses PayPal (or Authorize.net or whatever) as a payment gateway.

The problem is that the API is designed to have two round trips to your server to create your order - the cartPaymentMethod to add the credit card, shoppingCartOrder to process the order. Because of that PCI compliance, and because Magento doesn't ever store CC data by the time the second call is made Magento has already lost the card info. Viola, CC mistmatch.

The solution is to create an extension to the API that would alter shoppingCartOrder to accept the payment info and effectively run both calls at the same time. Unfortunately, I've yet to find one that exists. I'm on the lookout for a solution as well, and if one should arise I'll be sure to post a subsequent note here.

Related Topic