From fe93880affc3c50cd410beaeda6a1abce901f5a0 Mon Sep 17 00:00:00 2001 From: aldnin Date: Mon, 6 Oct 2014 15:13:47 +0200 Subject: [PATCH] Update BaseTransferInformation.php Necessary else clause, because otherwise it will not multiply non-floats with 100,which leads as a result to wrong transferAmount values. The $amount of 100 would be saved as transferAmount = 100, which generates a wrong value of 10.00 EUR when converted back to SEPA-Amount in CustomDirectDebitTransferDomBuilder->inToCurrency in visitTransferInformation(). --- .../Sepa/TransferInformation/BaseTransferInformation.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Digitick/Sepa/TransferInformation/BaseTransferInformation.php b/lib/Digitick/Sepa/TransferInformation/BaseTransferInformation.php index 5c14f98..d50fdbe 100644 --- a/lib/Digitick/Sepa/TransferInformation/BaseTransferInformation.php +++ b/lib/Digitick/Sepa/TransferInformation/BaseTransferInformation.php @@ -90,6 +90,8 @@ public function __construct($amount, $iban, $name) } bcscale(2); $amount = (integer)bcmul($amount, 100); + } else { + $amount = (integer)$amount * 100; } $this->transferAmount = $amount; $this->iban = $iban; @@ -209,4 +211,4 @@ public function getRemittanceInformation() return $this->remittanceInformation; } -} \ No newline at end of file +}