Download the PHP package birkof/netopia-mobilpay-bundle without Composer

On this page you can find all versions of the php package birkof/netopia-mobilpay-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 netopia-mobilpay-bundle

Netopia MobilPay Bundle — Architecture Overview

A thin, typed Symfony integration layer over the birkof/netopia-mobilpay low-level SDK. It wires the SDK into the Symfony service container and exposes two responsibilities of the Netopia (MobilPay) card-payment protocol:

The bundle holds no state, no persistence, and no HTTP controllers. It builds request objects and parses notifications; the consuming application owns routing, fulfilment, and storage.

Source of truth for this document: the files under src/ (14 PHP files, ~1090 LOC), composer.json, phpunit.xml.dist, and .github/workflows/ci.yml. Usage examples live in src/Resources/doc/index.md.


Requirements

From composer.json:

Dependency Constraint Role
php ^8.3 runtime
birkof/netopia-mobilpay ^4.0 low-level Netopia SDK (Mobilpay\…): crypto + XML protocol
symfony/routing ^4.4 \|\| ^5.0 \|\| ^6.0 generates the absolute confirm/return URLs
symfony/yaml ^4.4 \|\| ^5.0 \|\| ^6.0 loads Resources/config/services.yaml
symfony/monolog-bundle ^3.7 provides the logger service injected into both services
phpunit/phpunit (dev) ^11.5 test suite

Autoload (PSR‑4): birkof\NetopiaMobilPay\src/.


Installation

1. Require the package

2. Register the bundle

With Symfony Flex this is automatic. Otherwise add it to config/bundles.php:

3. Configure the gateway

signature is required — the bundle fails to boot without it. payment_url, public_cert and private_key are optional (defaults: sandbox URL, null, null). Both public_cert and private_key accept either a file path (resolved relative to %kernel.project_dir%) or the inline PEM content.

4. Define the confirm and return routes

The bundle generates absolute URLs from two route names it expects you to define (NetopiaMobilPayConfiguration::CONFIRM_URL / ::RETURN_URL). These names are mandatory — missing them breaks URL generation at container build time:


Usage

Both entry points are autowired by their interface:

Start a payment (outbound)

createCreditCardPaymentObject() validates the input, builds and RSA‑seals the request, and returns the SDK request object exposing the sealed env_key / data (and cipher / iv for block ciphers). Render an auto‑submitting form that POSTs them to the gateway URL.

PCI note: leave the creditCard argument empty and let the gateway's hosted page collect the card details. Passing a raw PAN/CVV through your server places the whole application in PCI‑DSS SAQ‑D scope.

Handle the confirmation (inbound IPN)

Netopia POSTs the encrypted notification to your netopia_mobilpay_confirm_url route. Decrypt it, verify the amount/order yourself, then acknowledge with <crc>:

IpnResult predicates: isConfirmed(), isPaid(), isPending(), isCanceled(), isError(). See src/Resources/doc/index.md for the full integration guide.


Architecture at a glance

The SDK does the cryptography and XML; this bundle adapts it to Symfony DI and gives the inbound side a typed, vendor‑agnostic result.


Components

Grouped by directory under src/:

Bundle + DI

File Responsibility
NetopiaMobilPayBundle.php The bundle. const ALIAS = 'netopia_mobilpay', const VERSION = '1.4.0'; returns NetopiaMobilPayExtension from getContainerExtension().
DependencyInjection/Configuration.php Config tree (getConfigTreeBuilder): nodes payment_url, public_cert, private_key, signature. signature is isRequired()->cannotBeEmpty() — a missing signature fails config processing rather than booting with a placeholder.
DependencyInjection/NetopiaMobilPayExtension.php Loads services.yaml, processes config, and registers the service graph (below). inflateServicesInConfig() turns any @service‑prefixed config string into a Reference. Secrets are passed to the configuration object only via method calls — they are never written to container parameters (which Symfony would dump to the compiled‑container cache in cleartext).

Service graph built by the extension:

Resources/config/services.yaml aliases each interface to its service for autowiring: NetopiaMobilPayServiceInterface → netopia_mobilpay.payment, NetopiaMobilPayIpnHandlerInterface → netopia_mobilpay.ipn_handler.

Configuration value object

Configuration/NetopiaMobilPayConfiguration.php — runtime holder for the gateway settings, built once and shared by both services.

Outbound — payment request building

Service/NetopiaMobilPayServiceInterface.php + NetopiaMobilPayService.php.

The returned request object exposes the sealed env_key / data; the application renders an auto‑submitting HTML form POSTing them to getPaymentUrl().

Inbound — IPN handling (src/Notification/)

File Responsibility
IpnAction.php Backed enum IpnAction: string of gateway actions (confirmed, confirmed_pending, paid_pending, paid, canceled, credit) plus an Unknown fallback. fromValue(?string) maps unrecognized/null to Unknown (forward‑compatible — never throws on a new action).
IpnResult.php final readonly DTO — an immutable, vendor‑agnostic view of a decrypted notification. fromNotify(Notify) maps the SDK object (money kept as string, errorCode cast to int). Predicates: isError(), isConfirmed(), isPaid(), isPending(), isCanceled().
NetopiaMobilPayIpnHandlerInterface.php / NetopiaMobilPayIpnHandler.php decrypt(string $envKey, string $encData, ?string $cipher = null, ?string $iv = null): IpnResult opens the envelope via RequestAbstract::factoryFromEncrypted() using the configured private key, then returns IpnResult::fromNotify(). confirmResponse() / errorResponse($message, $errorType, $errorCode) build the <crc> reply with DOMDocument (values XML‑escaped). Constants ERROR_TYPE_TEMPORARY = 1 (gateway retries) and ERROR_TYPE_PERMANENT = 2. Decrypt failures log only the error code (never the vendor message, key material, or ciphertext) and surface a generic NetopiaMobilPayException.

Errors

Exception/NetopiaMobilPayException.php — the single extends \Exception type thrown by the bundle (invalid input, failed encryption, failed/empty/garbage IPN payload).

All src/ classes declare declare(strict_types=1).


Request / response flows

Outbound (start a payment):

Inbound (gateway confirmation / IPN):


Security model


Project layout


Configuration reference

Defined in config/packages/netopia_mobilpay.yaml (see src/Resources/doc/index.md for full examples):

Key Required Default Notes
signature yes merchant signature; processing fails if absent
payment_url no http://sandboxsecure.mobilpay.ro gateway base URL (set the production URL in prod)
public_cert no null file path or inline PEM; used to seal outbound requests
private_key no null file path or inline PEM; used to open inbound IPNs

The application must also define two routes the configuration generates URLs for: netopia_mobilpay_confirm_url (server‑to‑server IPN) and netopia_mobilpay_return_url (browser return).

Inject by interface:


Testing & CI


License

MIT — see LICENSE.md.


All versions of netopia-mobilpay-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
birkof/netopia-mobilpay Version ^4.0
symfony/monolog-bundle Version ^3.7
symfony/routing Version ^4.4 || ^5.0 || ^6.0
symfony/yaml Version ^4.4 || ^5.0 || ^6.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 birkof/netopia-mobilpay-bundle contains the following files

Loading the files please wait ...