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.
Just install Composer and run composer require trogels/nordea-payment
in your project directory.
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(40000), // DKK 400.00
'Rasmus Klump',
new StructuredPostalAddress('Pildskaddevej', '12', '3782', 'Klemensker'),
new SOSE('1710791485'),
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();