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