lokielse/omnipay-unionpay
Omnipay driver for China UnionPay (银联). Adds UnionPay payment gateway support to any Omnipay-based PHP application, including Laravel, through a consistent API for payments and related operations. Install via Composer and configure your UnionPay merchant credentials.
Architecture fit: lokielse/omnipay-unionpay is an Omnipay gateway driver, not a Laravel-native package. That is a reasonable fit if the application already uses Omnipay or is willing to put UnionPay behind an internal payment abstraction. In Laravel, the clean pattern is to wrap the driver in an application-owned UnionPayGateway service, bind it through the service container, keep credentials/certificates in config or secrets storage, and expose domain-level payment methods rather than leaking Omnipay objects into controllers. The package should be treated as a protocol adapter, not as the payment orchestration layer.
Integration feasibility: Feasible for a Laravel/PHP stack, subject to dependency compatibility and merchant onboarding. The main prerequisites are a UnionPay merchant account, the correct UnionPay product/API variant, test credentials, certificate/key material, and clarity on domestic versus cross-border processing. The package’s MIT license is favorable. With 112 stars and a narrow driver scope, it is credible as a focused integration candidate but not a heavily adopted platform dependency. The quality score is high, but the opportunity score of 3.39 suggests moderate strategic leverage rather than a mandatory default.
Technical risk: Payment-path risk is the dominant concern. This package sits in a regulated, failure-sensitive flow where signature validation, certificate rotation, callback authenticity, idempotency, timeout handling, and reconciliation must be owned by the application. The driver may lag UnionPay API changes or Omnipay major versions. Laravel compatibility will depend on PHP version, Omnipay version, Guzzle/PSR dependencies, and OpenSSL extensions. PCI scope should be minimized by preferring hosted/redirect flows where the UnionPay product supports them.
Key questions:
Stack fit: Best fit is Laravel + Composer + Omnipay, with an internal payment interface such as UnionPayChargeService or a broader PaymentGateway contract. Use Laravel configuration and environment secrets for merchant credentials and certificates. Use events/listeners for payment state transitions, structured logging for request/response correlation, and queues only for post-payment side effects such as notifications, ledger updates, or reconciliation jobs. Do not queue the synchronous customer payment authorization unless the UX explicitly supports asynchronous payment states.
Migration path: Introduce the package behind a feature flag and an application-owned adapter. If a custom UnionPay integration already exists, normalize both old and new implementations to the same domain request/response contract, then shadow or canary traffic. Start with sandbox and low-value transactions, then move to a controlled production cohort. Keep the legacy path available until callback handling, refunds, and reconciliation have been proven.
Compatibility: First gate is dependency resolution: PHP version, Laravel version, Omnipay version, Guzzle/PSR versions, and required PHP extensions such as OpenSSL. Second gate is UnionPay API/product compatibility: endpoint versions, certificate formats, signature algorithms, currency and amount rules, and callback payload shape. Third gate is operational compatibility: certificate storage, proxy/network access to UnionPay endpoints, timeout budgets, and observability.
Sequencing:
Maintenance: The package will require active ownership even if it is stable. Pin the version, monitor upstream commits/issues, track Omnipay major-version changes, and be prepared to fork or patch. Certificate and key rotation must be scheduled and tested. UnionPay specification changes, endpoint changes, and signature-algorithm changes are external maintenance triggers that the package may not absorb quickly.
Support: Expect community-level support rather than vendor-backed support for the driver. UnionPay merchant support covers the payment network, not necessarily PHP package behavior. The team needs an internal runbook covering merchant credential ownership, certificate rotation, callback troubleshooting, refund/query procedures, and escalation to UnionPay or the acquiring bank. A single-maintainer or low-activity risk should be documented.
Scaling: The integration is mostly stateless and should scale with the Laravel app, but external gateway latency and rate limits become the constraint. Use explicit timeouts, circuit breakers, and bounded retries only where idempotency is guaranteed. Persist request/response metadata and correlation IDs for support and reconciliation. High-volume flows should separate payment initiation, callback processing, and reconciliation workloads.
Failure modes: Watch for certificate expiry or misconfiguration, signature verification failures, duplicate or spoofed callbacks, timeout/unknown payment state, amount or currency mismatch, unsupported transaction types, API deprecation, dependency conflicts on Omnipay/PHP upgrades, and package abandonment. Each needs a defined behavior: fail closed on signature errors, reconcile unknown states via query, deduplicate callbacks, alert on certificate expiry, and keep a manual support path for disputed payments.
Ramp-up: The team needs ramp-up on Omnipay gateway conventions, UnionPay merchant flows, certificate operations, callback security, and Laravel integration patterns. Budget time for sandbox onboarding, test-data setup, and runbook creation. As a TPM, I would position this package as a viable accelerator for a Laravel/Omnipay-based UnionPay integration, with the decision hinging on current dependency compatibility, confirmed UnionPay product coverage, and willingness to own the payment-critical operational surface around the driver.
How can I help you explore Laravel packages today?