@@ -178,13 +178,13 @@ public function setCardReference($value)
178
178
179
179
public function toFloat ($ value )
180
180
{
181
- if ( ! is_string ($ value ) && ! is_int ($ value ) && ! is_float ($ value )) {
181
+ if (! is_string ($ value ) && ! is_int ($ value ) && ! is_float ($ value )) {
182
182
throw new InvalidRequestException ('Data type is not a valid decimal number. ' );
183
183
}
184
184
185
185
if (is_string ($ value )) {
186
186
// Validate generic number, with optional sign and decimals.
187
- if ( ! preg_match ('/^[-]?[0-9]+(\.[0-9]*)?$/ ' , $ value )) {
187
+ if (! preg_match ('/^[-]?[0-9]+(\.[0-9]*)?$/ ' , $ value )) {
188
188
throw new InvalidRequestException ('String is not a valid decimal number. ' );
189
189
}
190
190
}
@@ -210,20 +210,20 @@ public function getAmount()
210
210
if (is_int ($ amount ) || (is_string ($ amount ) && false === strpos ((string ) $ amount , '. ' ))) {
211
211
throw new InvalidRequestException (
212
212
'Please specify amount as a string or float, '
213
- . 'with decimal places (e.g. \'10.00 \' to represent $10.00). '
213
+ . 'with decimal places (e.g. \'10.00 \' to represent $10.00). '
214
214
);
215
215
};
216
216
}
217
217
218
218
$ amount = $ this ->toFloat ($ amount );
219
219
220
220
// Check for a negative amount.
221
- if ( ! $ this ->negativeAmountAllowed && $ amount < 0 ) {
221
+ if (! $ this ->negativeAmountAllowed && $ amount < 0 ) {
222
222
throw new InvalidRequestException ('A negative amount is not allowed. ' );
223
223
}
224
224
225
225
// Check for a zero amount.
226
- if ( ! $ this ->zeroAmountAllowed && $ amount === 0.0 ) {
226
+ if (! $ this ->zeroAmountAllowed && $ amount === 0.0 ) {
227
227
throw new InvalidRequestException ('A zero amount is not allowed. ' );
228
228
}
229
229
0 commit comments