Consult
This operation consists of sending a reference and Payvalida responds with the information of the amount. This reference can be associated with a purchase or recharge order with the document number.

Field
Type
required
Description
reference
int (pathParam)
yes
reference of the query provided by the client.
name
string (queryParam)
yes
Name of the payment network
checksum
string
(queryParam)
yes
Check string, calculated with SHA512(name + reference + FIXED_HASH)
//Consult payment of a order
> curl https://sandbox-cashin.payvalida.com/v1/orders/73841?name=BEVALIDA_343&checksum=BBDC08FFE37B956468D21DC1083DA05F1FED7FDA494C765C2EC58EF11B5D95FA7C1E801F1CD8739F16C8006F5802A97F6E3E5036FE5F3FE9C2AD5F9DDB46383B
//Consult of recharge
> curl https://sandbox-cashin.payvalida.com/v1/orders/9999999999?name=BEVALIDA_343&checksum=AA1762CAF3371DBC391B5B09FAB26F3DB88C2B2218371A7DAEBE1382DB0B00CC0D64BF221920C782287CD49CEBF32987D554E8DBA3DE0DD8731F93AB549B9A6EField
Struct
Type
Description
CODE
-
string
Response code 0000 for OK.
DESC
-
string
Description of the response
DATA
-
-
payment data
LASTNAME1
DATA
string
User's first last name **
LASTNAME2
DATA
string
User's second last name **
AMOUNT
DATA
double
Payment amount (If the amount is zero in the POST operation payvalida will acept any amount over this value)
DESCRIPTION
DATA
string
payment description **
DI
DATA
string
User's id number **
COMMERCE
DATA
string
Name of the commerce to which the payment is associated, if it is a payvalida account recharge, the commerce will be Payvalida.
REFERENCE
DATA
string
Reference number sent **
TYPEDI
DATA
string
User's type id **
NAME
DATA
string
User's name **
//payment order
{
"CODE": "0000",
"TEXT": "OK",
"DATA": {
"LASTNAME1": "",
"LASTNAME2": "",
"AMOUNT": 3002.0,
"DESCRIPTION": "Compra 29143_1 (Prueba...)",
"DI": "99999999",
"COMMERCE": "Kuanto Test",
"REFERENCE": "73841",
"TYPEDI": "",
"NAME": ""
}
}
//Acount recharge
{
"CODE": "0000",
"TEXT": "OK",
"DATA": {
"LASTNAME1": "Test",
"LASTNAME2": "Colombia",
"AMOUNT": 0.0,
"DESCRIPTION": "",
"DI": "9999999999",
"COMMERCE": "Payvalida",
"REFERENCE": "9999999999",
"TYPEDI": "CEDULA DE CIUDADANIA",
"NAME": "Payvalida Null"
}
}the ** fields can be empty
When the amount in response is ZERO, in these cases Payvalida will accept any value greater than zero sent by the network for that transaction. In cases where the operations have amounts greater than ZERO, Payvalida will only accept transactions with amounts equal to that indicated in the operation.
Examples:
GO
package main
import (
"crypto/sha512"
"encoding/hex"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
reference := "9999999999"
red := "COMPLETAR" //Cambiar por nombre de red
fixedHash := "COMPLETAR" //Completar con el fixedHash
checksum := sha512.Sum512([]byte(red + reference + fixedHash))
url := "https://sandbox-cashin.payvalida.com/v1/orders/" + reference + "?name=" + red + "&checksum=" + hex.EncodeToString(checksum[:])
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();
$reference = "9999999999";
$red = "Completar"; //Cambiar por nombre de red
$fixedHash = "Completar"; //Cambiar por la credencial otorgada
$key = $red . $reference . $fixedHash
$checksum = hash('sha512', $key);
curl_setopt_array($curl, array(
CURLOPT_URL => "https://sandbox-cashin.payvalida.com/v1/orders/" . $reference ."?name=" . $red . "&checksum=" . $checksum,
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://sandbox-cashin.payvalida.com/v1/orders/9999999999?name=BEVALIDA_343&checksum=AA1762CAF3371DBC391B5B09FAB26F3DB88C2B2218371A7DAEBE1382DB0B00CC0D64BF221920C782287CD49CEBF32987D554E8DBA3DE0DD8731F93AB549B9A6E")
.method("GET", null)
.build();
Response response = client.newCall(request).execute();Python
import requests
import hashlib
reference = "9999999999"
red = "COMPLETAR" //Cambiar por nombre de red
fixedHash = "COMPLETAR" //Completar con el fixedHash
key = red + reference + fixedHash
checksum = hashlib.sha512(bytes(key, 'utf-8')).hexdigest()
url = "https://sandbox-cashin.payvalida.com/v1/orders/"+reference+"?name="+red+"&checksum="+checksum
payload={}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)Última actualización
¿Te fue útil?