Skip to content

troelslenda/nordea-payment

 
 

Repository files navigation

Nordea Payment

Build Status Scrutinizer Code Quality Scrutinizer Code Coverage

Nordea Payment is a PHP library to generate Danish Nordea pain.001 XML messages (complies with ISO-20022). It is based on Nordea's Corporate eGateway Message Implementation Guideline for pain.001 messages. It is also a fork of the SwissPayment library and altered to fit Nordea's needs.

NOTE: It is currently only used for domestic payments, so intl transactions have not been tested as rigorously.

Installation

Just install Composer and run composer require trogels/nordea-payment in your project directory.

Usage

To get a basic understanding on how the messages are structured, take a look the resources mentioned below. The following example shows how to create a message containing two transactions:

<?php

require_once __DIR__.'/vendor/autoload.php';

use NordeaPayment\BIC;
use NordeaPayment\IBAN;
use NordeaPayment\Message\CustomerCreditTransfer;
use NordeaPayment\Money;
use NordeaPayment\PaymentInformation\PaymentInformation;
use NordeaPayment\StructuredPostalAddress;
use NordeaPayment\TransactionInformation\BankCreditTransfer;

$transaction1 = new BankCreditTransfer(
    'e2e-001',
    new Money\DKK(130000), // DKK 1300.00
    'Anders And',
    new StructuredPostalAddress('Andevej', '13', '8000', 'Odense C'),
    new BBAN('1234', '1234567890'),
    new BIC('NDEADKKK')
);

$transaction2 = new NemKontoCreditTransfer(
    'e2e-002',
    new Money\DKK(30000), // DKK 300.00
    'Rasmus Klump',
    new StructuredPostalAddress('Pildskaddevej', '12', '3782', 'Klemensker'),
    new BBAN('0568', '7894561'),
    new BIC('NDEADKKK')
);

$payment = new PaymentInformation(
    'payment-001',
    'René Dif fra Aqua',
    new BIC('NDEADKKK'),
    new BBAN('1234', '1234567890')
);
$payment->addTransaction($transaction1);
$payment->addTransaction($transaction2);

$message = new CustomerCreditTransfer('message-001', 'Acme Test A/S', 'ACMETEST');
$message->addPayment($payment);

echo $message->asXml();

Further Resources

About

PHP library to generate pain.001 XML messages

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%