Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No access to linked values when using withInclude #52

Open
smur89 opened this issue Jun 19, 2020 · 0 comments
Open

No access to linked values when using withInclude #52

smur89 opened this issue Jun 19, 2020 · 0 comments

Comments

@smur89
Copy link

smur89 commented Jun 19, 2020

While trying to reconcile payout events according to the API docs, we are trying to get all payment and refund events as per the code below.

parentEvent <-client.events().all().withAction("paid").withPayout(payoutId).execute().asScala.headOption
payments = client.events().all().withParentEvent(parentEvent.getId).withInclude(EventListRequest.Include.PAYMENT).withResourceType(EventListRequest.ResourceType.PAYMENTS).execute().asScala

In our second RPC call, when we specify .withInclude(EventListRequest.Include.PAYMENT).withResourceType(EventListRequest.ResourceType.PAYMENTS) the return type is a list of Event. Which means we have no access to the "included" payment objects. We expect these to be returned in the following format as per the API

{
  "events": [ ... ]
  "linked": {
    "payments": [ ... ]
  }
  "meta" {
    ...
  }
}

The only available return types in the EventService are

  • Iterable which just contains the list of events
  • ListResponse Which contains the meta and the list of items
  • Event when calling get(id)

Seems like this withInclude is discarded in all cases.

From what I can see this would force us to either:

  • Execute a separate RPC for each payment after getting the Ids of all payment and refund events
  • Page through all payments/refunds and filter for the ids contained in the payout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant