Skip to content

Commit

Permalink
Simplify addition of new test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
z38 committed Jul 16, 2018
1 parent b968153 commit 04827a0
Showing 1 changed file with 95 additions and 70 deletions.
165 changes: 95 additions & 70 deletions tests/Z38/SwissPayment/Tests/Message/CustomerCreditTransferTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,157 +32,182 @@ class CustomerCreditTransferTest extends TestCase

protected function buildMessage()
{
$message = new CustomerCreditTransfer('message-000', 'InnoMuster AG');

$payment = new PaymentInformation(
'payment-000',
'InnoMuster AG',
new BIC('ZKBKCHZZ80A'),
new IBAN('CH6600700110000204481')
);
$message->addPayment($payment);

$transaction = new BankCreditTransfer(
'instr-001',
'e2e-001',
'instr-000',
'e2e-000',
new Money\CHF(130000), // CHF 1300.00
'Muster Transport AG',
new StructuredPostalAddress('Wiesenweg', '14b', '8058', 'Zürich-Flughafen'),
new IBAN('CH51 0022 5225 9529 1301 C'),
new BIC('UBSWCHZH80A')
);
$payment->addTransaction($transaction);

$transaction2 = new IS1CreditTransfer(
'instr-002',
'e2e-002',
$transaction = new IS1CreditTransfer(
'instr-001',
'e2e-001',
new Money\CHF(30000), // CHF 300.00
'Finanzverwaltung Stadt Musterhausen',
new StructuredPostalAddress('Altstadt', '1a', '4998', 'Muserhausen'),
new PostalAccount('80-5928-4')
);
$payment->addTransaction($transaction);

$transaction3 = new IS2CreditTransfer(
'instr-003',
'e2e-003',
$transaction = new IS2CreditTransfer(
'instr-002',
'e2e-002',
new Money\CHF(20000), // CHF 200.00
'Druckerei Muster GmbH',
new StructuredPostalAddress('Gartenstrasse', '61', '3000', 'Bern'),
new IBAN('CH03 0900 0000 3054 1118 8'),
'Musterbank AG',
new PostalAccount('80-151-4')
);
$payment->addTransaction($transaction);

$iban4 = new IBAN('CH51 0022 5225 9529 1301 C');
$transaction4 = new BankCreditTransfer(
'instr-004',
'e2e-004',
$iban = new IBAN('CH51 0022 5225 9529 1301 C');
$transaction = new BankCreditTransfer(
'instr-003',
'e2e-003',
new Money\CHF(30000), // CHF 300.00
'Muster Transport AG',
null,
$iban4,
IID::fromIBAN($iban4)
$iban,
IID::fromIBAN($iban)
);
$transaction4->setPurpose(new PurposeCode('AIRB'));
$transaction->setPurpose(new PurposeCode('AIRB'));
$payment->addTransaction($transaction);

$transaction5 = new SEPACreditTransfer(
'instr-005',
'e2e-005',
$payment = new PaymentInformation(
'payment-010',
'InnoMuster AG',
new BIC('POFICHBEXXX'),
new IBAN('CH6309000000250097798')
);
$message->addPayment($payment);

$transaction = new SEPACreditTransfer(
'instr-010',
'e2e-010',
new Money\EUR(70000), // EUR 700.00
'Muster Immo AG',
new UnstructuredPostalAddress('Musterstraße 35', '80333 München', 'DE'),
new IBAN('DE89 3704 0044 0532 0130 00'),
new BIC('COBADEFFXXX')
);
$payment->addTransaction($transaction);

$transaction6 = new ForeignCreditTransfer(
'instr-006',
'e2e-006',
$transaction = new ForeignCreditTransfer(
'instr-011',
'e2e-011',
new Money\GBP(6500), // GBP 65.00
'United Development Ltd',
new UnstructuredPostalAddress('George Street', 'BA1 2FJ Bath', 'GB'),
new IBAN('GB29 NWBK 6016 1331 9268 19'),
new BIC('NWBKGB2L')
);
$payment->addTransaction($transaction);

$transaction7 = new ForeignCreditTransfer(
'instr-007',
'e2e-007',
$transaction = new ForeignCreditTransfer(
'instr-012',
'e2e-012',
new Money\KWD(300001), // KWD 300.001
'United Development Kuwait',
new UnstructuredPostalAddress('P.O. Box 23954 Safat', '13100 Kuwait', 'KW'),
new IBAN('BR97 0036 0305 0000 1000 9795 493P 1'),
new FinancialInstitutionAddress('Caixa Economica Federal', new UnstructuredPostalAddress('Rua Sao Valentim, 620', '03446-040 Sao Paulo-SP', 'BR'))
);
$payment->addTransaction($transaction);

$transaction8 = new ForeignCreditTransfer(
'instr-008',
'e2e-008',
$transaction = new ForeignCreditTransfer(
'instr-013',
'e2e-013',
new Money\GBP(4500), // GBP 45.00
'United Development Belgium SA/NV',
new UnstructuredPostalAddress('Oostjachtpark 187', '6743 Buzenol', 'BE'),
new GeneralAccount('123-4567890-78'),
new FinancialInstitutionAddress('Belfius Bank', new UnstructuredPostalAddress('Pachecolaan 44', '1000 Brussel', 'BE'))
);
$transaction8->setIntermediaryAgent(new BIC('SWHQBEBB'));
$transaction->setIntermediaryAgent(new BIC('SWHQBEBB'));
$payment->addTransaction($transaction);

$payment = new SEPAPaymentInformation(
'payment-020',
'InnoMuster AG',
new BIC('POFICHBEXXX'),
new IBAN('CH6309000000250097798')
);
$message->addPayment($payment);

$transaction9 = new SEPACreditTransfer(
'instr-009',
'e2e-009',
$transaction = new SEPACreditTransfer(
'instr-020',
'e2e-020',
new Money\EUR(10000), // EUR 100.00
'Bau Muster AG',
new UnstructuredPostalAddress('Musterallee 11', '10115 Berlin', 'DE'),
new IBAN('DE22 2665 0001 9311 6826 12'),
new BIC('NOLADE21EMS')
);
$payment->addTransaction($transaction);

$transaction10 = new ISRCreditTransfer(
'instr-010',
'e2e-010',
$payment = new PaymentInformation(
'payment-030',
'InnoMuster AG',
new BIC('POFICHBEXXX'),
new IBAN('CH6309000000250097798')
);
$message->addPayment($payment);

$transaction = new ISRCreditTransfer(
'instr-030',
'e2e-030',
new Money\CHF(20000), // CHF 200.00
new ISRParticipant('01-1439-8'),
'210000000003139471430009017'
);
$payment->addTransaction($transaction);

$transaction11 = new ISRCreditTransfer(
'instr-011',
'e2e-011',
$transaction = new ISRCreditTransfer(
'instr-031',
'e2e-031',
new Money\CHF(20000), // CHF 200.00
new ISRParticipant('01-95106-8'),
'6019701803969733825'
);
$transaction11->setCreditorDetails(
$transaction->setCreditorDetails(
'Fritz Bischof',
new StructuredPostalAddress('Dorfstrasse', '17', '9911', 'Musterwald')
);
$payment->addTransaction($transaction);

$transaction12 = new IS1CreditTransfer(
'instr-012',
'e2e-012',
$payment = new PaymentInformation(
'payment-040',
'InnoMuster AG',
new BIC('POFICHBEXXX'),
new IBAN('CH6309000000250097798')
);
$payment->setCategoryPurpose(new CategoryPurposeCode('SALA'));
$message->addPayment($payment);

$transaction = new IS1CreditTransfer(
'instr-040',
'e2e-040',
new Money\CHF(50000), // CHF 500.00
'Meier & Söhne AG',
new StructuredPostalAddress('Dorfstrasse', '17', '9911', 'Musterwald'),
new PostalAccount('60-9-9')
);

$payment = new PaymentInformation('payment-001', 'InnoMuster AG', new BIC('ZKBKCHZZ80A'), new IBAN('CH6600700110000204481'));
$payment->addTransaction($transaction);
$payment->addTransaction($transaction2);
$payment->addTransaction($transaction3);
$payment->addTransaction($transaction4);

$payment2 = new PaymentInformation('payment-002', 'InnoMuster AG', new BIC('POFICHBEXXX'), new IBAN('CH6309000000250097798'));
$payment2->addTransaction($transaction5);
$payment2->addTransaction($transaction6);
$payment2->addTransaction($transaction7);
$payment2->addTransaction($transaction8);

$payment3 = new SEPAPaymentInformation('payment-003', 'InnoMuster AG', new BIC('POFICHBEXXX'), new IBAN('CH6309000000250097798'));
$payment3->addTransaction($transaction9);

$payment4 = new PaymentInformation('payment-004', 'InnoMuster AG', new BIC('POFICHBEXXX'), new IBAN('CH6309000000250097798'));
$payment4->addTransaction($transaction10);
$payment4->addTransaction($transaction11);

$payment5 = new PaymentInformation('payment-005', 'InnoMuster AG', new BIC('POFICHBEXXX'), new IBAN('CH6309000000250097798'));
$payment5->setCategoryPurpose(new CategoryPurposeCode('SALA'));
$payment5->addTransaction($transaction12);

$message = new CustomerCreditTransfer('message-001', 'InnoMuster AG');
$message->addPayment($payment);
$message->addPayment($payment2);
$message->addPayment($payment3);
$message->addPayment($payment4);
$message->addPayment($payment5);

return $message;
}
Expand Down

0 comments on commit 04827a0

Please sign in to comment.