Download the PHP package dalpras/payment-core without Composer

On this page you can find all versions of the php package dalpras/payment-core. 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 payment-core

DalPraS Payment Core

Provider-agnostic PHP payment orchestration for checkout, completion, capture, refund, cancel and reconciliation.

The package is designed to keep application code independent from provider-specific identifiers while still supporting real payment lifecycles such as:

Goals

Package status

This package contains:

Concrete providers live in separate packages:

Installation

Namespace

Core lifecycle

Metadata model

Payment::$metadata is intentionally part of the orchestration model. It contains:

  1. Application metadata supplied by your adapter.
  2. Provider checkout metadata returned by providers.
  3. Provider operation metadata returned by completion/capture/refund/cancel/sync.

Common normalized keys:

Key Meaning
provider Provider code such as nexi or paypal
provider_payment_id Main provider order/payment identifier
order_id Generic provider order id
operation_id Generic operation id for providers such as Nexi
capture_id Generic capture id, used by PayPal refunds
authorization_id Generic authorization id, used by delayed capture/void
nexi_order_id Nexi HPP order id
nexi_operation_id Nexi operation id
paypal_order_id PayPal order id
paypal_capture_id PayPal capture id
paypal_authorization_id PayPal authorization id

Request-level metadata always wins over stored metadata, so applications can still override the selected provider identifier when needed.

Important DTOs

CheckoutResponse

Providers return metadata here to persist identifiers discovered at checkout creation.

OperationResult

All operation results carry transactionIds and metadata. Provider packages should normalize useful IDs here instead of making the application parse raw.

PaymentManager enrichment

PaymentManager automatically enriches requests before invoking providers:

This means application code can usually call:

Core will merge the stored Nexi operation_id before calling the Nexi provider.

Application adapter guidance

Application adapters should provide business data, not provider-generated IDs.

Good adapter metadata:

Provider packages then add provider metadata after API calls.

Redis payment repository

RedisPaymentRepository is the recommended production replacement for InMemoryPaymentRepository when you need a lightweight cross-request repository for redirect-based providers.

It stores the Payment aggregate and related PaymentOperation entries in Redis using PHP serialization and a configurable TTL. This lets PaymentManager recover provider metadata after the customer returns from Nexi/PayPal:

Example Symfony wiring:

Use a TTL long enough for abandoned browser sessions and delayed redirects. 86400 seconds, or 24 hours, is a practical default.

Redis should still be treated as active-flow storage. For final accounting, support, reporting and later refunds/cancels, persist important provider metadata in your own durable entity/table, for example OrderEntity.paymentMetadata.

Persistence notes

If you replace InMemoryPaymentRepository with a durable database repository, persist at least:

Payment

PaymentOperation

The new metadata and transaction id fields are important. Without them, automatic refund/cancel/capture enrichment will lose provider lifecycle identifiers.

Basic usage

Production-style repository example:

Testing

Run syntax checks:

Run PHPUnit after installing development dependencies:

License

MIT


All versions of payment-core with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
psr/http-message Version ^1.1 || ^2.0
psr/cache Version ^3.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 dalpras/payment-core contains the following files

Loading the files please wait ...