Skip to content

Feat: Pass cancelUrl to Mollie API for payment cancellation workflow#60

Open
powli wants to merge 1 commit intomollie:masterfrom
netresearch:fix/cancel-url-support
Open

Feat: Pass cancelUrl to Mollie API for payment cancellation workflow#60
powli wants to merge 1 commit intomollie:masterfrom
netresearch:fix/cancel-url-support

Conversation

@powli
Copy link
Copy Markdown

@powli powli commented Feb 27, 2026

Summary

  • The Mollie Orders API supports a cancelUrl parameter that enables a cancel-specific redirect workflow
  • Without it, customers who cancel a payment at Mollie have no clear path back to the checkout
  • OroCommerce provides a failureUrl in PaymentTransaction::getTransactionOptions() for this purpose

Changes

Two-part implementation using order metadata as a bridge between the mapper and proxy layers:

  1. Mapper/MollieDtoMapper.php: Extracts failureUrl from transaction options, converts relative URLs to absolute (Mollie API requirement via new ensureAbsoluteUrl() helper), and stores as cancelUrl in order metadata
  2. IntegrationCore/BusinessLogic/Http/OrgToken/ProxyDataProvider.php: Reads cancelUrl from metadata and promotes it to a top-level field in the API request payload

Test plan

  • Start checkout with any Mollie payment method
  • On the Mollie payment page, cancel the payment
  • Verify redirect back to the OroCommerce checkout (failure page)
  • Verify successful payments are unaffected (redirectUrl still works normally)

Closes #56

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cancelUrl not passed to Mollie API — customers cannot return to checkout after cancelling payment

1 participant