-
Notifications
You must be signed in to change notification settings - Fork 191
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
V3 #727
Open
Naoray
wants to merge
72
commits into
master
Choose a base branch
from
v3
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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.
OrganizationsCollection
and change parent class ofOrganizationEndpoint
toEndpointAbstract
RouteCollection
and change parent class ofPaymentRouteEndpoint
toEndpointAbstract
SettlementCaptureEndpoint@pageForId()
vsPaymentChargbackEndpoint@listForId()
)rename-> marked as deprecatedMethodEndpoint@all()
or remove it to avoid confusion overallAvailable()
vsall()
Posting this here for now. For the upgrading steps I have created a separate file. For the changelog we don't have any file yet. May be worth to start a
CHANGELOG.md
file which is automatically filled via a github action from the release notes.Upgrading
From v2 to v3
Removed unused Collections
This change should not have any impact on your code, but if you have a type hint for any of the following classes, make sure to remove it
Mollie\Api\Resources\OrganizationCollection
Mollie\Api\Resources\RouteCollection
Removed deprecations
The following was removed due to a deprecation
Mollie\Api\Types\OrderStatus::REFUNDED
Mollie\Api\Types\OrderLineStatus::REFUNDED
Changelog
Type cast embeded Resources
In previous versions resources requested via
embed
param on requests like get-payment were not casted into their respective collection or resource classes. Starting with this version all embeded resources are typecasted.Added CaptureMode
A new
Mollie\Api\Types\CaptureMode
class which can be used when using on the create-payment request (s. captureMode) when using the capture feature.PSR-18 Support
We added a new HTTP-adapter which supports PSR-18. The following example demonstrates on how to use the new adapter.
Note: The example uses
nyholm/psr7
to get all necessary factories required. You can use the same factories by runningcomposer require nyholm/psr7
.Added Collection Methods
Two new collection methods were added which can be used to simplify interacting with collection resources.
contains(callable $callback): bool
filter(callable $callback): static
Testmode is automatically removed..
..If an API key is used as authentication.
Say Goodby to the annoying
[...]. Try switching live / test API keys.
Requests, Payloads and Queries
The new version can be used as before without any changes to the codebase (except the few mentioned above). The underlying codebase was changed drastically to allow a few improvements. There are now 3 different ways to interact with the client.
The old way
Just as you used to... Pass in arrays of data and receive your Resource/ResourceCollection.
Slightly improved
With this approach you can use new Objects and therefore actually know what data is required to pass into the method, but you can still using the old way of calling the request.
This is the way!
Finally, the new way of interacting with the client:
4b. receive your Resoure/ResourceCollection
With this you get a
Response
and can also inspect its status, body or any other payload. If you want to use the$client->send()
method but don't want to call the->toResource()
method to receive your Resource, you can simply callMollieApiClient::shouldAutoHydrate()
.Some Context...
..on how the new request cycle works