cancel
Showing results for 
Search instead for 
Did you mean: 

Bug report? updateCustomerPaymentProfileRequest

I'm not really sure where to submit bug reports and I'm not sure if  it's a bug or a mistype in the api documentation at http://developer.authorize.net/api/reference/index.html#customer-profiles-update-customer-payment-pr...

 

The documentation says that 'customerPaymentProfileId' should occur before 'defaultPaymentProfile' in the request but when submitting I kept getting the  'invalid child element' error response for 'defaultPaymentProfile' . 

 

Example:

 

E00003 The element 'paymentProfile' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'defaultPaymentProfile' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'

 

So after some digging through the xml schema I found that 'defaultPaymentProfile' is supposed to occur before 'customerPaymentProfileId'. 'defaultPaymentProfile' is declaired in 'customerPaymentProfileType' of which 'customerPaymentProfileExType' (where 'customerPaymentProfileId' is defined ) is a child.

 

When submitting 'updateCustomerPaymentProfileRequest' with 'defaultPaymentProfile' before 'customerPaymentProfileId' it works fine.

 

If there's a better place to report stuff like this please let me know and I'll put it there.

 

Thanks for your attention.

 

 

Dewbud
Member
3 REPLIES 3

Hi @Dewbud,

 

That's a good catch, and thanks for going the extra mile to cross-reference against the schema to figure out how to get it to work. I don't know the possibility of fixing at the schema level, but in the meantime, I'll get the documentation updated to change the positioning to hopefully avoid some other troubles.

 

Thanks so much for letting us know!

Aaron
All Star

Hello.
Now after a year I've faced the same problem and I don't see any mentions about fields order in the documentation and even don't understand why it may take the place in case of JSON API.
I use NodeJS and https://github.com/AuthorizeNet/sdk-node and it is a tricky thing trying to control fields order in JSON (as there is no any parser which guaranties the order) especially when it wrapped to classes inside SDK.
Request works only in case if fields "defaultPaymentProfile" and "customerPaymentProfileId" go last in block "paymentProfile" and only in this order: defaultPaymentProfile, customerPaymentProfileId.

So I have two questions now:
1. I there any chance to get it fixed?
2. I can not find the "correct" place for the "customerType" field where API accepts it, could somebody tell me?
btw I wasted few hours trying to understand what was wrong there and found this post only when tried to find authorize.net bug tracker.

Hi @Artyom

 

Have you checked our sample code for node for it https://github.com/AuthorizeNet/sample-code-node

 

Currently as both json/xml are mapping to same XSD schema we have this ordering restraint .

Going  forward we are working on our next gen SDKs which will be swagger driven and wont have this issue .  Stay tuned for it !!! 

 

Also you can try the json requests using our try it tab on API reference to quickly check the request . 

 

https://developer.authorize.net/api/reference/index.html#customer-profiles-update-customer-payment-p...

 

{
"updateCustomerPaymentProfileRequest": {
"merchantAuthentication": {
"name": "78BZ5Xprry",
"transactionKey": "8s2F95Q7brhHd7Tn"
},
"customerProfileId": "10000",

"paymentProfile": {
"customerType" : "business",
"billTo": {
"firstName": "John",
"lastName": "Doe",
"company": "",
"address": "123 Main St.",
"city": "Bellevue",
"state": "WA",
"zip": "98004",
"country": "USA",
"phoneNumber": "000-000-0000",
"faxNumber": ""
},
"payment": {
"creditCard": {
"cardNumber": "4111111111111111",
"expirationDate": "2026-01"
}
},
"defaultPaymentProfile": false,
"customerPaymentProfileId": "20000"
},
"validationMode": "liveMode"
}
}

 

Hope it helps .





Send feedback at developer_feedback@authorize.net