Code Duplication    Length = 14-16 lines in 2 locations

src/Paystack.php 2 locations

@@ 359-372 (lines=14) @@
356
    /**
357
     * Create a customer
358
     */
359
    public function createCustomer()
360
    {
361
        $data = [
362
            "email" => request()->email,
363
            "first_name" => request()->fname,
364
            "last_name" => request()->lname,
365
            "phone" => request()->phone,
366
            "metadata" => request()->additional_info /* key => value pairs array */
367
368
        ];
369
370
        $this->setRequestOptions();
371
        return $this->setHttpResponse('/customer', 'POST', $data)->getResponse();
372
    }
373
374
    /**
375
     * Fetch a customer based on id or code
@@ 390-405 (lines=16) @@
387
     * @param $customer_id
388
     * @return array
389
     */
390
    public function updateCustomer($customer_id)
391
    {
392
        $data = [
393
            "email" => request()->email,
394
            "first_name" => request()->fname,
395
            "last_name" => request()->lname,
396
            "phone" => request()->phone,
397
            "metadata" => request()->additional_info /* key => value pairs array */
398
399
        ];
400
401
        $this->setRequestOptions();
402
        return $this->setHttpResponse('/customer/'. $customer_id, 'PUT', $data)->getResponse();
403
    }
404
405
    /**
406
     * Export transactions in .CSV
407
     * @return array
408
     */