Download the PHP package veltix/laravel-montonio without Composer

On this page you can find all versions of the php package veltix/laravel-montonio. 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 laravel-montonio

Laravel Montonio

Laravel integration for the Montonio Payments and Shipping APIs.

Requirements

Installation

Run the install command to publish the config and migrations:

If you plan to use your own database tables and models, skip migrations during install:

Add your API credentials to .env:

Run the migrations and sync methods from the Montonio API:

Configuration

Publish the config file manually (the install command does this automatically):

Environment variables

Variable Default Description
MONTONIO_ACCESS_KEY '' Your Montonio API access key
MONTONIO_SECRET_KEY '' Your Montonio API secret key
MONTONIO_ENVIRONMENT sandbox API environment (sandbox or production)
MONTONIO_TIMEOUT 30 HTTP request timeout in seconds
MONTONIO_MIGRATIONS_ENABLED true Load the package's migrations
MONTONIO_SYNC_COMMANDS_ENABLED true Register the montonio:sync-methods command
MONTONIO_CACHE_ENABLED true Enable caching for payment/shipping methods
MONTONIO_CACHE_TTL 3600 Cache time-to-live in seconds
MONTONIO_WEBHOOK_ROUTE /montonio/webhook Webhook endpoint path
MONTONIO_WEBHOOK_QUEUE null Queue name for async webhook processing

Usage

Facade

Access the Montonio API clients through the Montonio facade:

Syncing methods

Sync payment and shipping methods from the Montonio API:

Querying methods

Use the PaymentMethod and ShippingMethod Eloquent models to query synced methods:

For cached queries, use the MethodCacheService:

Webhooks

The package automatically registers a POST route at /montonio/webhook (configurable via MONTONIO_WEBHOOK_ROUTE). The controller detects whether the incoming webhook is a payment or shipping notification and dispatches the appropriate event.

Events

Payment webhook:

Event Payload
PaymentWebhookReceived PaymentWebhookPayload

Shipping webhooks:

Event Payload
ShipmentRegistered ShippingWebhookPayload
ShipmentRegistrationFailed ShippingWebhookPayload
ShipmentStatusUpdated ShippingWebhookPayload
ShipmentLabelsCreated ShippingWebhookPayload
LabelFileReady ShippingWebhookPayload
LabelFileCreationFailed ShippingWebhookPayload

All events live in the Veltix\LaravelMontonio\Events namespace.

Listening to events

Register listeners in your EventServiceProvider or use Laravel's event discovery:

Each event has a public PaymentWebhookPayload|ShippingWebhookPayload $payload property containing the verified webhook data.

Queued webhooks

To process webhooks asynchronously, set the queue name:

When set, the controller immediately responds with 202 and dispatches a ProcessMontonioWebhook job onto the specified queue. The job verifies the token and fires the appropriate event.

Webhook middleware

Add middleware to the webhook route via the config:

Customization

Custom models

By default the package provides PaymentMethod and ShippingMethod Eloquent models backed by their own migrations. If your application already has payment or shipping method tables, you can swap the models the package uses at runtime.

  1. Disable the package's migrations and sync commands:

  2. Point the config at your own models:

The sync actions, cache service, and everything else in the package will use your models instead.

Extending the default models

If you only need to add relationships or change the table name, extend the package's models instead of writing your own from scratch:

Then register it in the config:

Disabling the sync command

Set MONTONIO_SYNC_COMMANDS_ENABLED=false to prevent the montonio:sync-methods command from being registered. This is useful when you want to write your own sync logic while still using the rest of the package.

Caching

The MethodCacheService caches active payment and shipping methods using Laravel's cache system. Configure caching with:

Set MONTONIO_CACHE_ENABLED=false to disable caching and query the database directly.

Cache keys used: montonio:payment_methods and montonio:shipping_methods.

Custom HTTP client

The package uses Guzzle by default. To use a custom PSR-18 HTTP client, bind the PSR interfaces in a service provider:

Testing

License

MIT


All versions of laravel-montonio with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
veltix/montonio Version ^1.0
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/events Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/routing Version ^11.0|^12.0|^13.0
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/queue Version ^11.0|^12.0|^13.0
illuminate/cache Version ^11.0|^12.0|^13.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 veltix/laravel-montonio contains the following files

Loading the files please wait ...