Repository navigation
Paystack for Shopware 6 — 0.9.0-beta.3 - #3
Merged
Merged
Conversation
…stackSW Systematically rename the Paystack payment plugin to use the shorter 'Kmh' prefix instead of 'Kommandhub', improving consistency across the plugin ecosystem while maintaining backward compatibility through the existing PHP namespace. Changes: - Plugin directory: KommandhubPaystackSW/ → KmhPaystackSW/ - Plugin class: KommandhubPaystackSW → KmhPaystackSW - Custom field set: kommandhub_paystack_fieldset → kmh_paystack_fieldset - Custom fields: kommandhub_paystack_* → kmh_paystack_* - Payment method: kommandhub_paystack_payment → kmh_paystack_payment - Routes: kommandhub_paystack_* → kmh_paystack_* - Admin components: kommandhub-paystack-detail → kmh-paystack-detail - Translation keys: kommandhub-paystack-* → kmh-paystack-* - Built assets: kommandhub-paystack-s-w-* → kmh-paystack-s-w-* - Test files: KommandhubPaystackSWTest → KmhPaystackSWTest Preserved: - PHP namespace: Kommandhub\PaystackSW (unchanged) - Composer package: kommandhub/paystack-sw (unchanged) Breaking Changes: - Database: Custom field names will change on plugin update - Database: Payment method technical name will change on plugin update - The plugin's update() method handles migration automatically Updated 32 files including PHP classes, configuration, translations, tests, and documentation. All tests passing.
…utes The plugin rename left several references to the old KommandhubPaystackSW name. QA against a live shop showed this broke the payment path: - Config::KEY still read "KommandhubPaystackSW.config.", while Shopware stores the plugin's settings under "KmhPaystackSW.config.*". Every setting read returned empty: the secret key was blank, sandbox mode was off, and a correctly signed webhook was rejected with 403 because the signature validator saw no secret. - The admin refund component and the sw-order-detail override read the same stale config domain, so refundEnabled and minimumRefundAmount were ignored. - The storefront account templates used the stale config keys and the "@KommandhubPaystackSW/" Twig namespace, so bank/BVN options never applied and the account include could not resolve. - The Paystack tab on the order detail page linked to the route "kommandhub.paystack.detail", but main.js registers "kmh.paystack.detail". - phpunit.dist.xml still excluded src/KommandhubPaystackSW.php from coverage (the class is now KmhPaystackSW.php), pulling the kernel-only bootstrap class back into the CI coverage gate. Replace the old name in all of these. Fix the stale container name in the README. Verified: a webhook signed with the sandbox key now returns 204 (was 403); unsigned and badly signed webhooks still return 403; checkout initializes a Paystack transaction and completes an NGN order to "paid" with the paystack_* fields stored. 372 tests pass, PHPStan level 9 and php-cs-fixer are clean, and the 100% coverage gate holds. Note: the built administration and storefront bundles still contain the old names and must be rebuilt before these admin and storefront fixes take effect in a shop.
… declined payments Fresh install - Assign the Paystack payment method to all sales channels when it is first created, so it is selectable at checkout straight after install. An existing method is only refreshed, never re-assigned, so a merchant who removed it from a channel does not get it back on every update. The cart validator still blocks use until API keys are configured. - Default enableSandbox to true so a fresh install never calls live Paystack until the merchant switches it off. Existing installs keep their value. Late webhooks after a retry - Each retry overwrites paystack_reference, so a late charge.success for an earlier attempt matched no order. Always send order_transaction_id in the Paystack metadata (Paystack echoes it back) and have ChargeSuccessSubscriber fall back to it when no transaction carries the reported reference. The id is only a lookup hint: the payment is still verified against Paystack (status, amount, currency) before the order is marked paid. - Add OrderTransactionService::findOneById() for the nullable lookup. Declined payments recorded as cancelled - A redirect that carries no reference (cancel/back, some failures) was always treated as a customer cancellation, even when the card was declined. Verify the reference stored at pay time instead and let Paystack's real status decide: failed -> failed, abandoned -> cancelled, success -> paid, pending -> left open. The abandoned outcome applies only to a redirect without a reference, so webhook and normal return behaviour are unchanged. Stale bundles - Rebuild the administration and storefront bundles. They still embedded the pre-rename config domain, so admin refund settings were ignored, and the storefront bundle sat at the old path so the plugin's JS (bank verification) was never loaded. Docs - README: first-install behaviour and sandbox default, supported-currency requirement, and troubleshooting for "Insufficient Funds" in Paystack's sandbox (large amounts are rejected), unsupported currencies, and the stock Shopware status-email subject/typo (core templates, not shipped by this plugin). Tests: 384 tests pass; PHPStan level 9, php-cs-fixer and the 100% coverage gate are green. Verified against a live shop: late webhook for an overwritten reference (found via metadata, verified, paid), cancel-return (still cancelled), and sandbox default plus no re-assignment on reinstall.
- Bump composer.json to 0.9.0-beta.3. The rename commit had lowered it to 0.9.0-beta, which sorts below 0.9.0-beta.2 and would read as a downgrade. - Add 0.9.0-beta.3 release notes (en, de, fr), including an upgrade note for the KommandhubPaystackSW -> KmhPaystackSW rename: existing beta.1/beta.2 installs are not updated in place and must be reinstalled and reconfigured. Mirror the note in the README. - Replace the deprecated EntitySearchResult::first() (removed in Shopware 6.8) with getEntities()->first() in AbstractEntityReader, RefundInitializeService and WebhookSubscriber. shopware-cli store validation now reports no problems.
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
Third pre-release (
0.9.0-beta.3) for internal development, QA and sandbox/staging testing. Not yet submitted to the Shopware Store.Upgrade note — the plugin was renamed. The technical name changed from
KommandhubPaystackSWtoKmhPaystackSW, so Shopware treats it as a different plugin and0.9.0-beta.1/0.9.0-beta.2installs are not updated in place. InstallKmhPaystackSW, re-enter the API keys and settings (now underKmhPaystackSW.config.*), then remove the old plugin. The custom field set and bank fields were renamed too (kmh_paystack_*); previously saved bank details are not migrated.Changes since
0.9.0-beta.2reference, the plugin verifies the reference stored at checkout and lets Paystack's real status decide (failed → failed, abandoned → cancelled, success → paid, pending → open).EntitySearchResult::first()(removed in Shopware 6.8) withgetEntities()->first().shopware-cli extension validate --store-compliancereports no problems.composer.jsonversion fixed: the rename commit had lowered it to0.9.0-beta, which sorts belowbeta.2.Test plan
shopware-cli extension validate --store-compliance: no problems foundcharge.successfor an unpaid order is ignored, lost-return recovery via webhook, webhook replay is idempotent, cancel-return stays cancelled, late webhook for an overwritten reference is matched via metadatafailedagainst real Paystack (covered by unit tests; live check still pending)