Skip to content

Commit 8397c83

Browse files
committed
Conflicts: src/Omnipay/Common/Message/AbstractRequest.php
2 parents 4cee98e + 66a1999 commit 8397c83

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/Omnipay/Common/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static function validateLuhn($number)
4646
* @param mixed $target The object to set parameters on
4747
* @param array $parameters An array of parameters to set
4848
*/
49-
public static function initialize(&$target, $parameters)
49+
public static function initialize($target, $parameters)
5050
{
5151
if (is_array($parameters)) {
5252
foreach ($parameters as $key => $value) {

src/Omnipay/Common/Message/AbstractRequest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ public function setCardReference($value)
161161
public function getAmount()
162162
{
163163
$amount = $this->getParameter('amount');
164+
<<<<<<< HEAD
164165
$message = 'Please specify amount as a string or float, '
165166
. 'with decimal places (e.g. \'10.00\' to represent $10.00).';
166167

@@ -195,6 +196,16 @@ public function getAmount()
195196
$decimal_count = strlen(substr(strrchr((string)$amount, '.'), 1));
196197
if ($decimal_count > $this->getCurrencyDecimalPlaces()) {
197198
throw new InvalidRequestException('Amount precision is too high for currency.');
199+
=======
200+
if ($amount !== null) {
201+
if (!is_float($amount) &&
202+
$this->getCurrencyDecimalPlaces() > 0 &&
203+
false === strpos((string) $amount, '.')) {
204+
throw new InvalidRequestException(
205+
'Please specify amount as a string or float, ' .
206+
'with decimal places (e.g. \'10.00\' to represent $10.00).'
207+
);
208+
>>>>>>> 66a1999f3b20f4466855326220b6e42f49426548
198209
}
199210

200211
return $this->formatCurrency($amount);

0 commit comments

Comments
 (0)