I'm trying to implement Accept.js and the PHP SDK. I'm receiving the error: The element 'opaqueData' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'dataValue' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'dataDescriptor' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.
Here is the log file
Sat, 12 May 2018 21:02:27 +0000 INFO : [execute] (/var/www/include/payment/authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/base/ApiOperationBase.php : 114) - Request Serialization Begin Sat, 12 May 2018 21:02:27 +0000 DEBUG : [execute] (/var/www/include/payment/authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/base/ApiOperationBase.php : 115) - net\authorize\api\contract\v1\CreateTransactionRequest Object ( [transactionRequest:net\authorize\api\contract\v1\CreateTransactionRequest:private] => net\authorize\api\contract\v1\TransactionRequestType Object ( [transactionType:net\authorize\api\contract\v1\TransactionRequestType:private] => authCaptureTransaction [amount:net\authorize\api\contract\v1\TransactionRequestType:private] => 1.01 [currencyCode:net\authorize\api\contract\v1\TransactionRequestType:private] => [payment:net\authorize\api\contract\v1\TransactionRequestType:private] => net\authorize\api\contract\v1\PaymentType Object ( [creditCard:net\authorize\api\contract\v1\PaymentType:private] => [bankAccount:net\authorize\api\contract\v1\PaymentType:private] => [trackData:net\authorize\api\contract\v1\PaymentType:private] => [encryptedTrackData:net\authorize\api\contract\v1\PaymentType:private] => [payPal:net\authorize\api\contract\v1\PaymentType:private] => [opaqueData:net\authorize\api\contract\v1\PaymentType:private] => net\authorize\api\contract\v1\OpaqueDataType Object ( [dataDescriptor:net\authorize\api\contract\v1\OpaqueDataType:private] => [dataValue:net\authorize\api\contract\v1\OpaqueDataType:private] => eyJjb2RlIjoiNTBfMl8wNjAwMDUzMjNFRDJFQkRFNDgzOUQ1RTY3NDlCMTJCNEM1MUEyOTdFNEI4Njk3NTc1NkQwRTJFQTUwNjY3MzZEODFDRjZCODc0Nzc0MThGMEI4Nzg4MjAxNUUzMkU3QzgyRTYwNzc4IiwidG9rZW4iOiI5NTI2MTU2NDAyMDc3MTk2ODAzNTAyIiwidiI6IjEuMSJ9 [dataKey:net\authorize\api\contract\v1\OpaqueDataType:private] => ) [emv:net\authorize\api\contract\v1\PaymentType:private] => ) [profile:net\authorize\api\contract\v1\TransactionRequestType:private] => [solution:net\authorize\api\contract\v1\TransactionRequestType:private] => [callId:net\authorize\api\contract\v1\TransactionRequestType:private] => [terminalNumber:net\authorize\api\contract\v1\TransactionRequestType:private] => [authCode:net\authorize\api\contract\v1\TransactionRequestType:private] => [refTransId:net\authorize\api\contract\v1\TransactionRequestType:private] => [splitTenderId:net\authorize\api\contract\v1\TransactionRequestType:private] => [order:net\authorize\api\contract\v1\TransactionRequestType:private] => net\authorize\api\contract\v1\OrderType Object ( [invoiceNumber:net\authorize\api\contract\v1\OrderType:private] => 10101 [description:net\authorize\api\contract\v1\OrderType:private] => Golf Shirts ) [lineItems:net\authorize\api\contract\v1\TransactionRequestType:private] => [tax:net\authorize\api\contract\v1\TransactionRequestType:private] => [duty:net\authorize\api\contract\v1\TransactionRequestType:private] => [shipping:net\authorize\api\contract\v1\TransactionRequestType:private] => [taxExempt:net\authorize\api\contract\v1\TransactionRequestType:private] => [poNumber:net\authorize\api\contract\v1\TransactionRequestType:private] => [customer:net\authorize\api\contract\v1\TransactionRequestType:private] => net\authorize\api\contract\v1\CustomerDataType Object ( [type:net\authorize\api\contract\v1\CustomerDataType:private] => individual [id:net\authorize\api\contract\v1\CustomerDataType:private] => 99999456654 [email:net\authorize\api\contract\v1\CustomerDataType:private] => EllenJohnson@example.com [driversLicense:net\authorize\api\contract\v1\CustomerDataType:private] => [taxId:net\authorize\api\contract\v1\CustomerDataType:private] => ) [billTo:net\authorize\api\contract\v1\TransactionRequestType:private] => net\authorize\api\contract\v1\CustomerAddressType Object ( [phoneNumber:net\authorize\api\contract\v1\CustomerAddressType:private] => [faxNumber:net\authorize\api\contract\v1\CustomerAddressType:private] => [email:net\authorize\api\contract\v1\CustomerAddressType:private] => [firstName:net\authorize\api\contract\v1\NameAndAddressType:private] => Ellen [lastName:net\authorize\api\contract\v1\NameAndAddressType:private] => Johnson [company:net\authorize\api\contract\v1\NameAndAddressType:private] => Souveniropolis [address:net\authorize\api\contract\v1\NameAndAddressType:private] => 14 Main Street [city:net\authorize\api\contract\v1\NameAndAddressType:private] => Pecan Springs [state:net\authorize\api\contract\v1\NameAndAddressType:private] => TX [zip:net\authorize\api\contract\v1\NameAndAddressType:private] => 44628 [country:net\authorize\api\contract\v1\NameAndAddressType:private] => USA ) [shipTo:net\authorize\api\contract\v1\TransactionRequestType:private] => [customerIP:net\authorize\api\contract\v1\TransactionRequestType:private] => [cardholderAuthentication:net\authorize\api\contract\v1\TransactionRequestType:private] => [retail:net\authorize\api\contract\v1\TransactionRequestType:private] => [employeeId:net\authorize\api\contract\v1\TransactionRequestType:private] => [transactionSettings:net\authorize\api\contract\v1\TransactionRequestType:private] => Array ( [0] => net\authorize\api\contract\v1\SettingType Object ( [settingName:net\authorize\api\contract\v1\SettingType:private] => duplicateWindow [settingValue:net\authorize\api\contract\v1\SettingType:private] => 60 ) ) [userFields:net\authorize\api\contract\v1\TransactionRequestType:private] => [surcharge:net\authorize\api\contract\v1\TransactionRequestType:private] => [merchantDescriptor:net\authorize\api\contract\v1\TransactionRequestType:private] => [subMerchant:net\authorize\api\contract\v1\TransactionRequestType:private] => [tip:net\authorize\api\contract\v1\TransactionRequestType:private] => ) [merchantAuthentication:net\authorize\api\contract\v1\ANetApiRequestType:private] => net\authorize\api\contract\v1\MerchantAuthenticationType Object ( [name:net\authorize\api\contract\v1\MerchantAuthenticationType:private] => 8LsH2h2er [transactionKey:net\authorize\api\contract\v1\MerchantAuthenticationType:private] => xxxx [sessionToken:net\authorize\api\contract\v1\MerchantAuthenticationType:private] => [password:net\authorize\api\contract\v1\MerchantAuthenticationType:private] => [impersonationAuthentication:net\authorize\api\contract\v1\MerchantAuthenticationType:private] => [fingerPrint:net\authorize\api\contract\v1\MerchantAuthenticationType:private] => [clientKey:net\authorize\api\contract\v1\MerchantAuthenticationType:private] => [accessToken:net\authorize\api\contract\v1\MerchantAuthenticationType:private] => [mobileDeviceId:net\authorize\api\contract\v1\MerchantAuthenticationType:private] => ) [clientId:net\authorize\api\contract\v1\ANetApiRequestType:private] => sdk-php-1.9.6 [refId:net\authorize\api\contract\v1\ANetApiRequestType:private] => ref1526158947 ) Sat, 12 May 2018 21:02:28 +0000 INFO : [execute] (/var/www/include/payment/authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/base/ApiOperationBase.php : 118) - Request Serialization End Sat, 12 May 2018 21:02:28 +0000 INFO : [_sendRequest] (/var/www/include/payment/authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/HttpClient.php : 75) - Url: https://apitest.authorize.net/xml/v1/request.api Sat, 12 May 2018 21:02:28 +0000 INFO : [_sendRequest] (/var/www/include/payment/authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/HttpClient.php : 77) - Request to AnetApi: <?xml version="1.0" encoding="UTF-8"?> <createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication> <name><![CDATA[8LsH2h2er]]></name> <transactionKey>xxxx</transactionKey> </merchantAuthentication> <clientId><![CDATA[sdk-php-1.9.6]]></clientId> <refId><![CDATA[ref1526158947]]></refId> <transactionRequest> <transactionType><![CDATA[authCaptureTransaction]]></transactionType> <amount>1.01</amount> <payment> <opaqueData> <dataValue><![CDATA[eyJjb2RlIjoiNTBfMl8wNjAwMDUzMjNFRDJFQkRFNDgzOUQ1RTY3NDlCMTJCNEM1MUEyOTdFNEI4Njk3NTc1NkQwRTJFQTUwNjY3MzZEODFDRjZCODc0Nzc0MThGMEI4Nzg4MjAxNUUzMkU3QzgyRTYwNzc4IiwidG9rZW4iOiI5NTI2MTU2NDAyMDc3MTk2ODAzNTAyIiwidiI6IjEuMSJ9]]></dataValue> </opaqueData> </payment> <order> <invoiceNumber><![CDATA[10101]]></invoiceNumber> <description><![CDATA[Golf Shirts]]></description> </order> <customer> <type><![CDATA[individual]]></type> <id><![CDATA[99999456654]]></id> <email><![CDATA[EllenJohnson@example.com]]></email> </customer> <billTo> <firstName><![CDATA[Ellen]]></firstName> <lastName><![CDATA[Johnson]]></lastName> <company><![CDATA[Souveniropolis]]></company> <address><![CDATA[14 Main Street]]></address> <city><![CDATA[Pecan Springs]]></city> <state><![CDATA[TX]]></state> <zip><![CDATA[44628]]></zip> <country><![CDATA[USA]]></country> </billTo> <transactionSettings> <setting> <settingName><![CDATA[duplicateWindow]]></settingName> <settingValue><![CDATA[60]]></settingValue> </setting> </transactionSettings> </transactionRequest> </createTransactionRequest> Sat, 12 May 2018 21:02:28 +0000 INFO : [_sendRequest] (/var/www/include/payment/authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/HttpClient.php : 89) - Sending 'XML' Request type Sat, 12 May 2018 21:02:28 +0000 INFO : [_sendRequest] (/var/www/include/payment/authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/HttpClient.php : 94) - Sending http request via Curl Sat, 12 May 2018 21:02:28 +0000 INFO : [_sendRequest] (/var/www/include/payment/authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/HttpClient.php : 96) - Response from AnetApi: <?xml version="1.0" encoding="utf-8"?><ErrorResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Error</resultCode><message><code>E00003</code><text>The element 'opaqueData' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'dataValue' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'dataDescriptor' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.</text></message></messages></ErrorResponse> Sat, 12 May 2018 21:02:28 +0000 INFO : [execute] (/var/www/include/payment/authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/base/ApiOperationBase.php : 128) - Response De-Serialization Begin Sat, 12 May 2018 21:02:28 +0000 INFO : [execute] (/var/www/include/payment/authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/base/ApiOperationBase.php : 130) - Response De-Serialization End
Any idea where I'm going wrong?
Solved! Go to Solution.
โ05-12-2018 02:14 PM
Hi @bdm
You are not passing the below field
<dataDescriptor>COMMON.ACCEPT.INAPP.PAYMENT</dataDescriptor>
Check https://developer.authorize.net/api/reference/index.html#payment-transactions-create-an-accept-payme... for more details .
Thanks
โ05-13-2018 10:55 PM
Hi @bdm
You are not passing the below field
<dataDescriptor>COMMON.ACCEPT.INAPP.PAYMENT</dataDescriptor>
Check https://developer.authorize.net/api/reference/index.html#payment-transactions-create-an-accept-payme... for more details .
Thanks
โ05-13-2018 10:55 PM
Hi
Thanks for the help. I'm using the SDK (https://github.com/AuthorizeNet/sdk-php) and not generating the XML myself. Why is this field being omitted from the XML?
Is there something I need to set when creating the transaction with the SDK?
Jeff
โ05-14-2018 07:34 AM
For anyone else running into this issue, I modified the sample code in the PHP SDK.
$opaqueData->setDataDescriptor($dataDescriptor);
was changed to
$opaqueData->setDataDescriptor("COMMON.ACCEPT.INAPP.PAYMENT");
โ05-14-2018 07:40 AM
Can any provide an example of how to use the opaquedata generated from Accept.js and passed in a php form as 2 elements. One for the descriptor and one for the value.
All the PHP sample code as for credit card is
// Create the payment data for a credit card $creditCard = new AnetAPI\CreditCardType(); $creditCard->setCardNumber("4111111111111111"); $creditCard->setExpirationDate("2038-12"); $creditCard->setCardCode("123");
I do not understand what I need to do to utilize the nonce instead of the creditcard data???
I've searched the forums but all I find is people using XML and not the SDK.
Kind of stuck. Wish the sample code would give examples of using the opaqueData instead of just saying you can replace any credit card data with opaqueData.
โ04-01-2021 11:25 PM