Skip to content

Commit 2dbf2c6

Browse files
author
Okubanjo Oluwafunsho
committed
Added support for create customer
You can now create customers using the laravel package
1 parent a755f77 commit 2dbf2c6

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/Paystack.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,27 @@ public function updatePlan($plan_code){
340340

341341
}
342342

343-
343+
/**
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,
356+
357+
];
358+
359+
$this->setRequestOptions();
360+
361+
return $this->setGetResponse('/customer', $data)->getResponse();
362+
363+
}
344364

345365
}
346366

0 commit comments

Comments
 (0)