Download the PHP package webhook-ledger/webhook-ledger-bundle without Composer

On this page you can find all versions of the php package webhook-ledger/webhook-ledger-bundle. 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 webhook-ledger-bundle

Webhook Ledger Bundle

PHP Symfony Doctrine ORM

Idempotent webhook reception with transactional outbox, retries and replay, built on Doctrine and Symfony Messenger.

Table of contents

Requirements

Installation

You need to register the bundle yourself in config/bundles.php:

It then exposes:

This bundle provides an application service Receiver::replay(), which you can call if you want to use the replay feature your own way.

Note that you can easily reuse the command behavior with Symfony's command in controller.

Declaring a webhook provider

Each provider (Stripe, GitHub, ...) must implement Domain\Contract\SourceAdapterInterface and be registered by the container as a service.

The bundle's auto-configuration automatically tags it as a webhook_ledger.source_adapter:

Doctrine mapping

The Infrastructure\Doctrine\Entity\WebhookEntry entity must be added to the project's Doctrine mapping (config/packages/doctrine.yaml), and the Messenger transport used for Application\Worker\Message\ProcessWebhookEvent must be a Doctrine transport (doctrine://...) pointing to the same connection as the EntityManager.

Be aware that this is what guarantees the transactional outbox!

Migration

Important: the Doctrine transport must run with auto_setup=0 (see MESSENGER_TRANSPORT_DSN and the failed transport in config/packages/messenger.yaml).

Letting Messenger create the messenger_messages table on its own (default behavior, on the first dispatched message) means an implicit DDL statement could break the atomicity guarantee made by this package (depending on your DB engine).

The messenger_messages table must be created upfront, through a regular migration, before the endpoint receives its first webhook.

Migration example (used for my live instance demo project)

Guarantees

Decisions

Architecture

The bundle follows a strict hexagonal architecture, enforced by deptrac:

The business handler (what happens when the webhook is processed) is up to you to implement.

Special warning: since the Transactional Outbox pattern is an at-least-once strategy, your business handler SHOULD BE idempotent, otherwise you will end up with unexpected behavior.

See this article for more information:


All versions of webhook-ledger-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
doctrine/collections Version ^2.2 || ^3.1
doctrine/dbal Version ^3.8.2 || ^4.0
doctrine/doctrine-bundle Version ^2.13 || ^3.0
doctrine/orm Version ^3.0
doctrine/persistence Version ^3.3.1 || ^4.0
psr/log Version ^1 || ^2 || ^3
symfony/config Version ^7.0 || ^8.0
symfony/console Version ^7.0 || ^8.0
symfony/dependency-injection Version ^7.0 || ^8.0
symfony/event-dispatcher Version ^7.0 || ^8.0
symfony/framework-bundle Version ^7.0 || ^8.0
symfony/http-foundation Version ^7.0 || ^8.0
symfony/http-kernel Version ^7.0 || ^8.0
symfony/messenger Version ^7.0 || ^8.0
symfony/routing Version ^7.0 || ^8.0
symfony/uid Version ^7.0 || ^8.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 webhook-ledger/webhook-ledger-bundle contains the following files

Loading the files please wait ...