sample-code-php icon indicating copy to clipboard operation
sample-code-php copied to clipboard

profileTransAuthCapture invalid child element 'customerProfileId' in namespace

Open TerrePorter opened this issue 6 years ago • 0 comments

So I have this random error showing up that I can't seem to figure out, since the profileTransAuthCapture request does have a customerProfileId in the examples I find.

The error:

The element 'profileTransAuthCapture' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'customerProfileId' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'amount' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.

The code is basically from https://github.com/AuthorizeNet/sdk-php/blob/9ebe3336e470a0510f942f344e9d3277b3e73549/doc/CIM.markdown#creating-transactions

// Create Auth & Capture Transaction
$transaction = new AuthorizeNetTransaction;
$transaction->amount = "9.79";
$transaction->customerProfileId = $customerProfileId;
$transaction->customerPaymentProfileId = $paymentProfileId;
$transaction->customerShippingAddressId = $customerAddressId;
     (it doesn't have the line items)
$response = $request->createCustomerProfileTransaction("AuthCapture", $transaction);
$transactionResponse = $response->getTransactionResponse();

This only seems to happen sometimes. Any suggestions, other than upgrade the code lol that is in the works.

TerrePorter avatar Nov 14 '19 21:11 TerrePorter