cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Error E00003: Name cannot begin with the '>' character, hexadecimal value 0x3E. Line 2, position 250

I'm trying to use the CIM API, but when calling its createCustomerProfileTransaction() method, I get to the error mentioned in the title.

 

As far as I could determine, this is caused by the internal _addObject() method listing all properties of the $transaction object (line #115 in AuthorizeNetCIM), including the private and protected ones. In case of these, the $key variables (line #382 in the same file) have invalid values, hence the submitted XML is invalid.

 

I'm listing the resulting, submitted XML content below so that you could see what I'm talking about:

 

<createCustomerProfileTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
    <merchantAuthentication>
        <name>588keqHBF3</name>
        <transactionKey>657kXV4brP97w8ZK</transactionKey>
    </merchantAuthentication>
    <transaction>
        <profileTransAuthCapture>
            <>none</>
            <>
                <0>AuthOnly</0>
            </>
            <>
                <0>AuthCapture</0>
            </>
            <>
                <0>CaptureOnly</0>
            </>
            <>
                <0>PriorAuthCapture</0>
            </>
            <>
                <0>Refund</0>
            </>
            <>
                <0>Void</0>
            </>
            <>588keqHBF3</>
            <>657kXV4brP97w8ZK</>
            <VERIFY_PEER>1</VERIFY_PEER>
            <>1</>
            <lineItems>
                <itemId>1</itemId>
                <name>Menu Item 1 MOD</name>
                <quantity>2</quantity>
                <unitPrice>31.95</unitPrice>
                <taxable>false</taxable>
            </lineItems>
            <lineItems><itemId>9</itemId><name>Discount started</name><quantity>1</quantity><unitPrice>17.21</unitPrice><taxable>false</taxable></lineItems>
            <amount>81.11</amount>
            <customerProfileId>11098440</customerProfileId>
            <customerPaymentProfileId>10090266</customerPaymentProfileId>
        </profileTransAuthCapture>
    </transaction>
</createCustomerProfileTransactionRequest>

Again, I'm not generating this XML - it's automatically done by the PHP SDK.

Any ideas for how to solve this issue? It's been messing with my head all day...

paltinescu
Member
1 ACCEPTED SOLUTION

Accepted Solutions
$transaction = new AuthorizeNetCIM;

should be

$transaction = new AuthorizeNetTransaction;

 

 

View solution in original post

4 REPLIES 4

can you post the code that you use to create the transaction?

RaynorC1emen7
Expert

It's something like

 

$lineItem              = new AuthorizeNetLineItem;
$lineItem->itemId      = '123';
$lineItem->name        = 'itemName';
$lineItem->quantity    = '1';
$lineItem->unitPrice   = '1.23';
$lineItem->taxable     = 'false';

$transaction = new AuthorizeNetCIM;

$transaction->lineItems[] = $lineItem;

$transaction->amount = '1.23';
$transaction->customerProfileId = $customerProfileID;
$transaction->customerPaymentProfileId = $paymentProfileID;
$transaction->customerShippingAddressId = $shippingProfileID;

$request = new AuthorizeNetCIM;

$response = $request->createCustomerProfileTransaction('AuthCapture', $transaction);

if($response->isOk()){
    $transactionResponse = $response->getTransactionResponse();
    
    //...
}else{
    //...
}

 The three variables ($customerProfileID, $paymentProfileID, $shippingProfileID) contain valid, real IDs (I can see them in my Authorize.Net account's Customer Information Manager page).

 

Again, I don't think that my code has anything to do with this error. I think the problem happens in AuthorizeNetCIM class' _addObject() method, called from its createCustomerProfileTransaction() method. Since _addObject() is a method called from within an AuthorizeNetCIM object, it lists all of the $transaction object's properties, including its protected and private ones - and I think those are the ones messing the resulting XML.

$transaction = new AuthorizeNetCIM;

should be

$transaction = new AuthorizeNetTransaction;

 

 

Oh crap...! You're right, of course! Thanks so much for making me see the obvious!