Repository navigation
PRE-3715: Allow Oney refunds based on the PayPlug API refund window - #336
Merged
hdelaforce-payplug merged 2 commits intoOct 22, 2026
Merged
Conversation
hdelaforce-payplug
force-pushed
the
feature/PRE-3715_remove-oney-48h-refund-delay
branch
5 times, most recently
from
October 9, 2026 13:46
e693723 to
6ae66b5
Compare
There was a problem hiding this comment.
Claude Code Review
Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.
Tip: disable this comment in your organization's Code Review settings.
jhoaraupp
reviewed
Oct 12, 2026
adumont-payplug
force-pushed
the
develop
branch
from
October 20, 2026 08:58
6c972d7 to
7c1f35b
Compare
adumont-payplug
force-pushed
the
feature/PRE-3715_remove-oney-48h-refund-delay
branch
from
October 20, 2026 08:59
6ae66b5 to
52665b7
Compare
jhoaraupp
approved these changes
Oct 22, 2026
hdelaforce-payplug
deleted the
feature/PRE-3715_remove-oney-48h-refund-delay
branch
October 22, 2026 12:36
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.
Description
Oney refunds are no longer held back by a hardcoded 48h delay. The refund window returned by the PayPlug API (
refundable_after/refundable_until) is now the only rule, which matches the PrestaShop and WooCommerce plugins.RefundPaymentGeneratedHandlerblocked a refund for 48h after the last payment and after the last processed refund, so successive partial refunds were blocked too. The private checks, the now-unused$orderRepository/$translatorconstructor arguments andOneyGatewayFactory::REFUND_WAIT_TIME_IN_HOURSare gone.RefundUnitsCommandCreatorDecorator::canOneyRefundBeMade()is now the single local check, run on the admin refund form before the refund is dispatched:now < refundable_after, with "The Oney refund will only be possible from %date%."now > refundable_until, with "The Oney refund period ended on %date%…"nullbound means no restriction on that side. Before, it raised an undefined-property warning and showed the misleading 48h message. The PayPlug API stays the final authority and still rejects an out-of-window refund, with nothing recorded locally.%date%is built withIntlDatePatternGenerator(skeletonyMMMdjmmz) in the translator locale and the PHP default timezone. It shows the locale's medium date, hours:minutes and a short timezone name, for example "Jan 1, 2100, 12:00 PM UTC" or "1 janv. 2100, 13:00 UTC+1".ui.oney_transaction_less_than_forty_eight_hoursis replaced byui.oney_refund_not_available_beforeandui.oney_refund_period_expired.Motivation: merchants had to wait an arbitrary 48h before refunding an Oney order, and again 48h between two partial refunds, even when the API already allowed the refund.
Related issue(s): PRE-3715. Possibly related to PRE-3710 (multi-line Oney refund error), but not claimed as fixed: see Notes for reviewer.
Type of Change
Checklist
Code Quality
Testing
sonarcloudCI jobSecurity & Ops
Notes for reviewer
Scope. This PR contains only the Oney refund-window change, plus a follow-up commit that adds the timezone to the displayed date. An earlier version of this branch also carried a Sylius 2.3 provider-compatibility change and two CI changes (refund-plugin update in the
Makefile, Node 22). Those were dropped when the branch was rebuilt ondevelop. They did not land ondevelop:developcaps Sylius below 2.3 in CI instead (PRE-3673). Sylius 2.3 compatibility is left for a separate ticket.Breaking changes. All of these are documented in the CHANGELOG
2.0.0"Breaking changes for anyone extending the plugin" table. 2.0.0 is still unreleased.OneyGatewayFactory::REFUND_WAIT_TIME_IN_HOURSis removed, not deprecated. The class isfinaland nothing reads the constant any more.ui.oney_transaction_less_than_forty_eight_hoursis removed. It is replaced by the two new keys, which take a%date%parameter.RefundPaymentGeneratedHandler::__construct()drops$orderRepositoryand$translator. The class isfinaland container-built.The behaviour change is intended: a refund that was blocked for less than 48h is now allowed whenever the API allows it.
Testing.
52665b7)New tests:
tests/PHPUnit/Creator/RefundUnitsCommandCreatorDecoratorTest.php(16 tests) covers:refundable_afterboundary;tests/PHPUnit/MessageHandler/RefundPaymentGeneratedHandlerTest.php: an Oney refund on a just-created payment reaches the API, and an API refusal records nothing.Not run:
UnifiedAuthenticationControllerTest,PayPlugApiClientFactoryTest,UnifiedApiOperationStatusFetcherTest,UnifiedApiPaymentCreatorTestandUnifiedApiRefundCreatorTestwere stopped by a local-only debug statement invendor/. They ran green in CI on the previous head.Lakion\Behat\MinkDebugExtensionnot found). The four 48h scenarios infeatures/admin/refunding_oney_payment.featurewere replaced by window-based ones, and the context, mocker andui.xmlwere updated, but they were never executed. The date assertions check theJan 1, 2100/Jan 1, 2020prefix, which the timezone change keeps.refundable_afterafter a first partial refund. If it does, successive refunds stay blocked by the API, now with an accurate date. That is why PRE-3710 is not claimed as fixed.Unticked checklist items:
PayPlugApiClient::retrieve()(timeout, 404) in the decorator still surfaces as an admin 500, as before. It is out of scope for this story and a possible follow-up.Scope notes:
refundpayment transition and refunds made from the PayPlug portal never had a local Oney check, and that is unchanged.RefundHistoryRepositoryInterface::findLastProcessedRefundForPayment()no longer has a caller. It is kept on purpose because it is on a public interface.Changelog:
CHANGELOG.md2.0.0, with entries under Changed and Removed, plus three rows in the BC table.