Code Duplication    Length = 15-15 lines in 2 locations

Instapago/Api.php 2 locations

@@ 150-164 (lines=15) @@
147
   * @return \ArrayObject<string, string> Respuesta de Instapago
148
   * @throws Exceptions\InstapagoException
149
   */
150
  public function query($id_pago) {
151
    (new Validator())->query()->validate([
152
      'id' => $id_pago
153
    ]);
154
155
    $fields = [
156
      'KeyID'        => $this->keyId, //required
157
      'PublicKeyId'  => $this->publicKeyId, //required
158
      'id'           => $id_pago, //required
159
    ];
160
161
    $obj = $this->curlTransaccion('payment', $fields, 'GET');
162
    $result = $this->checkResponseCode($obj);
163
    return $result;
164
  }
165
166
  /**
167
   * Cancelar Pago
@@ 174-188 (lines=15) @@
171
   * @return \ArrayObject<string, string> Respuesta de Instapago
172
   * @throws Exceptions\InstapagoException
173
   */
174
  public function cancel($id_pago) {
175
    (new Validator())->query()->validate([
176
      'id' => $id_pago
177
    ]);
178
179
    $fields = [
180
      'KeyID'        => $this->keyId, //required
181
      'PublicKeyId'  => $this->publicKeyId, //required
182
      'id'           => $id_pago, //required
183
    ];
184
185
    $obj = $this->curlTransaccion('payment', $fields, 'DELETE');
186
    $result = $this->checkResponseCode($obj);
187
    return $result;
188
  }
189
190
  /**
191
   * Realiza Transaccion