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