ch2877 / swiss-payment

PHP library to generate Swiss pain.001 XML messages
MIT License
8 stars 5 forks source link

Add Notification Instruction #11

Open cbaconnier opened 2 years ago

cbaconnier commented 2 years ago

Motivation

For some banks, such as BCV, not indicating anything in the Notification Instruction in combination with the Batch Booking value set to true is processed by the bank with a global debit notification without details.
In result, the camt.053 file does not include the EndToEndId.

If we want to receive the details of all the transactions from our payment in the camt.053 file and at the same time have a single grouped entry on our account statement, our XML has to contain CWD in the Notification Instruction.

This pull request adds the Notification Instruction based on six-group implementation guideline[^1] and tests.

Usage

$payment = new PaymentInformation(
    'payment-001',
    'InnoMuster AG',
    new BIC('ZKBKCHZZ80A'),
    new IBAN('CH6600700110000204481')
);

/**
 * Available types: 
 *            NOA - No Advice
 *            SIA - Single Advice
 *            CND - Collective Advice No Details
 *            CWD - Collective Advice With Details 
 */
$payment->setNotificationInstruction(new NotificationInstruction('CWD'));

Notes

References

[^1]: Implementation guideline: https://www.six-group.com/dam/download/banking-services/interbank-clearing/en/standardization/iso/swiss-recommendations/implementation-guidelines-ct.pdf#page=31 [^2]: Swiss Business Rule: https://www.six-group.com/dam/download/banking-services/interbank-clearing/en/standardization/iso/swiss-recommendations/business-rules.pdf#page=48

sdespont commented 1 year ago

Why this PR has never be merged ? It is relevant and well implemented with tests.