|
@@ 347-363 (lines=17) @@
|
| 344 |
|
* Create a customer |
| 345 |
|
* @return array |
| 346 |
|
*/ |
| 347 |
|
public function createCustomer(){ |
| 348 |
|
|
| 349 |
|
$data = [ |
| 350 |
|
|
| 351 |
|
"email" => request()->email, |
| 352 |
|
"first_name" => request()->fname, |
| 353 |
|
"last_name" => request()->lname, |
| 354 |
|
"phone" => request()->phone, |
| 355 |
|
"metadata" => request()->addtional_info /* key => value pairs array */ |
| 356 |
|
|
| 357 |
|
]; |
| 358 |
|
|
| 359 |
|
$this->setRequestOptions(); |
| 360 |
|
|
| 361 |
|
return $this->setGetResponse('/customer', $data)->getResponse(); |
| 362 |
|
|
| 363 |
|
} |
| 364 |
|
|
| 365 |
|
/** |
| 366 |
|
* Fetch a customer based on id or code |
|
@@ 383-399 (lines=17) @@
|
| 380 |
|
* @param $customer_id |
| 381 |
|
* @return array |
| 382 |
|
*/ |
| 383 |
|
public function updateCustomer($customer_id){ |
| 384 |
|
|
| 385 |
|
$data = [ |
| 386 |
|
|
| 387 |
|
"email" => request()->email, |
| 388 |
|
"first_name" => request()->fname, |
| 389 |
|
"last_name" => request()->lname, |
| 390 |
|
"phone" => request()->phone, |
| 391 |
|
"metadata" => request()->addtional_info /* key => value pairs array */ |
| 392 |
|
|
| 393 |
|
]; |
| 394 |
|
|
| 395 |
|
$this->setRequestOptions(); |
| 396 |
|
|
| 397 |
|
return $this->setGetResponse('/customer/'. $customer_id, $data)->getResponse(); |
| 398 |
|
|
| 399 |
|
} |
| 400 |
|
|
| 401 |
|
/** |
| 402 |
|
* Export tranactions in .CSV |