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'.
09-18-2014 07:30 AM - edited 09-18-2014 07:44 AM
<payment> " . $this->paymentType() . " " . $this->transactionCardCode() . " </payment>
cardcard code need to be inside paymentType
09-18-2014 02:02 PM
I am afraid I do not understand what it is you're stating, are you suggesting it should reside in the php function paymentType?
09-23-2014 05:51 AM
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
09-23-2014 06:04 AM - edited 09-23-2014 06:04 AM
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)';
}
}
09-23-2014 06:39 AM
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';
}
}
}
09-23-2014 06:47 AM
What is the request xml look like?
09-23-2014 06:49 AM
<?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>
09-23-2014 07:10 AM - edited 09-23-2014 07:11 AM
the xml look ok, what is not working?
09-23-2014 07:14 AM
According to Authorize, they aren't receiving it...
09-23-2014 07:26 AM
what do you mean according to authorize.net? not getting ccv response in the validationDirectResponse?
09-23-2014 07:35 AM