Feat: Pass cancelUrl to Mollie API for payment cancellation workflow#60
Open
powli wants to merge 1 commit intomollie:masterfrom
Open
Feat: Pass cancelUrl to Mollie API for payment cancellation workflow#60powli wants to merge 1 commit intomollie:masterfrom
powli wants to merge 1 commit intomollie:masterfrom
Conversation
The Mollie Orders API supports a cancelUrl parameter that enables a cancel-specific workflow, redirecting customers back to the checkout when they cancel a payment. Without it, customers have no clear path back to the shop after cancellation. OroCommerce provides a failureUrl in PaymentTransaction transaction options for this purpose. This change: 1. Extracts failureUrl from transaction options in MollieDtoMapper, converts relative URLs to absolute (Mollie API requirement), and stores it in the order metadata as cancelUrl. 2. Reads cancelUrl from metadata in ProxyDataProvider::transformOrder() and adds it to the Mollie API request payload. Metadata is used as a bridge between the mapper layer (OroCommerce context) and the proxy layer (Mollie API payload). Closes mollie#56
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.
Summary
cancelUrlparameter that enables a cancel-specific redirect workflowfailureUrlinPaymentTransaction::getTransactionOptions()for this purposeChanges
Two-part implementation using order metadata as a bridge between the mapper and proxy layers:
Mapper/MollieDtoMapper.php: ExtractsfailureUrlfrom transaction options, converts relative URLs to absolute (Mollie API requirement via newensureAbsoluteUrl()helper), and stores ascancelUrlin order metadataIntegrationCore/BusinessLogic/Http/OrgToken/ProxyDataProvider.php: ReadscancelUrlfrom metadata and promotes it to a top-level field in the API request payloadTest plan
Closes #56