Closed Stexxen closed 3 years ago
@Stexxen Thanks for raising this issue. It looks like a bug in the SDK. We'll post here once we have a fix out for this.
@Stexxen We're also happy to accept PRs if this is something you're interested in fixing!
@sestevens Could be something we can do, but someone from Braintree will need to confirm that the XML tag
<riskDataCustomerRequest></riskDataCustomerRequest>
Is the correct tag, as I'm only guessing that's what it should be.
@Stexxen The tag should be:
<risk-data></risk-data>
It looks like the element is being added correctly in our .NET SDK: https://github.com/braintree/braintree_dotnet/blob/18dc68b57092258f5f5e7982a7b0146394a5bd97/src/Braintree/CustomerRequest.cs#L102.
unfortunately it looks like they use different XML schemas. (Do they use different endpoints)?
Java (camelCase)
addElement("deviceData", deviceData).
addElement("paymentMethodNonce", paymentMethodNonce).
addElement("defaultPaymentMethodToken", defaultPaymentMethodToken).
C# (kebab-case)
AddElement("device-data", DeviceData).
AddElement("payment-method-nonce", PaymentMethodNonce).
AddElement("default-payment-method-token", DefaultPaymentMethodToken).
Unless the implementation specific RequestBuilder does something to normalise the 2 naming conventions?
That said, it suggests that the Java line would either be
addElement("riskData", riskDataCustomerRequest).
or
addElement("riskData", riskDataCustomerRequest.riskData()).
Oh, good catch. The endpoint accepts XML tags in both dash case and camel case. So it would be
addElement("riskData", riskDataCustomerRequest).
@Stexxen This issue has been fixed in version 3.2.0 of the SDK.
General information
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
will output
I think all that is required is to add the missing addElement statement. i.e.