cancel
Showing results for 
Search instead for 
Did you mean: 

Reg: API integration to charge client using CMI

Hi, i have been using the following API integration to charge client using CMI. 

 

$request = new AuthorizeNetCIM;
$customerProfile = new AuthorizeNetCustomer;
$transaction = new AuthorizeNetTransaction;
$transaction->amount = "4.00";
$transaction->customerProfileId = "304685436";
$transaction->customerPaymentProfileId = "304890863";
$transaction->customerShippingAddressId = "";

$lineItem = new AuthorizeNetLineItem;
$lineItem->itemId = "111";
$lineItem->name = "Refill Amount";
$lineItem->description = "Phones Purchase";
$lineItem->quantity = "1";
$lineItem->unitPrice = "4.00";
$lineItem->taxable = "true";
print_r($lineItem);

$transaction->lineItems[] = $lineItem;

$response = $request->createCustomerProfileTransaction("AuthCapture", $transaction);
print_r($response);
$transactionResponse = $response->getTransactionResponse();
print_r($transactionResponse);
echo "====".$transactionId = $transactionResponse->transaction_id;

 

It throws an error as :

 

AuthorizeNetLineItem Object ( [itemId] => 111 [name] => Refill Amount [description] => Phones Purchase [quantity] => 1 [unitPrice] => 4.00 [taxable] => true ) AuthorizeNetCIM_Response Object ( [xml] => SimpleXMLElement Object ( [messages] => SimpleXMLElement Object ( [resultCode] => Error [message] => SimpleXMLElement Object ( [code] => E00003 [text] => The element 'createCustomerProfileTransactionRequest' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'validationMode' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'extraOptions' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. ) ) ) [response] => ErrorE00003The element 'createCustomerProfileTransactionRequest' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'validationMode' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'extraOptions' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. [xpath_xml] => SimpleXMLElement Object ( [messages] => SimpleXMLElement Object ( [resultCode] => Error [message] => SimpleXMLElement Object ( [code] => E00003 [text] => The element 'createCustomerProfileTransactionRequest' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'validationMode' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'extraOptions' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. ) ) ) )

 

satheesh
Member
1 REPLY 1

 

Hi satheesh,

 

It looks like you are using createCustomerProfileTransactionRequest which is an outdated API call. Please use http://developer.authorize.net/api/reference/index.html#payment-transactions-charge-a-customer-profi... for charing a customer profile. It is also important to note that validationMode is only used for creating a payment profile and not for charging a profile.

 

Thanks,

Joy

Joy
Administrator Administrator
Administrator