I'm working on a project that uses what appears to be a slightly older version of the PHP SDK. Sadly, the PHP code does not appear to specify any version for the SDK. I have constructed code using this SDK that is supposed to update a CIM profile. I keep getting this error though:
Error
Message: The element 'creditCard' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'expirationDate' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'cardNumber' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.
E00003
It appears to be generating this XML which causes the problem:
<?xml version="1.0" encoding="utf-8"?>
<updateCustomerPaymentProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>XXXXXXXXX</name>
<transactionKey>YYYYYYYY</transactionKey>
</merchantAuthentication>
<customerProfileId>AAAAAAAA</customerProfileId>
<paymentProfile>
<customerType>individual</customerType>
<payment>
<creditCard>
<expirationDate>2022-06</expirationDate>
<cardCode>456</cardCode>
</creditCard>
</payment>
<customerPaymentProfileId>BBBBBBBB</customerPaymentProfileId>
</paymentProfile>
</updateCustomerPaymentProfileRequest>
I've been trying to figure out what's wrong with this XML by checking the API:
http://developer.authorize.net/api/reference/index.html#customer-profiles-update-customer-payment-pr...
But I'm really just doing trial and error. Can someone help me sort this? My code looks something like this:
$authorizenet_cim_request = new AuthorizeNetCIM($this->conf_api_login_id, $this->conf_api_transaction_key);
$authorizenet_cim_request->setSandbox($this->conf_sandbox);
$authorizenet_cim_request->setLogFile($this->conf_log_file);
$paymentProfile = new AuthorizeNetPaymentProfile;
$paymentProfile->customerType = "individual";
$paymentProfile->payment->creditCard->expirationDate = "2022-06";
$paymentProfile->payment->creditCard->cardCode = "456";
$transaction_result = $authorizenet_cim_request->updateCustomerPaymentProfile("AAAAAAAA", "BBBBBBBB", $paymentProfile);
Any help would be much appreciated.