Download the PHP package spryker/app-webhook without Composer

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

AppWebhook Module

Latest Stable Version Minimum PHP Version

Provides SyncAPI and AsyncAPI schema files and the needed code to make the Mini-Framework an App with Webhook capabilities.

Installation

Configure

App Identifier

config/Shared/config_default.php

Testing the AppWebhook

You can test the AppWebhook as usual with Codeception. Before that you need to run some commands:

With these commands you've set up the AppWebhook and can start the tests

Documentation

Webhook handling

This package is responsible to receive and handle webhooks. The package provides a controller that can be used to handle incoming webhooks.

The API endpoint is /webhooks and the controller is WebhooksController inside the Glue Application. This package is not handling webhooks on its own, you must implement the logic to handle the webhooks via the provided \Spryker\Zed\AppWebhook\Dependency\Plugin\WebhookHandlerPluginInterface, see the description down below.

Process in a Nutshell

Retry Mechanism

In a case when a webhook can not be handled it is persisted in the database and will be retried with the next incoming webhook. The number of retries is configurable and can be set in the AppWebhookConfig::getAllowedNumberOfRetries() method.

There are numerous reasons why a webhook may fail. An exception is thrown, the plugin implementation returns a failed response or the plugin implementation returns a not handled response.

Another case could be an event is sent to the application before it is ready to handle it. For example, in the PreOrder payment of a PSP the order has not persisted yet and has no order-reference, but the PSP sends a webhook request about a payment state, in this case, the system has to wait until it can process the webhook.

Future improvements for the Retry mechanism

It may be helpful in the future to provide a console command that can be used to retry failed webhooks. This command can be used to retry all failed webhooks or only a specific webhook.

Configuration

Currently only the number of allowed retries can be configured. The configuration can be found in the AppWebhookConfig class.

Plugins

GlueApplication

\Spryker\Glue\AppWebhookBackendApi\Plugin\GlueApplication\AppWebhookBackendApiRouteProviderPlugin

This plugin provides the routes for the AppWebhookBackendApi module.

Extensions

\Spryker\Zed\AppWebhook\Dependency\Plugin\WebhookHandlerPluginInterface

This plugin can be implemented by any other module and has two methods:

The canHandle() method is used to check if a webhook can be handled by a specific module. F.e. you have two handlers one for order.created and one for order.updated you can check in the canHandle() method if the webhook can be handled by the module and return true or false.

The handle() method is used to handle the webhook. The method is called if the canHandle() method returns true. The method should return a WebhookResponseTransfer with the status of the webhook handling.


All versions of app-webhook with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
spryker/glue-application-extension Version ^1.0.0
spryker/kernel Version ^3.30.0
spryker/log Version ^3.0.0
spryker/symfony Version ^3.0.0
spryker/transfer Version ^3.33.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 spryker/app-webhook contains the following files

Loading the files please wait ....