Code Duplication    Length = 13-13 lines in 2 locations

src/MtnMomo.php 2 locations

@@ 85-97 (lines=13) @@
82
    }
83
84
85
    public function getTransaction(string $transactionId)
86
    {
87
        $headers = [
88
            'Authorization'             => 'Bearer ' . $this->getToken() ,
89
            'Content-Type'              => 'application/json',
90
            "X-Target-Environment"      => $this->config->targetEnvironment,
91
            'Ocp-Apim-Subscription-Key' => $this->config->getValue(static::PRODUCT, 'primaryKey')
92
        ];
93
        
94
        $url = $this->requestUrl('getTransaction', ['referenceId'=> $transactionId]);
95
96
        return $this->request('get', $url, $params = [], $headers);
97
    }
98
 
99
    /**
100
     * Make a requestToPay (collection product) or transfer (disbursement product) or transfer (remittance product)
@@ 149-161 (lines=13) @@
146
     * @param [type] $mobileNumber
147
     * @return void
148
     */
149
    public function accountHolderActive($mobileNumber)
150
    {
151
        $headers = [
152
            'Authorization'             => 'Bearer ' . $this->getToken() ,
153
            'Content-Type'              => 'application/json',
154
            "X-Target-Environment"      => $this->config->targetEnvironment,
155
            'Ocp-Apim-Subscription-Key' => $this->config->getValue(static::PRODUCT, 'primaryKey')
156
        ];
157
158
        $url = $this->requestUrl('accountholderActive', ['accountHolderId'=> $mobileNumber]) ;
159
  
160
        return $this->request('get', $url, $params = [], $headers);
161
    }
162
    
163
    
164
    abstract protected function requestUrl(string $endpointName, array $params = []) : string;