Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Omnipay: Magnius

Magnius gateway for the Omnipay PHP payment processing library

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 7.1+. This package implements Magnius support for Omnipay.

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.


Via Composer

$ composer require league/omnipay fruitcake/omnipay-magnius


The following gateways are provided by this package:

  • Magnius

The following paymentMethods are implemented:

  • ideal
  • paypal
  • sepa (requires Customer)


You can create a Customer using the CreateCustomerRequest. The Response contains a customerReference you can use in your requests.

$response = $gateway->createCustomer([
   'card' => [
       'email' => '',
       'country' => 'NL',
       'city' => 'Eindhoven',
       'address1' => 'My Street',
       'phone' => '123',
       'company' => 'Fruitcake',


$customerId = $response->getCustomerId();


 $gateway = \Omnipay\Omnipay::create('Magnius');
        'accountId' => '',
        'apiKey' => '',
        'testMode' => true,
        'organisationId' => null,

    // Start the purchase
        $url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
        $response = $gateway->purchase(array(
            'amount' => "6.84",
            'description' => "Testorder #1234",
            'issuer' => 'ABNANL2A',                  // Get the id from the issuers list
            'paymentMethod' => 'ideal',             // For 'ideal', the Issuer is required
            'transactionId' => 1234,
            'customerId' => $customerId,            // If you have a customerId
            'returnUrl' => $url,
            'notifyUrl' => $url,

        if ($response->isRedirect()) {
            // redirect to offsite payment gateway
        } elseif ($response->isPending()) {
            // Process started (for example, 'overboeking')
            return "Pending, Reference: ". $response->getTransactionReference();
        } else {
            // payment failed: display message to customer
            return "Error " .$response->getCode() . ': ' . $response->getMessage() . 
            ' Details: '. print_r($response->getDetails(), true);
        // Check the status
        $response = $gateway->completePurchase()->send();
            $reference = $response->getTransactionReference();  // TODO; Check the reference/id with your database
            return "Transaction '" . $response->getTransactionId() . "' succeeded!";
            return "Error " .$response->getCode() . ': ' . $response->getMessage();

For general usage instructions, please see the main Omnipay repository.


If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release announcements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

Change log

Please see CHANGELOG for more information what has changed recently.


$ composer test


Please see CONTRIBUTING for details.


If you discover any security related issues, please email instead of using the issue tracker.



The MIT License (MIT). Please see License File for more information.