Answers the oldest ask in this tracker — #27 (2021) requested partial refunds — and the timing is finally right: payum-quickpay gained refund_amount/capture_amount support in 2.0.0-alpha.2.
The integration contract (standardized across gateway plugins)
Verified against RefundPlugin source and four real integrations (Sylius/AdyenPlugin, Sylius/MolliePlugin, payplug/SyliusPayPlugPlugin, hipay/hipay-payments-sylius):
- Whitelist the gateway: add
quickpay to the sylius_refund.supported_gateways container parameter (defaults to offline only) — RefundPlugin's SupportedRefundPaymentMethodsProvider filters by gateway factory name, so without this the refund UI never offers Quickpay payment methods.
- Handle the event: a Messenger handler on
Sylius\RefundPlugin\Event\RefundPaymentGenerated (carries the refunded amount, currencyCode, and the related paymentId) that guards for Quickpay methods and executes the gateway refund with that amount.
- Complete the RefundPayment: apply
complete on the sylius_refund_refund_payment graph via RefundPaymentCompletedStateApplier. Quickpay refund operations are confirmed by callback, so completion should follow the Adyen model (complete when the gateway confirms) rather than Mollie's immediate auto-complete.
Details worth copying
- Adyen's manual-complete guard:
FilterManualRefundConfirmationSubscriber rejects the manual sylius_refund_refund_payment.complete transition for its methods, so only a gateway-confirmed refund completes — cheap correctness guarantee.
- Mollie's optionality:
sylius/refund-plugin in suggest (not require) with the whole integration behind a conditional config import (config/integration/refund-plugin/), so shops without RefundPlugin are unaffected.
Tasks
Answers the oldest ask in this tracker — #27 (2021) requested partial refunds — and the timing is finally right: payum-quickpay gained
refund_amount/capture_amountsupport in 2.0.0-alpha.2.The integration contract (standardized across gateway plugins)
Verified against RefundPlugin source and four real integrations (Sylius/AdyenPlugin, Sylius/MolliePlugin, payplug/SyliusPayPlugPlugin, hipay/hipay-payments-sylius):
quickpayto thesylius_refund.supported_gatewayscontainer parameter (defaults toofflineonly) — RefundPlugin'sSupportedRefundPaymentMethodsProviderfilters by gateway factory name, so without this the refund UI never offers Quickpay payment methods.Sylius\RefundPlugin\Event\RefundPaymentGenerated(carries the refundedamount,currencyCode, and the relatedpaymentId) that guards for Quickpay methods and executes the gateway refund with that amount.completeon thesylius_refund_refund_paymentgraph viaRefundPaymentCompletedStateApplier. Quickpay refund operations are confirmed by callback, so completion should follow the Adyen model (complete when the gateway confirms) rather than Mollie's immediate auto-complete.Details worth copying
FilterManualRefundConfirmationSubscriberrejects the manualsylius_refund_refund_payment.completetransition for its methods, so only a gateway-confirmed refund completes — cheap correctness guarantee.sylius/refund-plugininsuggest(notrequire) with the whole integration behind a conditional config import (config/integration/refund-plugin/), so shops without RefundPlugin are unaffected.Tasks
supported_gatewaysparameter,RefundPaymentGeneratedhandler, callback-driven completionPaymentProcessor(avoid double refunds when both mechanisms are active)UPGRADE-2.0.md; closes Partial refund (and capture) #27's ask on the refund half