Code Duplication    Length = 12-13 lines in 2 locations

src/Paystack.php 2 locations

@@ 439-451 (lines=13) @@
436
     * Export transactions in .CSV
437
     * @return array
438
     */
439
    public function exportTransactions( $data = null )
440
    {
441
        if ($data == null) {
442
          $data = [
443
              "from" => request()->from,
444
              "to" => request()->to,
445
              'settled' => request()->settled
446
          ];
447
        }
448
449
        $this->setRequestOptions();
450
        return $this->setHttpResponse('/transaction/export', 'GET', $data)->getResponse();
451
    }
452
453
    /**
454
     * Create a subscription to a plan from a customer.
@@ 510-521 (lines=12) @@
507
     * Enable a subscription using the subscription code and token
508
     * @return array
509
     */
510
    public function enableSubscription( $data = null )
511
    {
512
        if ($data == null) {
513
          $data = [
514
              "code" => request()->code,
515
              "token" => request()->token,
516
          ];
517
        }
518
519
        $this->setRequestOptions();
520
        return $this->setHttpResponse('/subscription/enable', 'POST', $data)->getResponse();
521
    }
522
523
    /**
524
     * Disable a subscription using the subscription code and token