Code Duplication    Length = 17-18 lines in 2 locations

src/Api.php 2 locations

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