| @@ 378-391 (lines=14) @@ | ||
| 375 | /** |
|
| 376 | * Create a customer |
|
| 377 | */ |
|
| 378 | public function createCustomer() |
|
| 379 | { |
|
| 380 | $data = [ |
|
| 381 | "email" => request()->email, |
|
| 382 | "first_name" => request()->fname, |
|
| 383 | "last_name" => request()->lname, |
|
| 384 | "phone" => request()->phone, |
|
| 385 | "metadata" => request()->additional_info /* key => value pairs array */ |
|
| 386 | ||
| 387 | ]; |
|
| 388 | ||
| 389 | $this->setRequestOptions(); |
|
| 390 | return $this->setHttpResponse('/customer', 'POST', $data)->getResponse(); |
|
| 391 | } |
|
| 392 | ||
| 393 | /** |
|
| 394 | * Fetch a customer based on id or code |
|
| @@ 409-424 (lines=16) @@ | ||
| 406 | * @param $customer_id |
|
| 407 | * @return array |
|
| 408 | */ |
|
| 409 | public function updateCustomer($customer_id) |
|
| 410 | { |
|
| 411 | $data = [ |
|
| 412 | "email" => request()->email, |
|
| 413 | "first_name" => request()->fname, |
|
| 414 | "last_name" => request()->lname, |
|
| 415 | "phone" => request()->phone, |
|
| 416 | "metadata" => request()->additional_info /* key => value pairs array */ |
|
| 417 | ||
| 418 | ]; |
|
| 419 | ||
| 420 | $this->setRequestOptions(); |
|
| 421 | return $this->setHttpResponse('/customer/'. $customer_id, 'PUT', $data)->getResponse(); |
|
| 422 | } |
|
| 423 | ||
| 424 | /** |
|
| 425 | * Export transactions in .CSV |
|
| 426 | * @return array |
|
| 427 | */ |
|