Skip to content

Commit ff4fded

Browse files
author
Okubanjo Oluwafunsho
committed
Support to update customer's details
You can now update customer’s details based on their id or code
1 parent 6ae32d4 commit ff4fded

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/Paystack.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public function createCustomer(){
352352
"first_name" => request()->fname,
353353
"last_name" => request()->lname,
354354
"phone" => request()->phone,
355-
"metadata" => request()->addtional_info,
355+
"metadata" => request()->addtional_info /* key => value pairs array */
356356

357357
];
358358

@@ -387,6 +387,29 @@ public function fetchCustomer($customer_id){
387387

388388
}
389389

390+
/**
391+
* Update a customer's details based on their id or code
392+
* @param $customer_id
393+
* @return array
394+
*/
395+
public function updateCustomer($customer_id){
396+
397+
$data = [
398+
399+
"email" => request()->email,
400+
"first_name" => request()->fname,
401+
"last_name" => request()->lname,
402+
"phone" => request()->phone,
403+
"metadata" => request()->addtional_info /* key => value pairs array */
404+
405+
];
406+
407+
$this->setRequestOptions();
408+
409+
return $this->setGetResponse('/customer/'. $customer_id, $data)->getResponse();
410+
411+
}
412+
390413
}
391414

392415

0 commit comments

Comments
 (0)