Consultar
Consulta los detalles de una orden registrada.
Producción: https://api.payvalida.com/api/v3/porders/{order}
curl --location --request GET 'https://api-test.payvalida.com/api/v3/porders/9022932?merchant=kuanto&checksum=7CA708050F7F5B3EB5B9FD271D375DCEFCA71BDEFDF91C96A4C38F906EFA133E95675D332279C89F999B1909ECF2EBCA7EC177ACED6EA56D1A72244145E377B7'
{
"CODE": "0000",
"DESC": "OK",
"DATA": {
"CURRENCY": "COP",
"NOTIFICATION_RESPONSE": "{\"CODE\":\"0002\",\"DESC\":\"Checksum diferente\"}",
"UDPATE_DATE": "2020-11-27 15:29:35",
"CREATION_DATE": "2020-11-27 15:20:55",
"STATE": "APROBADA",
"PAYMNENT_METHOD": "Tarjeta de Credito",
"EMAIL": "someone@example.com",
"LIFE_TIME": "75h",
"ORDER": "9022932",
"CODE": 1934038,
"AMOUNT": "200.00",
"DESCRIPTION": "TEST TRANSACTION AT",
"REFERENCE": "43568287",
"checkout": "sandbox-checkout.payvalida.com?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJNRVJDSEFOVF9DRUwiOiIzMTYzODg3MzQwIiwiTUVSQ0hBTlRfQ09ERSI6NzMsIk9SREVSX0NPREUiOjE5MzQwMzgsIk1FUkNIQU5UX0VNQUlMIjoiZWZyYW5jb0BwYXl2YWxpZGEuY29tIiwiTUVSQ0hBTlRfTE9HTyI6Imh0dHBzOi8vdGVzdC1pbWFnZXMucGF5dmFsaWRhLmNvbS92YWxpZGRhd2ViL2xvZ29fbWVyY2hhbnQva3VhbnRvL2xvZ28xNTk4NTM4MTEyMjkyLmpwZyIsIk1FUkNIQU5UX1VSTF9SRVRVUk4iOiJodHRwczovL3BsdXMuZ29vZ2xlLmNvbS8rZ29vZ2xlIiwiTUVSQ0hBTlRfTkFNRSI6Ikt1YW50byBUZXN0IiwiRVhQSVJBVElPTiI6IjMwLzExLzIwMjAiLCJPUkRFUl9CUklFRiI6IlRFU1QgVFJBTlNBQ1RJT04gQVQiLCJNRVJDSEFOVF9URUwiOiI0NDQ5OTY5IiwiT1JERVJfQ1VSUkVOQ1kiOiJDT1AiLCJPUkRFUl9BTU9VVCI6IjIwMC4wMCIsIk1FUkNIQU5UX0lEIjoia3VhbnRvIiwiT1JERVJfUkVGRVJFTkNFIjoiNDM1NjgyODciLCJPUkRFUl9NRVRIT0QiOiIiLCJVU0VSX0RJIjoiIiwiVVNFUl9UWVBFX0RJIjoiIiwiVVNFUl9OQU1FIjoiIiwiUkVESVJFQ1RfVElNRU9VVCI6IiIsIk1FUkNIQU5UX1RFTVBMQVRFIjoidjQiLCJleHAiOjE2MDY3Nzg0NTUsImlzcyI6ImF1dGgwIn0.G-hqojyCQVss3aYILwwZY-vtz2O5v9jF0T0_MWA-mwQ",
"TRANSACTION": {
"DATE": "2020-11-27T20:28:58Z",
"RESPONSE_CODE": "APROBADA",
"QUOTES": "2",
"ACCOUNT_TYPE": "CREDITO",
"CUS": "_12757866",
"INVOICE_NUMBER": "12757866",
"FRANCHISE": "MasterCard",
"RESPONSE": "Aprobada",
"CARD_NUMBER": "************8783",
"ERROR": ""
}
}
}
curl --location --request GET 'https://api-test.payvalida.com/api/v3/porders/prue303459?merchant=kuanto&checksum=cheksuminvalido&aditionalinfo=cuspse'
{ "CODE": "0000", "DESC": "OK", "DATA": { "CURRENCY": "COP", "NOTIFICATION_RESPONSE": "Error al procesar los datos", "UDPATE_DATE": "2022-02-07 10:48:21", "CREATION_DATE": "2022-02-07 10:45:57", "STATE": "APROBADA", "PAYMNENT_METHOD": "PSE", "EMAIL": "lestupinan@payvalida.com", "LIFE_TIME": "445h", "ORDER": "prue303459", "CODE": 2202776, "AMOUNT": "120.00", "DESCRIPTION": "prueb040", "REFERENCE": "80011572", "checkout": "sandbox-checkout.payvalida.com?token=tokencheckout", "TRANSACTION": {}, "ADITIONAL_INFO": { "CUS": "2539443" } } }
Si el campo aditionalinfo no es enviado en el request, no aparecerá el campo ADITIONAL_INFO en el response. Si este campo es enviado, llegará vacío junto con el campo CUS dentro de éste por defecto, a excepción de un pago exitoso con PSE en el cual se enviará el número del cus.
La identificación del comercio (merchant) y FIXED_HASH, se proporcionan al momento de crear una cuenta en nuestra plataforma.
Ejemplos
GO
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api-test.payvalida.com/api/v3/porders/9022932?merchant=kuanto&checksum=7CA708050F7F5B3EB5B9FD271D375DCEFCA71BDEFDF91C96A4C38F906EFA133E95675D332279C89F999B1909ECF2EBCA7EC177ACED6EA56D1A72244145E377B7"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api-test.payvalida.com/api/v3/porders/9022932?merchant=kuanto&checksum=7CA708050F7F5B3EB5B9FD271D375DCEFCA71BDEFDF91C96A4C38F906EFA133E95675D332279C89F999B1909ECF2EBCA7EC177ACED6EA56D1A72244145E377B7",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api-test.payvalida.com/api/v3/porders/9022932?merchant=kuanto&checksum=7CA708050F7F5B3EB5B9FD271D375DCEFCA71BDEFDF91C96A4C38F906EFA133E95675D332279C89F999B1909ECF2EBCA7EC177ACED6EA56D1A72244145E377B7")
.method("GET", null)
.build();
Response response = client.newCall(request).execute();
Python
import http.client
import mimetypes
conn = http.client.HTTPSConnection("api-test.payvalida.com")
payload = ''
headers = {}
conn.request("GET", "/api/v3/porders/9022932?merchant=kuanto&checksum=7CA708050F7F5B3EB5B9FD271D375DCEFCA71BDEFDF91C96A4C38F906EFA133E95675D332279C89F999B1909ECF2EBCA7EC177ACED6EA56D1A72244145E377B7", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
JavaScript
var myHeaders = new Headers();
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api-test.payvalida.com/api/v3/porders/9022932?merchant=kuanto&checksum=7CA708050F7F5B3EB5B9FD271D375DCEFCA71BDEFDF91C96A4C38F906EFA133E95675D332279C89F999B1909ECF2EBCA7EC177ACED6EA56D1A72244145E377B7", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Última actualización