Download the PHP package univapay/univapay-sdk-compat without Composer

On this page you can find all versions of the php package univapay/univapay-sdk-compat. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package univapay-sdk-compat

univapay/univapay-sdk-compat

日本語版はこちら

A runtime compatibility layer that reimplements the public surface of the legacy, hand-written univapay/php-sdk — the same class names, method signatures, public properties, enum style, exceptions, and polling behavior — on top of univapay/client-sdk (the new, APIMatic-generated transport engine) as its transport. It exists so that a codebase migrated by univapay/univapay-sdk-migrate keeps working, unmodified, on the new engine.

What this is

univapay/php-sdk will not be updated again. Every new API feature (v1.1 and later) lands only in univapay/client-sdk. This package lets existing integrators reach that new engine without rewriting call sites: it is a drop-in, namespace-only swap — Univapay\* → Univapay\Compat\* — that keeps every construct your code already uses (Money\Money values, ChargeStatus::SUCCESSFUL() identity comparisons, public property access, awaitResult()/chained calls, catch blocks) behaving exactly as it did before. Internally, every compat method builds a typed request against univapay/client-sdk and sends it through that engine's real HTTP transport — nothing here talks to the API directly. See Architecture for how responses are then hydrated back into the old SDK's shapes.

You do not install this package by hand in the normal case — see Install.

Install

Normal path: run the migration tool. univapay/univapay-sdk-migrate requires this package, rewrites your code's imports to point at it, and removes univapay/php-sdk, all in one command:

See the univapay-sdk-migrate README for what that command does, its flags, and its report format.

Manual path. If you are not using the migration tool — a fresh integration deliberately targeting the old SDK's API shape, or a codebase already rewritten by hand — install directly:

The two packages can be installed side by side — their autoload roots (Univapay\ vs. Univapay\Compat\) don't collide, and this package never references an old-SDK class directly. univapay-sdk-migrate relies on that: it requires this package before removing univapay/php-sdk, so both are present for one step while Rector still needs the old SDK's classes loadable for receiver-type resolution. Once your migration is done, remove univapay/php-sdk — there's no reason to keep it installed, but nothing breaks if it lingers alongside this package. Requires PHP >=7.2 (matching univapay/client-sdk's own floor) and moneyphp/money ^3.3 || ^4.0.

Supported surface matrix

Almost everything the old SDK exposed works. A small, fixed set of methods compile and are reachable but throw Errors\UnivapayUnsupportedFeatureError at call time, because the new engine has no equivalent API to call through to:

Area Status Notes
Charges, Refunds, Cancels Live Full lifecycle, including the two-step token-GET-then-create preflight the old SDK performed.
Subscriptions, Scheduled Payments Live
Transaction Tokens (card, Konbini, online wallets, Paidy, bank transfer, QR) Live
Stores, Merchants, Configuration Live Except update() — see below.
Transaction History Live Read-only: GET /transaction_history.
Webhook parsing (parseWebhookData) Live See Webhook notes for corner cases carried over verbatim.
Store::update(), Merchant::update() Permanent throw No update endpoint for either resource was ever exposed by the old SDK or the backend — this isn't an engine gap, there is nothing to call.
Transfer, TransferStatusChange, Ledger (and the GetTransfers/GetLedgers/GetStatusChanges mixins) Permanent throw The new engine has no Transfers API at all — no controller, no listing, no fetch. Transfer webhook events still hydrate (see Webhook notes); every subsequent call on that object throws.
BankAccount (and the GetBankAccounts mixin) Permanent throw The new engine has no Bank Accounts API at all — no controller, no listing, no fetch, no update. Unlike Transfer, the old SDK's webhook events never carried a bank account payload either, so there is no live channel this class still serves; it remains a hydration-capable data class purely for parity with every other ported resource.
ApplePayPayment token creation Permanent throw Constructing the value object still works; creating a token from it does not — Apple Pay isn't wired into the new engine.
Charge::qrMerchantToken() Permanent throw Only this one method — Charge itself is fully supported. The underlying /qr endpoint is deprecated upstream; MPM QR data is available from the token object instead.

