SL-393 Upgrade Saferpay API version from 1.50 to 1.53 - #349
Open
TLabutis wants to merge 1 commit into
Open
Conversation
The spec version was stored in configuration twice (SAFERPAY_SPEC_VERSION and SAFERPAY_SPEC_REFUND_VERSION), seeded once at install time and never migrated afterwards, so upgraded shops kept declaring whatever version they were first installed with and the refund request body could disagree with the shared request header. Make SaferPayConfig::API_VERSION the single source of the version: bump it to 1.53, build the RequestHeader from the constant in RequestObjectCreator::createRequestHeader(), read the refund SpecVersion from that same RequestHeader instead of configuration, and delete both config rows in the 2.1.0 upgrade so stale stored values can no longer be picked up.
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.
What
Moves the module's declared Saferpay API spec version from 1.50 to 1.53 on every call, and makes
SaferPayConfig::API_VERSIONthe single source of that version. The two configuration rows that used to carry it (SAFERPAY_SPEC_VERSION,SAFERPAY_SPEC_REFUND_VERSION) were seeded once at install time and never migrated, so upgraded shops kept declaring the version they were first installed with, and the refund request body could disagree with the shared request header. Both rows are removed by the 2.1.0 upgrade script.Acceptance criteria evidence
terminals,terminals/{id}), 4 closed with old-vs-new curl probes because no module flow reaches them (license,license-configuration,fields-access-tokens,AssertRefund)prestashop:module upgrade, rows deleted, every otherSAFERPAY%row byte-identical including credentials). A tunnelled PS 9.1.0 shop still carrying the legacy 1.50 rows logged 1.53 on every request, proving the constant is the only sourceTests
php -lclean on all four changed PHP files.tests/Unitsuite (PHPUnit 7.5 in theprestashop/prestashop:1.7.8-7.4container): 3 tests, 1 pre-existing error inBasePaymentRestrictionValidationTest(constructor arity mismatch). The identical result occurs on the clean base commit6d9be96cwith this diff stashed, so it is afeature/react-admin-settingsissue, not introduced here.Manual verification
Real sandbox transactions on the JSON API TEST account: PaymentPage and Saferpay Fields payments authorized, captured, refunded and cancelled, with Saferpay Backoffice request logs confirming SpecVersion 1.53 on each call. Migration exercised end to end on a fresh 2.0.3 install upgraded to this branch.
Three findings during probing looked like 1.53 regressions and were each cleared by replaying the same body under 1.50 with an identical answer: the
Notification.MerchantEmailsvalidation failure (pre-existing module bug, separate ticket material),fields-access-tokensrejectingSourceUrls(caused by thehttp://localhostshop URL), andlicense-configurationansweringACTION_NOT_SUPPORTEDon both versions (the module's/licensefallback is unaffected).Needs human verification
Confidence: 90%