Skip to content

No access to linked values when using withInclude #52

@smur89

Description

@smur89

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions