Skip to content

Fix idempotent first payment webhooks - #319

Closed
sandervanhooft wants to merge 1 commit into
mainfrom
sandervanhooft/first-pay-idempotent
Closed

Fix idempotent first payment webhooks#319
sandervanhooft wants to merge 1 commit into
mainfrom
sandervanhooft/first-pay-idempotent

Conversation

@sandervanhooft

Copy link
Copy Markdown
Collaborator

Prevents replayed paid first-payment webhooks from re-running first-payment actions, creating duplicate orders, or adding balance again for the same Mollie payment.

The handler now returns the existing linked order for already-processed first payments, and the webhook controller skips duplicate aftercare updates/events in that case.

Adds regression coverage for duplicate subscription first-payment webhooks and update-payment-method balance replays.

Tests: ./vendor/bin/phpunit tests/SubscriptionBuilder/FirstPaymentSubscriptionBuilderTest.php tests/UpdatePaymentMethod/UpdatePaymentMethodTest.php tests/UpdatePaymentMethod/UpdatePaymentMethodWithoutAddingToBalanceTest.php tests/FirstPayment/FirstPaymentHandlerTest.php and ./vendor/bin/phpunit tests --display-phpunit-notices.

@sandervanhooft

Copy link
Copy Markdown
Collaborator Author

Will open a new PR once I have my GitHub commit signing fixed.

@sandervanhooft
sandervanhooft deleted the sandervanhooft/first-pay-idempotent branch April 23, 2026 14:49
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.

1 participant