add a few events & make subscription-options more adjustable - #102
Open
rommelfreddy wants to merge 1 commit into
Open
add a few events & make subscription-options more adjustable#102rommelfreddy wants to merge 1 commit into
rommelfreddy wants to merge 1 commit into
Conversation
Collaborator
|
Thanks for this pull request, @rommelfreddy, much appreciated. |
Collaborator
|
Hi There @rommelfreddy , Thank you for opening this PR, this is much appreciated! We have a few comments though:
In general nice additions, but we can’t approve this PR as-is yet. |
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.
Thank you for creating this pull request! To make the best use of your and our time we created this checklist to get the best possible pull requests:
Error when trying to get the payment status:This PR touches code in the following areas (Check what is applicable):
Frontend
Backend
Order Processing (Mollie communication)
Other
The subscriptions module currently offers only limited extension points for project-specific subscription flows and customizations.
This PR adds a few event dispatches and makes the
SubscriptionOptionDTO mutable by adding setters. This allows external modules to adjust subscription data before the subscription is created and to react to subscription creation and renewal events without overriding core logic.Added extension points:
mollie_subscription_option_initmollie_subscription_createdmollie_subscription_renewedThe
mollie_subscription_createdevent payload was also expanded so observers can access the saved model, the Magento order, the Mollie subscription response, and the DTO that was used to create it.Important
Currently the change does contain a BC in Mollie\Subscriptions\Observer\MollieProcessTransactionEnd\CreateSubscriptions::createSubscription. The event data for "mollie_subscription_created" with the key "subscription" has changed to the subscription provided from the API gateway instead of the SubscriptionToOption entity.