"The element 'createCustomerProfileRequest' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element '_xmlns' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'."我发送的 json 是 :-The json I'm sending is :-{ "createCustomerProfileRequest": { "merchantAuthentication": { "name": "name", "transactionKey": "transactionKey" }, "refId": "1361101257555", "profile": { "merchantCustomerId": "2CLINC056", "description": "hiiiiii.", "email": "", "paymentProfiles": [ { "customerType": "individual", "billTo": { "firstName": "Joe", "lastName": "Test", "company": "CompanyA", "address": "hello", "city": "Bangalore", "state": "Delhi", "zip": "560078", "country": "IN", "phoneNumber": "415-555-1212", "faxNumber": "415-555-1313" }, "payment": { "creditCard": { "cardNumber": "370000000000002", "expirationDate": "2029-12" } } }, { "customerType": "individual", "billTo": { "firstName": "Joe", "lastName": "Test", "company": "CompanyA", "address": "vel", "city": "Chennai", "state": "AK", "zip": "560089", "country": "US", "phoneNumber": "415-555-1212", "faxNumber": "415-555-1313" }, "payment": { "creditCard": { "cardNumber": "38000000000006", "expirationDate": "2029-12" } } } ] }, "validationMode": "testMode", "_xmlns": "AnetApi/xml/v1/schema/AnetApiSchema.xsd" }}开发者链接推荐答案我认为您的问题不在于付款配置文件,而在于 JSON 本身.你在那里有一个无效的元素,我认为是这一行:I think your issue is not with the payment profiles but with the JSON itself. You have an invalid element in there and I think it is this line:"_xmlns": "AnetApi/xml/v1/schema/AnetApiSchema.xsd"否则您的请求看起来不错,因为我能够使用类似的 JSON 创建多个付款资料.两者之间的唯一区别是我的 JSON 没有那条线.Otherwise your request looks fine as I was able to create multiple payment profiles using similar JSON. The only difference between the two was my JSON didn't have that line.请求 JSON:{ "createCustomerProfileRequest": { "merchantAuthentication": { "name": "xxxxxxxx", "transactionKey": "xxxxxxxxxxxxxxxx" }, "profile": { "merchantCustomerId": "52353345", "email": "[email protected]", "paymentProfiles": [ { "customerType": "individual", "billTo": { "firstName": "John", "lastName": "Smith", "address": "12345 Main Street", "city": "Townsville", "state": "NJ", "zip": "12345", "phoneNumber": "800-555-1234" }, "payment": { "creditCard": { "cardNumber": "5555555555554444", "expirationDate": "2023-08" } } }, { "customerType": "individual", "billTo": { "firstName": "John", "lastName": "Smithberg", "address": "42 Main Street", "city": "Townsville", "state": "NJ", "zip": "12345", "phoneNumber": "800-555-1234" }, "payment": { "creditCard": { "cardNumber": "5105105105105100", "expirationDate": "2023-09" } } } ], "shipToList": { "firstName": "John", "lastName": "Smith", "address": "12345 Main Street", "city": "Townsville", "state": "NJ", "zip": "12345", "phoneNumber": "800-555-1234" } }, "validationMode": "liveMode" }}响应 JSON:{ "customerProfileId": "1506322353", "customerPaymentProfileIdList": [ "1505667207", "1505667208" ], "customerShippingAddressIdList": [ "1505655763" ], "validationDirectResponseList": [ "1,1,1,This transaction has been approved.,A2FD5O,Y,40023515435,none,Test transaction for ValidateCustomerPaymentProfile.,0.00,CC,auth_only,52353345,John,Smith,,12345 Main Street,Townsville,NJ,12345,,800-555-1234,,[email protected],,,,,,,,,0.00,0.00,0.00,FALSE,none,32573C7D03376A9052AACA73835EDAEF,P,2,,,,,,,,,,,XXXX4444,MasterCard,,,,,,,,,,,,,,,,,", "1,1,1,This transaction has been approved.,AO13Y1,Y,40023515436,none,Test transaction for ValidateCustomerPaymentProfile.,0.00,CC,auth_only,52353345,John,Smithberg,,42 Main Street,Townsville,NJ,12345,,800-555-1234,,[email protected],,,,,,,,,0.00,0.00,0.00,FALSE,none,5B937D29D29F261776859B50DC1C3CF6,P,2,,,,,,,,,,,XXXX5100,MasterCard,,,,,,,,,,,,,,,,," ], "messages": { "resultCode": "Ok", "message": [ { "code": "I00001", "text": "Successful." } ] }} 这篇关于添加客户多付款时namespace中元素'createCustomerProfileRequest'报错的解决方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-24 12:54