question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CustomerRequest missing riskDataCustomerRequest element on XML generation

See original GitHub issue

General information

  • SDK/Library version: 3.1.0
  • Environment: Doesn’t matter
  • Language, language version, and OS: Java

Issue description

CustomerRequest https://github.com/braintree/braintree_java/blob/master/src/main/java/com/braintreegateway/CustomerRequest.java#L156

The method buildRequest does not add the element RiskDataCustomerRequest even though is it part of the Customer Request.

Test Case

    CustomerRequest customerRequest = new CustomerRequest();
    customerRequest.riskData().customerBrowser(USER_AGENT);
    customerRequest.riskData().customerIP(REMOTE_IP);
    customerRequest.customField("test_field", "test123);
    System.out.println(customerRequest.toXML());

will output

<customer>
    <customFields>
        <test_field>test123</test_field>
    </customFields>
</customer>

I think all that is required is to add the missing addElement statement. i.e.

addElement("riskDataCustomerRequest", riskDataCustomerRequest).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
sestevenscommented, Oct 1, 2020

@Stexxen This issue has been fixed in version 3.2.0 of the SDK.

0reactions
sestevenscommented, Sep 15, 2020

Oh, good catch. The endpoint accepts XML tags in both dash case and camel case. So it would be

addElement("riskData", riskDataCustomerRequest).
Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling XMLs with "Missing" or "Asymmetric" Elements
When you set up a QuerySurge connection using the XML driver and query an "Asymmetric" XML document, you'll expect to see nulls in...
Read more >
xml element not generating in data control if field value is null
Hi All, I am facing issue with request payload in BPEL. Senario is 1. There is one BPEL process which recieves input and...
Read more >
Map XML elements to cells in an XML Map
To import and export XML data in Excel, an XML Map that associates XML elements with data in cells to get the results...
Read more >
How to fix "Root element is missing." when doing a Visual ...
I was getting missing element error pointing to NuGet.Config file. At that time it was looking some thing like this <?xml version="1.0" encoding="utf-8"?> ......
Read more >
Error 'System.Xml - The root element is missing' inside ...
During the normal operation of Controller, the client software will regularly read/write to its cache files. During intensive operations (such ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found