Simular o pagamento de uma cobrança de teste
curl --request POST \
--url https://v4pay-api.vercel.app/checkout/{txid}/simular-pagamentoimport requests
url = "https://v4pay-api.vercel.app/checkout/{txid}/simular-pagamento"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://v4pay-api.vercel.app/checkout/{txid}/simular-pagamento', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v4pay-api.vercel.app/checkout/{txid}/simular-pagamento",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://v4pay-api.vercel.app/checkout/{txid}/simular-pagamento"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://v4pay-api.vercel.app/checkout/{txid}/simular-pagamento")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/checkout/{txid}/simular-pagamento")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"simulado": true,
"status_no_motor": "RECEIVED"
}
}{
"error": {
"message": "<string>"
}
}Checkout (público)
Simular o pagamento de uma cobrança de teste
Só para cobrança criada em modo teste. Pede ao ambiente de testes do motor de pagamentos que dê a cobrança como paga, como se um Pix real tivesse caído. Dali em diante o caminho é o de produção: o motor entrega o webhook, a cobrança vira paid e o webhook do lojista é disparado. É o botão “Simular pagamento” do checkout. Sem autenticação, como o resto do checkout; cobrança de produção é recusada.
POST
/
checkout
/
{txid}
/
simular-pagamento
Simular o pagamento de uma cobrança de teste
curl --request POST \
--url https://v4pay-api.vercel.app/checkout/{txid}/simular-pagamentoimport requests
url = "https://v4pay-api.vercel.app/checkout/{txid}/simular-pagamento"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://v4pay-api.vercel.app/checkout/{txid}/simular-pagamento', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v4pay-api.vercel.app/checkout/{txid}/simular-pagamento",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://v4pay-api.vercel.app/checkout/{txid}/simular-pagamento"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://v4pay-api.vercel.app/checkout/{txid}/simular-pagamento")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/checkout/{txid}/simular-pagamento")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"simulado": true,
"status_no_motor": "RECEIVED"
}
}{
"error": {
"message": "<string>"
}
}