| @@ 345-358 (lines=14) @@ | ||
| 342 | /** |
|
| 343 | * Create a customer |
|
| 344 | */ |
|
| 345 | public function createCustomer() |
|
| 346 | { |
|
| 347 | $data = [ |
|
| 348 | "email" => request()->email, |
|
| 349 | "first_name" => request()->fname, |
|
| 350 | "last_name" => request()->lname, |
|
| 351 | "phone" => request()->phone, |
|
| 352 | "metadata" => request()->additional_info /* key => value pairs array */ |
|
| 353 | ||
| 354 | ]; |
|
| 355 | ||
| 356 | $this->setRequestOptions(); |
|
| 357 | return $this->setHttpResponse('/customer', 'POST', $data)->getResponse(); |
|
| 358 | } |
|
| 359 | ||
| 360 | /** |
|
| 361 | * Fetch a customer based on id or code |
|
| @@ 376-389 (lines=14) @@ | ||
| 373 | * @param $customer_id |
|
| 374 | * @return array |
|
| 375 | */ |
|
| 376 | public function updateCustomer($customer_id) |
|
| 377 | { |
|
| 378 | $data = [ |
|
| 379 | "email" => request()->email, |
|
| 380 | "first_name" => request()->fname, |
|
| 381 | "last_name" => request()->lname, |
|
| 382 | "phone" => request()->phone, |
|
| 383 | "metadata" => request()->additional_info /* key => value pairs array */ |
|
| 384 | ||
| 385 | ]; |
|
| 386 | ||
| 387 | $this->setRequestOptions(); |
|
| 388 | return $this->setHttpResponse('/customer/'. $customer_id, 'PUT', $data)->getResponse(); |
|
| 389 | } |
|
| 390 | ||
| 391 | /** |
|
| 392 | * Export transactions in .CSV |
|