@@ -94,8 +94,9 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | |
| 96 | 96 | public function CreateAddress($label = null){ |
| 97 | - if(!is_null($label)) |
|
| 98 | - $params = ['label'=>$label]; |
|
| 97 | + if(!is_null($label)) { |
|
| 98 | + $params = ['label'=>$label]; |
|
| 99 | + } |
|
| 99 | 100 | $response = $this->call('accounts/create',$params); |
| 100 | 101 | return new AccountResponse($response); |
| 101 | 102 | } |
@@ -209,19 +210,23 @@ discard block |
||
| 209 | 210 | */ |
| 210 | 211 | |
| 211 | 212 | public function SendPayment($to, $amount, $from=null, $fee=null, $fee_per_byte=null){ |
| 212 | - if(!isset($amount)) |
|
| 213 | - throw new ParameterError("Amount required."); |
|
| 213 | + if(!isset($amount)) { |
|
| 214 | + throw new ParameterError("Amount required."); |
|
| 215 | + } |
|
| 214 | 216 | |
| 215 | 217 | $params = array( |
| 216 | 218 | 'to'=>$to, |
| 217 | 219 | 'amount'=>$amount |
| 218 | 220 | ); |
| 219 | - if(!is_null($from)) |
|
| 220 | - $params['from'] = $from; |
|
| 221 | - if(!is_null($fee)) |
|
| 222 | - $params['fee'] = $fee; |
|
| 223 | - if(!is_null($fee_per_byte)) |
|
| 224 | - $params['fee_per_byte'] = $fee_per_byte; |
|
| 221 | + if(!is_null($from)) { |
|
| 222 | + $params['from'] = $from; |
|
| 223 | + } |
|
| 224 | + if(!is_null($fee)) { |
|
| 225 | + $params['fee'] = $fee; |
|
| 226 | + } |
|
| 227 | + if(!is_null($fee_per_byte)) { |
|
| 228 | + $params['fee_per_byte'] = $fee_per_byte; |
|
| 229 | + } |
|
| 225 | 230 | $response = $this->call('payment',$params); |
| 226 | 231 | return new PaymentResponse($response); |
| 227 | 232 | } |
@@ -239,12 +244,15 @@ discard block |
||
| 239 | 244 | $params = array( |
| 240 | 245 | 'recipients'=>json_encode($recipients) |
| 241 | 246 | ); |
| 242 | - if(!is_null($from)) |
|
| 243 | - $params['from'] = $from; |
|
| 244 | - if(!is_null($fee)) |
|
| 245 | - $params['fee'] = $fee; |
|
| 246 | - if(!is_null($fee_per_byte)) |
|
| 247 | - $params['fee_per_byte'] = $fee_per_byte; |
|
| 247 | + if(!is_null($from)) { |
|
| 248 | + $params['from'] = $from; |
|
| 249 | + } |
|
| 250 | + if(!is_null($fee)) { |
|
| 251 | + $params['fee'] = $fee; |
|
| 252 | + } |
|
| 253 | + if(!is_null($fee_per_byte)) { |
|
| 254 | + $params['fee_per_byte'] = $fee_per_byte; |
|
| 255 | + } |
|
| 248 | 256 | $response = $this->call('sendmany',$params); |
| 249 | 257 | return new PaymentResponse($response); |
| 250 | 258 | } |