Repository navigation
π UPC 1.1.3
Adds the authorization / capture / cancellation payment lifecycle to UnifiedApiPaymentService, and
fixes payments failing for customers browsing over IPv6. No breaking changes; a plugin that upgrades
and changes nothing is unaffected.
π Fixes
- π IPv6 browser IP no longer rejected β the Unified API caps
browser.ipat 15
characters (an IPv4 maximum) and rejects an IPv6 address, so payments from IPv6 clients failed.
BrowserDto::toArray()now serializes anyipcontaining a:as0.0.0.0, for both
HostedFieldDtoandPaymentDto. The publicBrowserDto::$ipkeeps the caller's original value;
only the request payload changes.
β¨ Added
- π Authorization β no new call: it is
createPayment()withCommonFieldsDto::$capture = false,
optionally with the newpartialAuthorizationflag and/orauthorizationType
(AuthorizationType::PRE_AUTHORIZATION/FINAL_AUTHORIZATION).PaymentOutputnow also exposes
maxCaptureDateandremainingCapturableAmountfor an authorization-only creation (PRE-3670). - π³
UnifiedApiPaymentService::capturePayment()β full or partial capture, immediate or deferred,
one or several times, returning aCaptureOutput. - π«
UnifiedApiPaymentService::cancelPayment()β full (default) or partial cancellation of a
payment or authorization, returning aCancellationOutput. β οΈ 13 new exception subtypes so a plugin cancatchprecisely instead of parsing a generic
ApiException:- Business outcomes normalized from the Unified API response:
AuthorizationExpiredException,
PaymentAlreadyCapturedException,PaymentAlreadyCancelledException,
AmountExceedsAvailableException,OperationConflictException,
PartialCancellationNotAllowedException,PaymentNotVoidableException,
PaymentNotCapturableException,MultipleCaptureNotAllowedException. An issuer refusal reuses the
existingCardOperationException. - Local pre-call validation (no HTTP request sent):
InvalidCaptureRequestException/
CaptureAmountExceptionandInvalidCancellationRequestException/
CancellationAmountExceptionβ emptyorderId/description, non-positiveamount, or a missing
currencyalongside a partialamount.
- Business outcomes normalized from the Unified API response:
π Compatibility
Upgrading from 1.1.2 with no plugin-side change is a no-op: no existing signature, contract or
exception changed, and the new CommonFieldsDto properties default to null. Idempotency across
replayed capture/cancel requests remains the consuming plugin's job (IPaymentRepository / ILock);
UPC only normalizes the API's "already happened" signals into distinct exception types.
β Quality
PHPStan level 8, PHP-CS-Fixer, PHPUnit and CI verifying PHP 7.1β8.2 compatibility. New unit tests cover
every new class and the error-classification paths, plus two integration tests that assert the API's own
rejection against the shared staging fixture payment (proving auth/URL/JSON wiring without mutating it).
π Requirements
- PHP β₯7.4 to install/develop (build-tooling floor only β shipped source runs on PHP 7.1)
- Runtime dependency:
giggsey/libphonenumber-for-php
π Full Changelog: 1.1.2...1.1.3