Download the PHP package tapbuy/alma without Composer

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

Tapbuy Alma Module

A Magento 2 module that extends the Alma Monthly Payments functionality to integrate with Tapbuy's GraphQL payment processing system.

Overview

This module provides a plugin that intercepts and modifies payment data for Alma Monthly Payments, specifically to handle custom return URLs provided by Tapbuy's additional payment information.

Features

Requirements

Installation

Composer Installation (Recommended)

  1. Add the module to your Magento project:

  2. Enable the module:

  3. Run setup upgrade:

  4. Compile if needed:

  5. Clear cache:

Manual Installation

  1. Create the directory structure:

  2. Copy all module files to the directory
  3. Follow steps 2-5 from the Composer installation

How It Works

Plugin Architecture

The module uses Magento's plugin system to intercept the Alma\MonthlyPayments\Gateway\Request\PaymentDataBuilder::build() method using an afterBuild plugin.

Payment Data Modification

When a payment is processed, the plugin:

  1. Validates Request Headers: Checks for the X-Tapbuy-Call header to ensure the request originates from Tapbuy
  2. Extracts Tapbuy Information: Retrieves serialized Tapbuy data from payment additional information
  3. Deserializes Data: Safely unserializes the Tapbuy data using Magento's serializer
  4. Maps URLs: Maps Tapbuy URLs to Alma payment parameters:
    • accept_url → return_url
    • cancel_url → customer_cancel_url and failure_return_url
  5. Updates Payment Data: Modifies the payment array with the new URL configurations

Error Handling

The plugin includes robust error handling:

Configuration

Request Headers

The module validates requests using the X-Tapbuy-Call header. This header must be present for the plugin to process Tapbuy payment modifications:

Payment Additional Information Format

The module expects Tapbuy data to be stored in the payment's additional information under the key tapbuy as a serialized array:

URL Mapping

Tapbuy Parameter Alma Parameter Description
accept_url return_url Success redirect URL
cancel_url customer_cancel_url Customer cancellation URL
cancel_url failure_return_url Payment failure URL

File Structure

Dependencies

Module Dependencies

Plugin Target

Development

Plugin Configuration

The plugin is configured in etc/di.xml:

Key Classes

PaymentDataBuilderPlugin

Troubleshooting

Common Issues

  1. Module Not Loading

    • Verify module is enabled: php bin/magento module:status Tapbuy_Alma
    • Check registration.php path is correct
  2. Plugin Not Working

    • Ensure DI compilation is up to date: php bin/magento setup:di:compile
    • Verify Alma module is installed and enabled
    • Check that the X-Tapbuy-Call header is being sent with requests
  3. Serialization Errors

    • Check that Tapbuy data is properly serialized before storage
    • Verify JSON format if using JSON serialization
  4. Headers Not Detected
    • Ensure the X-Tapbuy-Call header is included in HTTP requests
    • Verify server configuration allows custom headers
    • Check that headers are not being stripped by proxies or load balancers

Logging

The module handles errors gracefully but doesn't log them by default. For debugging, you can modify the exception handling in PaymentDataBuilderPlugin.php to add logging:

Running Tests

Tests run inside a Docker container that replicates the CI environment (PHP 8.3, Magento 2.4.7-p5). Docker must be running.

Prerequisites: clone the following sibling repository next to this one:

alma/alma-monthlypayments-magento2 is cloned automatically to ~/.tapbuy-ci-cache/ on first run.

First-time setup:

Run all unit tests:

On the first run, the Docker image is built and Magento is installed into a named volume (tapbuy-magento-2.4.7-p5-php83). Subsequent runs reuse the cached volume and are fast.

Do not use composer test — it runs PHPUnit without the Magento bootstrap and will fail or produce misleading results.

Linting

Linting runs PHPMD and PHPCS (Magento2 standard) inside the same Docker container as tests. Docker must be running.

Run both linters:

Run individually:

Both linters always run when using make lint; if either fails, the command exits with a non-zero code.


All versions of alma with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.1
magento/framework Version ^103.0
magento/module-payment Version ^100.4
almapay/alma-monthlypayments-magento2 Version ^4.0 || ^5.0
tapbuy/redirect-tracking Version ^1.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 tapbuy/alma contains the following files

Loading the files please wait ...