Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Payments Core

Payments Core Laravel Package

korozcolt/payments-core

Core payment primitives for Laravel apps: gateway contracts, transaction lifecycle, refunds, webhooks, and a consistent driver-based API for integrating multiple payment providers.

Deep Wiki
Context7

korozcolt/payments-core provides a lightweight payment abstraction layer for Laravel, exposing one consistent API for creating charges, issuing refunds, and tracking transactions across multiple gateways. Payment logic stays decoupled from provider-specific code, so adding or swapping a gateway doesn't ripple through your application.

  • Unified gateway contract for charges, refunds, and status lookups
  • Transaction value objects for amounts, currencies, and results
  • Laravel integration via service provider, facade, and publishable config
  • Extensible drivers for custom gateways and middleware
  • Test-friendly contracts and fakes for confident unit testing
Frequently asked questions about Payments Core
What is korozcolt/payments-core and what does it do?
korozcolt/payments-core is the framework-agnostic core of the korozcolt/payments package family. It provides shared abstractions and utilities that the Wompi, MercadoPago and ePayco drivers build on, so payment gateway logic stays consistent across providers instead of being duplicated. Because it has no framework dependency, it can be used inside a Laravel application or in any plain PHP project. It is the foundation layer, not a ready-made checkout solution.
How do I install korozcolt/payments-core with Composer?
Install it as a normal Composer dependency with composer require korozcolt/payments-core. Since it is a library rather than a framework bundle, there is usually nothing to register manually. Check the package's composer.json for the exact PHP version and PSR dependency constraints before installing. In most projects you will also pull in the gateway drivers you actually intend to use.
Does korozcolt/payments-core work with Laravel?
Yes. It is framework-agnostic, so it drops into a Laravel application like any other Composer library. You will typically bind a PSR-18 HTTP client, PSR-17 factories and a PSR-3 logger in the service container and inject them into the drivers. Laravel's own HTTP client is not PSR-18 compliant, so use a PSR-18 implementation such as Guzzle or symfony/http-client behind the scenes. No Laravel-specific service provider is required for the core itself.
Can I use korozcolt/payments-core outside of Laravel?
Yes, that is exactly what the framework-agnostic design is for. Any PHP project with Composer and PSR-compatible dependencies can consume the core and the gateway drivers directly. You just need to supply your own PSR-18 client, PSR-17 factories, PSR-3 logger and PSR-14 dispatcher. This makes it usable in Symfony, Slim, or bespoke PHP applications.
Which payment gateways does korozcolt/payments-core support?
The core is primarily built to support the Wompi, MercadoPago and ePayco drivers that ship with korozcolt/payments. It holds the shared abstractions those drivers rely on rather than the provider-specific API calls themselves. If you need a gateway that is not among those three, you would implement it on top of the core abstractions. Always confirm current driver coverage in the repository's README before committing to it.
Which PSR standards and PHP versions does korozcolt/payments-core require?
The package advertises interoperability with PSR-18 (HTTP client), PSR-17 (HTTP factories), PSR-3 (logger) and PSR-14 (event dispatcher). That combination means you can swap HTTP transports and logging implementations without touching gateway code. The exact PHP version constraint and the specific PSR package versions are declared in the package's composer.json, so verify them against your runtime before upgrading. PHP 8.x is a safe assumption for a modern package, but confirm rather than guess.
How do I test payment integrations built on korozcolt/payments-core?
Because HTTP, logging and events are all injected through PSR interfaces, you can substitute test doubles for each one. Provide a fake PSR-18 client that returns canned gateway responses so your tests never hit a live payment API. A null or in-memory PSR-3 logger keeps test output clean, and a simple PSR-14 dispatcher lets you assert which events fired. This keeps your suite fast and deterministic, which matters a lot for payment code.
How do I add a custom payment gateway or swap in my own HTTP client?
Implement the core abstractions for your provider and inject your own PSR-18 client and PSR-17 factories into it. Swapping the HTTP client requires no changes to gateway code, since everything is resolved through the shared interfaces. This is also the reason the core exists: new providers get consistent behaviour for free. If you would rather not maintain your own abstractions, general-purpose alternatives such as Omnipay take a similar driver-based approach, though with a different API surface.
What is the difference between korozcolt/payments and korozcolt/payments-core?
korozcolt/payments-core is the shared foundation: abstractions, contracts and utilities. korozcolt/payments is the integration layer that wires those abstractions to concrete drivers like Wompi, MercadoPago and ePayco. In most applications you install the higher-level package and get the core transitively. Install the core on its own only when you are building a custom gateway or using it in a non-Laravel context.
What should I check before using korozcolt/payments-core in production?
Verify the package's release history and recent commit activity, since a small package can go quiet quickly and payment APIs change often. Keep credentials in environment variables or a secrets manager, never in source control, and make sure logs do not leak card data or tokens. Configure timeouts and retries on your PSR-18 client, and implement idempotency keys at the driver or application level to avoid duplicate charges. Finally, confirm the driver you depend on documents webhook signature verification, and pin the package version in composer.lock.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo