Code Duplication    Length = 15-15 lines in 2 locations

Instapago/Api.php 2 locations

@@ 158-172 (lines=15) @@
155
   * @return \ArrayObject<string, string> Respuesta de Instapago
156
   * @throws Exceptions\InstapagoException
157
   */
158
  public function query($id) {
159
    $validator = (new Validator())->query()->validate([
160
      'id' => $id
161
    ]);
162
163
    $fields = [
164
      'KeyID'        => $this->keyId, //required
165
      'PublicKeyId'  => $this->publicKeyId, //required
166
      'id'           => $id, //required
167
    ];
168
169
    $obj = $this->curlTransaccion('payment', $fields, 'GET');
170
    $result = $this->checkResponseCode($obj);
171
    return $result;
172
  }
173
174
  /**
175
   * Cancelar Pago
@@ 182-196 (lines=15) @@
179
   * @return \ArrayObject<string, string> Respuesta de Instapago
180
   * @throws Exceptions\InstapagoException
181
   */
182
  public function cancel($id) {
183
    $validator = (new Validator())->query()->validate([
184
      'id' => $id
185
    ]);
186
187
    $fields = [
188
      'KeyID'        => $this->keyId, //required
189
      'PublicKeyId'  => $this->publicKeyId, //required
190
      'id'           => $id, //required
191
    ];
192
193
    $obj = $this->curlTransaccion('payment', $fields, 'DELETE');
194
    $result = $this->checkResponseCode($obj);
195
    return $result;
196
  }
197
198
  /**
199
   * Realiza Transaccion