Solution for CIM Profile Creation Problem in Authorize.net with FdiAus Processor at Australia

One of our clients was facing a strange issue after setting up their site to process recurring credit card payments using Authorize.net CIM API.

The response for API request to create a CIM profile at Authorize.net was like:

<?xml version="1.0" encoding="utf-8"?>
<createCustomerProfileResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <messages>
        <resultCode>Error</resultCode>
        <message>
            <code>E00027</code>
            <text>The transaction was unsuccessful.</text>
        </message>
    </messages><customerPaymentProfileIdList/><customerShippingAddressIdList/>
    <validationDirectResponseList>
        <string>1,1,1,This transaction has been approved.,xxxxxx,P,xxxxxxxxxx,none,Test transaction for ValidateCustomerPaymentProfile.,0.01,CC,auth_only,xxx,xxxxxx,xxxxxx,,xxxxxx,xxxxxx,xxxxx,xxxxx,xx,,,xxxxxx@xxxxxx.xxx,,,,,,,,,0.00,0.00,0.00,FALSE,none,xxxxxxxxxxxxxxxxxx,M,,,,,,,,,,,,XXXXYYYY,xxxxxxxx,,,,,,,,,,,,,,,,</string>
    </validationDirectResponseList>
</createCustomerProfileResponse>

As you see, overall transaction status is set as failed with code E00027. It does a test transaction on $0.01 and that went success. We could not find anybody else faced this same problem after searching over Internet. So, we asked for help from Authorize.net support team. Their response contained this statement:

... we will send an AuthOnly (0.00 or 0.01) and we will follow up with void if the request is successful, and then the profile is created

FdiAus processor does not support Auth reversal (voiding an Auth only) this is what causing the issue. It is suggested that you may want to try creating profile in testMode. To do this, make sure validationMode Parameter is set to testMode.

So, the problem was with the payment processor. FdiAus does not support voiding an Auth only transaction.

We wanted a quick fix for this issue and that was easy one. This is what the quick fix applied to commerce_authnet module to send CIM profile request in test mode.

diff --git a/commerce_authnet.module b/commerce_authnet.module
index 24051b1..99dce04 100644
--- a/commerce_authnet.module
+++ b/commerce_authnet.module
@@ -1609,7 +1609,10 @@ function commerce_authnet_cim_request($payment_method, $request_type, $api_reque
         $validation_mode = 'none';
       }
       else {
-        $validation_mode = $payment_method['settings']['txn_mode'] == AUTHNET_TXN_MODE_LIVE ? 'liveMode' : 'testMode';
+        // $validation_mode = $payment_method['settings']['txn_mode'] == AUTHNET_TXN_MODE_LIVE ? 'liveMode' : 'testMode';
+        // Always use 'testMode' while creating customer profiles as suggested by
+        // Authenet support guy. FdiAus is not supporting
+        $validation_mode = 'testMode';
       }
       break;

This will make API request to use 'testMode' as validation mode always while creating CIM profiles. It worked for us and our recurring payment processing went good.