PayPal has started rolling out version 2 of their REST API, so we should handle both version 1 and version 2. The current structure doesn't allow for this, so we basically need to redesign how we handle API resources.
In the past, we have done something like this:
let payments = try request.make(Payments.self)
let authorization = payments.get(authorization: id)
Now we will do something like this:
let authorizations = try request.make(PayPal.API.self).v2.payments.authorizations
let authorization = authorizations.details(for: id)
PayPal has started rolling out version 2 of their REST API, so we should handle both version 1 and version 2. The current structure doesn't allow for this, so we basically need to redesign how we handle API resources.
In the past, we have done something like this:
Now we will do something like this: