Code Duplication    Length = 15-15 lines in 2 locations

Instapago/Api.php 2 locations

@@ 162-176 (lines=15) @@
159
   *
160
   * @return array<string> Respuesta de Instapago
161
   */
162
  public function query($id_pago)
163
  {
164
      (new Validator())->query()->validate([
165
      'id' => $id_pago,
166
    ]);
167
168
      $fields = [
169
      'KeyID'        => $this->keyId, //required
170
      'PublicKeyId'  => $this->publicKeyId, //required
171
      'id'           => $id_pago, //required
172
    ];
173
174
      $obj = $this->curlTransaccion('payment', $fields, 'GET');
175
      $result = $this->checkResponseCode($obj);
176
177
      return $result;
178
  }
179
@@ 190-204 (lines=15) @@
187
   *
188
   * @return array<string> Respuesta de Instapago
189
   */
190
  public function cancel($id_pago)
191
  {
192
      (new Validator())->query()->validate([
193
      'id' => $id_pago,
194
    ]);
195
196
      $fields = [
197
      'KeyID'        => $this->keyId, //required
198
      'PublicKeyId'  => $this->publicKeyId, //required
199
      'id'           => $id_pago, //required
200
    ];
201
202
      $obj = $this->curlTransaccion('payment', $fields, 'DELETE');
203
      $result = $this->checkResponseCode($obj);
204
205
      return $result;
206
  }
207