"Permanent throw" means feature-frozen: these will not gain support in a future compat release. They are reachable only through the native SDK (see Migrating off the compat layer), and the migration tool flags every call site that reaches one so it's a reviewable line instead of a runtime surprise.

Behavior deltas

Compat is not a byte-for-byte replay of the old SDK — a small number of documented, deliberate differences exist.

Area Behavior
listTransactions() Null-safe on $from/$to — omitting either (e.g. to filter by status alone) no longer fatals.
Card token hydration billing/three_ds are nullable — absent on the wire yields null, not a TypeError.
CVV authorization status CvvAuthorizationStatus::ERROR() exists for the backend's error status value.
Plan types InstallmentPlanType::FIXED_CYCLE_AMOUNT() and SubscriptionPlanType::REVOLVING() exist for backend plan_type values the old lookups lacked (each fataled with OutOfRangeException).
CheckoutInfo supportedCurrencies is nullable — null when the server omits it, not a fatal.
Bank-transfer issuer token call_method is optional — null when the payload omits it (other payment types are unaffected).
Paidy token phone_number hydrates as a plain string, not the nested {country_code, local_number} shape.

Beyond those, several other differences are deliberate:

Webhook notes

UnivapayClient::parseWebhookData() reproduces the old SDK's dispatch and its corner cases verbatim — including ones that look like bugs but are pinned, intentional behavior:

Architecture

Requests are built typed, against univapay/client-sdk's own generated models — every field your code sets goes through the same validation and serialization the native SDK would use. Responses, by contrast, are hydrated from the raw captured wire body through the old SDK's own ported JSON schema parsers, not through the generated SDK's typed response models — the only way to guarantee wire-for-wire parity with what the old SDK's battle-tested parsers already handled (including shapes the current spec doesn't describe yet). See docs/ARCHITECTURE.md for the full request/response diagram and the confinement boundary that keeps raw-body access contained to a reviewed allowlist of files.

Migrating off the compat layer

Compat is not meant to live forever. UnivapayClient::native() returns the exact UnivaPay\UnivapayClientSdkClient instance this client already built internally to make its own calls — same auth, base URL, and 10-second timeout as the compat surface, never a second, separately configured client:

This enables mixed mode: migrate call sites file by file, rewriting each one against native()'s typed API while everything not yet touched keeps calling the compat facade exactly as before. Both paths share one engine, so there is no drift between them during the migration window — a charge created through native() is visible to code still reading it through compat, and vice versa.

A full construct-by-construct migration reference — Money → int + currency string, ChargeStatus::SUCCESSFUL() identity comparisons → string constants, $charge->status → typed getters, awaitResult() → pollCharge(), paginated lists → cursor parameters, parseWebhookData() → typed webhook handler classes, and more, each with a before/after snippet — is tracked in the portal guide's Phase 2 section, not duplicated here.

Deprecation notices

Opt-in runtime signal that helps a team find its own remaining compat call sites before doing the phase-2 migration onto native() above.

Versioning and sunset policy

Compat is feature-frozen as of 1.0: every new API capability lands in univapay/client-sdk only, reachable through native(). Compat itself continues to receive bugfixes and follows the engine SDK's own version bumps, for as long as integrators still depend on the old SDK's surface — there is no forced end-of-life date. That asymmetry (old surface stays exactly as it is; new capability only exists on the other side of native()) is the intended, gradual pressure to migrate, not a cliff.

License

MIT.


All versions of univapay-sdk-compat with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-json Version *
univapay/client-sdk Version ^1.2.0
moneyphp/money Version ^3.3 || ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package univapay/univapay-sdk-compat contains the following files

Loading the files please wait ...