Hi -
I am unable to figure out how to retrieve the transfer status from the Transfer object when calling the transfers.create
high-level function in Java/Kotlin sdk
Thank you for your time.
Hi -
I am unable to figure out how to retrieve the transfer status from the Transfer object when calling the transfers.create
high-level function in Java/Kotlin sdk
Thank you for your time.
i @nsethi – the creation of a transfer, or any new resource, returns an empty response body. However, it does return the URL of the transfer the location
response header. You can then retrieve the transfer from the API to get the status of the transfer from the response body.
Hope that helps! Let us know if you run into any isssues!
Thanks @shreya. Noticed a bug in the kotlin sdk. The Fees object in transfer call doesn’t get serialized correctly in the Kotlin/Java SDK:
SDK transfer function call:
transfer = client.transfers.create(
getFundingSourceUrl(sourceFundingId), getFundingSourceUrl(destinationFundingId),
new Amount(transferAmount.toString(), Currency.USD),
null,
fees == null ? null : fees.stream().toArray(Fee[]::new),
clearing,
null,
correlationKey, //returned in webhook events for us to query by
idempotencyKey);
Generated payload:
{
"_links": {
"source": {
"href": "https://api-sandbox.dwolla.com/funding-sources/fdfe1830-e30d-417b-9b96-8120e3147ad4"
},
"destination": {
"href": "https://api-sandbox.dwolla.com/funding-sources/0d2d7ebc-9776-4e69-ab46-9a2a885e8963"
}
},
"amount": {
"value": "100.00",
"currency": "USD"
},
"fees": [
{
"chargeTo": "196f675c-998d-4c3d-bd09-3055ef62ae4e",
"amount": {
"value": "1.3",
"currency": "USD"
}
}
],
"clearing": {
"source": "next-day"
},
"correlationId": "ce1c6bca-bc20-491b-9e98-d5213daca249"
}
Expected Payload:
{
"_links": {
"source": {
"href": "https://api-sandbox.dwolla.com/funding-sources/{{sourceFundingSourceId}}"
},
"destination": {
"href": "https://api-sandbox.dwolla.com/funding-sources/{{destinationFundingSourceId}}"
}
},
"amount": {
"currency": "USD",
"value": "10.00"
},
"fees": [
{
"_links":{
"charge-to":{
"href":"https://api-sandbox.dwolla.com/customers/{{customerId}}"
}
},
"amount":{
"value":"2.00",
"currency":"USD"
}
}
]
}
Can this fix be prioritized?
Hi @nsethi – thank you for reporting! I’ve logged this for our team to investigate. We anticipate to do a preliminary investigation next week and prioritize a fix accordingly.
In the meantime, if you have any suggestions or would like to help us out, we welcome PR submissions on our open-source projects, including our SDKs, and would appreciate any contribution!
Adding an update with some further insight.
The Transfer models are currently a work in progress and thus have the internal
which restricts visibility to the module in which the class is declared. On the other hand, in Java, since there is no direct equivalent to the internal
modifier, the Kotlin internal classes are translated into public classes. Since these classes is treated as a public class, it provides access to the transfers models, although they are not in a completed state without errors. We apologize for any inconvenience this may cause.
Please note that we have plans to implement high-level methods for all requests in the SDK. Any updates will be marked in the Changelog within the README of the SDK.