File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public static function validateLuhn($number)
46
46
* @param mixed $target The object to set parameters on
47
47
* @param array $parameters An array of parameters to set
48
48
*/
49
- public static function initialize (& $ target , $ parameters )
49
+ public static function initialize ($ target , $ parameters )
50
50
{
51
51
if (is_array ($ parameters )) {
52
52
foreach ($ parameters as $ key => $ value ) {
Original file line number Diff line number Diff line change @@ -161,6 +161,7 @@ public function setCardReference($value)
161
161
public function getAmount()
162
162
{
163
163
$ amount = $ this ->getParameter ('amount ' );
164
+ <<<<<<< HEAD
164
165
$ message = 'Please specify amount as a string or float, '
165
166
. 'with decimal places (e.g. \'10.00 \' to represent $10.00). ' ;
166
167
@@ -195,6 +196,16 @@ public function getAmount()
195
196
$ decimal_count = strlen (substr (strrchr ((string )$ amount , '. ' ), 1 ));
196
197
if ($ decimal_count > $ this ->getCurrencyDecimalPlaces ()) {
197
198
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
+ >>>>>>> 66 a1999f3b20f4466855326220b6e42f49426548
198
209
}
199
210
200
211
return $ this ->formatCurrency ($ amount );
You can’t perform that action at this time.
0 commit comments