Code Duplication    Length = 17-18 lines in 2 locations

src/Api.php 2 locations

@@ 236-253 (lines=18) @@
233
     * @param array $params
234
     * @return array
235
     */
236
    public function refundTransaction(array $params)
237
    {
238
        $supportedParams = [
239
            'store_uid' => $this->options['store_uid'],
240
            'uid' => null,
241
            'key' => null,
242
            'cost' => null,
243
        ];
244
245
        $params = array_filter(array_replace(
246
            $supportedParams,
247
            array_intersect_key($params, $supportedParams)
248
        ));
249
250
        return $this->doRequest(
251
            $this->encrypter->encryptRequest($this->options['store_uid'], $params, 'api/refund')
252
        );
253
    }
254
255
    /**
256
     * cancelTransaction.
@@ 261-277 (lines=17) @@
258
     * @param array $params
259
     * @return array
260
     */
261
    public function cancelTransaction(array $params)
262
    {
263
        $supportedParams = [
264
            'store_uid' => $this->options['store_uid'],
265
            'uid' => null,
266
            'key' => null,
267
        ];
268
269
        $params = array_filter(array_replace(
270
            $supportedParams,
271
            array_intersect_key($params, $supportedParams)
272
        ));
273
274
        return $this->doRequest(
275
            $this->encrypter->encryptRequest($this->options['store_uid'], $params, 'api/refundcancel')
276
        );
277
    }
278
279
    /**
280
     * verifyHash.