cancel
Showing results for 
Search instead for 
Did you mean: 

CIM ccv (cardCode) help

Hello,

 

I and a colleague of mine have been writing some code to interface with Authorize.net's CIM, in doing so; I am trying to get the CCV to be validated when adding a payment profile to Authorize.

 

According to the var dumping of (PHP) variables, it appears to be only "acknowledging" the addition when using the "createCustomerProfileTransactionRequest", resulting in an error...

 

Curious if any others have run into this, and why the setParam option when set seems to be ignored on the others end?

 

Here is the class that I am using presently:

 

http://orangomedia.com/projects/authorize/authorizenet.cim.class.txt

 

Is there any pointers one can offer?  I feel it might be simple, as a matter of placement, the structure is a bit vast for the API so any assistance is appreciated!

 

When dropping the items in the code to include the cardCode as part of the payment fields, it results in the following error:

 

The element 'payment' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'cardCode' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.

alemstrom
Contributor
27 REPLIES 27
<payment>
" . $this->paymentType() . "
" . $this->transactionCardCode() . "
</payment>

 cardcard code need to be inside paymentType

 

 

 

I am afraid I do not understand what it is you're stating, are you suggesting it should reside in the php function paymentType?

The request xml should look like this

<payment>
<creditCard>
<cardNumber>4111111111111111</cardNumber>
<expirationDate>2023-12</expirationDate>
<cardCode>123</cardCode>
</creditCard>
</payment>

 where cardCode is a child of creditcard, not payment

 

 

As you can see I have applied the cardcode function in the payment type function, still seeing the same ... its completely ignoring it

 

function paymentType()
{
if (isset($this->params['paymentType']))
{
if (($this->params['paymentType'] == "echeck")
|| ($this->params['paymentType'] == "bankAccount"))
{
return "
<bankAccount>
" . $this->accountType() . "
" . $this->routingNumber() . "
" . $this->accountNumber() . "
" . $this->nameOnAccount() . "
" . $this->echeckType() . "
" . $this->bankName() . "
</bankAccount>";
}
elseif (($this->params['paymentType'] == "creditcard")
|| ($this->params['paymentType'] == "creditCard"))
{
return "
<creditCard>
" . $this->cardNumber() . "
" . $this->expirationDate() . "
" . $this->transactionCardCode() . "
</creditCard>";
}
else
{
$this->error_messages[] .= 'setParameter(): paymentType is required and must be (bankAccount or creditCard)';
}
}
else
{
$this->error_messages[] .= 'setParameter(): paymentType is required and must be (bankAccount or creditCard)';
}
}

function transactionCardCode()
{
if (isset($this->params['transactionCardCode']))
{
if (preg_match('/^[0-9]{3,4}$/', $this->params['transactionCardCode']))
{
return "<cardCode>" . $this->params['transactionCardCode'] . "</cardCode>";
}
else
{
$this->error_messages[] .= 'setParameter(): transactionCardCode must be 3 to 4 digits';
}
}
}

What is the request xml look like?

<?xml version='1.0' encoding='utf-8'?>
<createCustomerPaymentProfileRequest xmlns='AnetApi/xml/v1/schema/AnetApiSchema.xsd'>
<merchantAuthentication>
<name>47HuD9XXX</name>
<transactionKey>XXXUnpu9XXXD5K7v</transactionKey>
</merchantAuthentication>

<customerProfileId>522897482</customerProfileId>
<paymentProfile>

<billTo>
<firstName>Andrew</firstName>
<lastName>Test</lastName>

<address>307 N Ball St</address>
<city>Owosso</city>
<state>MI</state>
<zip>48867</zip>
<country>US</country>


</billTo>
<payment>

<creditCard>
<cardNumber>REMOVED</cardNumber>
<expirationDate>2014-09</expirationDate>
<cardCode>000</cardCode>
</creditCard>
</payment>
</paymentProfile>
<validationMode>liveMode</validationMode>
</createCustomerPaymentProfileRequest>

the xml look ok, what is not working?

According to Authorize, they aren't receiving it...

what do you mean according to authorize.net? not getting ccv response in the validationDirectResponse?