| @@ 416-429 (lines=14) @@ | ||
| 413 | /** |
|
| 414 | * Create a customer |
|
| 415 | */ |
|
| 416 | public function createCustomer() |
|
| 417 | { |
|
| 418 | $data = [ |
|
| 419 | "email" => request()->email, |
|
| 420 | "first_name" => request()->fname, |
|
| 421 | "last_name" => request()->lname, |
|
| 422 | "phone" => request()->phone, |
|
| 423 | "metadata" => request()->additional_info /* key => value pairs array */ |
|
| 424 | ||
| 425 | ]; |
|
| 426 | ||
| 427 | $this->setRequestOptions(); |
|
| 428 | return $this->setHttpResponse('/customer', 'POST', $data)->getResponse(); |
|
| 429 | } |
|
| 430 | ||
| 431 | /** |
|
| 432 | * Fetch a customer based on id or code |
|
| @@ 447-460 (lines=14) @@ | ||
| 444 | * @param $customer_id |
|
| 445 | * @return array |
|
| 446 | */ |
|
| 447 | public function updateCustomer($customer_id) |
|
| 448 | { |
|
| 449 | $data = [ |
|
| 450 | "email" => request()->email, |
|
| 451 | "first_name" => request()->fname, |
|
| 452 | "last_name" => request()->lname, |
|
| 453 | "phone" => request()->phone, |
|
| 454 | "metadata" => request()->additional_info /* key => value pairs array */ |
|
| 455 | ||
| 456 | ]; |
|
| 457 | ||
| 458 | $this->setRequestOptions(); |
|
| 459 | return $this->setHttpResponse('/customer/'. $customer_id, 'PUT', $data)->getResponse(); |
|
| 460 | } |
|
| 461 | ||
| 462 | /** |
|
| 463 | * Export transactions in .CSV |
|