Closed
Conversation
0848749 to
15ce257
Compare
whyscream
commented
Jun 22, 2023
Comment on lines
+45
to
+47
| url = self._get_link("subscriptions") | ||
|
|
||
| from ..resources import CustomerSubscriptions | ||
|
|
||
| return CustomerSubscriptions(self.client, resource_path=url) | ||
| return CustomerSubscriptions(self.client, resource_path=f"customers/{self.id}/subscriptions") |
Contributor
Author
There was a problem hiding this comment.
We could use the result from _get_link, but when it's empty, we still need a working instance of CustomerSubscriptions for creating new subscriptions.
added 2 commits
June 22, 2023 19:03
POC for subscriptions only. The subscriptions are one level deep nested, below a customer. But to retrieve these, we don't need a customer object. We just need the base resource path, which might contain a customer id.
https://docs.mollie.com/reference/v2/subscriptions-api/list-subscription-payments shows what we would call customer subscription payments. These are nested 2 layers deep.
c3017d6 to
7e7c126
Compare
… link is missing Since the `CustomerSubscriptions` instance also provides access to creating new subscriptions, we need to initialize it correctly at all times.
7e7c126 to
e602b08
Compare
added 2 commits
June 26, 2023 13:01
Without this change, we generated a broken querystring with two questionmarks.
e602b08 to
efd724a
Compare
Refactoring was done by iterating all files in `resources/` from A to Z, and updating code on the go. This is where we stopped half-way :)
Contributor
Author
|
Issue resolved in #333, closing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #315
This resolves the issue when paginating over 'nested' resources. In stead of injecting a parent object into resource that manages the childs, we just retrieve the childs from a custom resource path (that happens to include the parent id).
For now this is a POC: it only works for subscriptions (nested below a customer) and subscription payments (nested below customer and subscription).