Repository navigation
Upgrade to setono/quickpay-php-sdk ^1.1 and act on its release notes - #83
Merged
Merged
Conversation
SDK 1.1.0 (2026-08-17) is additive, but several of its additions are
things this gateway hand-rolled or should say:
- Operation::isApproved() (not pending AND status 20000) and isOfType()
are now what every Operations helper builds on; the package's own
APPROVED_STATUS_CODE constant is gone in favour of the SDK's
Operation::QP_STATUS_APPROVED. A pending operation is never approved,
whatever its code says.
- ConvertPaymentAction sends Quickpay's `shopsystem` on the create
request — the integration's name and installed version (Composer's
runtime API) — so the manager and Quickpay support can tell what
created a payment. A consumer's own Convert action can say more.
- Docs: the SDK's one-argument mapper cache is reachable through the
quickpay.client option (build the client with `cache:`), so the
package needs no option of its own nor a Valinor dependency.
- Since 1.1 an empty request body (cancel) goes out as `{}`; the test
asserts the new shape.
Not adopted on purpose: the SDK's type-agnostic latestOperation() /
hasPendingOperation() and its summed amount helpers — the actions need
the per-type, last-approved views Operations provides.
… order id Quickpay enforces order_id uniqueness per account: a second create under an existing order id is a 400 "order_id already exists on another payment" (verified live). The gateway builds the order id from the Payum payment number, and under Sylius that is the ORDER number (its CapturePaymentAction sets it so), so a customer who was declined, came back to the shop and paid again arrived at Convert with an order id Quickpay already had — and the retry died with a ValidationException, for the most ordinary of reasons. SDK 1.1's findByOrderId() is the recipe for exactly this. ConvertPaymentAction now looks the order id up first. A payment nobody has paid — no approved operation: created but never completed, declined, an authorize still in flight — in the same currency is adopted, and the checkout continues on it (the entry-point actions treat a declined attempt like a fresh payment and create a new link). A payment WITH an approved operation is never adopted silently: it is either this order's earlier payment that really was paid, or another environment's under a prefix that should not be shared, and either way that is the shop's call, so it is a LogicException naming it rather than a claim of money. Another currency is refused too — the payment is what Quickpay charges in. Verified live against the real API: an initial e2e payment is adopted without a create; an authorized one, a captured/refunded one and a same-order-id payment in another currency are refused with the messages above.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.x #83 +/- ##
============================================
+ Coverage 98.52% 98.60% +0.07%
- Complexity 215 220 +5
============================================
Files 20 20
Lines 542 572 +30
============================================
+ Hits 534 564 +30
Misses 8 8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
SDK 1.1.0 (released today) is additive — its
UPGRADE.mdhas nothing to document — but its notes recommend things this gateway hand-rolled or was missing. Two commits, reviewable separately:1.
^1.1, and use what it addedOperation::isApproved()/isOfType()/QP_STATUS_APPROVEDare now what everyOperationshelper builds on; our ownAPPROVED_STATUS_CODEis gone. The SDK's definition is not pending AND 20000 — a pending operation is never approved, whatever its code says (test).Shopsystemon the create request:ConvertPaymentActionidentifies the integration assetono/payum-quickpay+ the installed version (Composer's runtime API;composer-runtime-api ^2.0declared, as the SDK does), so the manager and Quickpay support can see what created a payment. A consumer's own Convert (the Sylius plugin has one) can say something more specific.quickpay.client(new Client($key, synchronized: …, cache: new FileSystemCache($dir))) — no gateway option, no Valinor dependency. CLAUDE.md records what was adopted and what deliberately was not (the type-agnosticlatestOperation()/hasPendingOperation(), the summed amount helpers).{}; the test asserts the new shape.2.
Convertfinds or creates (the release notes' checkout recipe — and a real bug here)Quickpay enforces
order_iduniqueness per account: a second create is a400 order_id already exists on another payment(verified live). The gateway builds the order id from the Payum payment number, and under Sylius that is the order number (CapturePaymentActionsets$payumPayment->setNumber($order->getNumber())) — so a customer who was declined, came back to the shop and paid again arrived atConvertwith an order id Quickpay already had, and the retry died with aValidationException.ConvertPaymentActionnow looks the order id up first (findByOrderId(), oneGETper creating Convert; a model with an id makes no request as before):ConvertLogicExceptionnaming it — never adopts money silently: it is either this order's earlier payment that really was paid (carry itsquickpayPaymentIdover) or another environment's under a prefix that should not be shared (give each its ownorder_prefix)LogicException— the payment is what Quickpay charges inVerified live through the real gateway: an
initiale2e payment was adopted (no create issued); an authorized one, a captured/refunded one and a same-order-id payment in another currency were refused with exactly those messages.Tests for every row (+ the integration test now expects the lookup); README (flow + "Retrying a checkout"),
docs/UPGRADE-2.0.md(new section), CLAUDE.md.composer all, the dependency analyser andcomposer normalize/validategreen (369 tests).