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