Intentos de pago
curl --request GET \
--url https://api.onepay.la/v1/payments/{payment_id}/intents \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onepay.la/v1/payments/{payment_id}/intents"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onepay.la/v1/payments/{payment_id}/intents', 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://api.onepay.la/v1/payments/{payment_id}/intents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.onepay.la/v1/payments/{payment_id}/intents"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onepay.la/v1/payments/{payment_id}/intents")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onepay.la/v1/payments/{payment_id}/intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "9e028bd9-755f-4069-8742-7727d0dc4047",
"status": "succeeded",
"currency": "COP",
"amount": 10000,
"amount_label": "$10.000",
"payment_method_type": "CARD",
"payment_method_id": "9e028bd9-74b0-4eda-a121-ab3d59909ce7",
"network_id": "ntw_987654321",
"transaction_id": "txn_abc123xyz",
"remarks": {
"code": "approved",
"message": "Pago aprobado"
},
"is_test": true,
"created_at": "2025-01-20T01:48:54.000000Z",
"paid_at": "2025-01-20T01:49:10.000000Z"
},
{
"id": "8f139e2a-6b5c-4d7e-9f01-23a456789abc",
"status": "failed",
"currency": "COP",
"amount": 10000,
"amount_label": "$10.000",
"payment_method_type": "PSE",
"payment_method_id": "8f139e2a-6b5c-4d7e-9f01-23a456789abc",
"network_id": null,
"transaction_id": null,
"remarks": {
"code": "declined",
"message": "Fondos insuficientes"
},
"is_test": true,
"created_at": "2025-01-20T01:45:22.000000Z",
"paid_at": null
}
]
Intentos de pago
Endpoint para obtener la lista de intentos asociados a un pago en el sistema de OnePay.
GET
/
payments
/
{payment_id}
/
intents
Intentos de pago
curl --request GET \
--url https://api.onepay.la/v1/payments/{payment_id}/intents \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onepay.la/v1/payments/{payment_id}/intents"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onepay.la/v1/payments/{payment_id}/intents', 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://api.onepay.la/v1/payments/{payment_id}/intents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.onepay.la/v1/payments/{payment_id}/intents"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onepay.la/v1/payments/{payment_id}/intents")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onepay.la/v1/payments/{payment_id}/intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "9e028bd9-755f-4069-8742-7727d0dc4047",
"status": "succeeded",
"currency": "COP",
"amount": 10000,
"amount_label": "$10.000",
"payment_method_type": "CARD",
"payment_method_id": "9e028bd9-74b0-4eda-a121-ab3d59909ce7",
"network_id": "ntw_987654321",
"transaction_id": "txn_abc123xyz",
"remarks": {
"code": "approved",
"message": "Pago aprobado"
},
"is_test": true,
"created_at": "2025-01-20T01:48:54.000000Z",
"paid_at": "2025-01-20T01:49:10.000000Z"
},
{
"id": "8f139e2a-6b5c-4d7e-9f01-23a456789abc",
"status": "failed",
"currency": "COP",
"amount": 10000,
"amount_label": "$10.000",
"payment_method_type": "PSE",
"payment_method_id": "8f139e2a-6b5c-4d7e-9f01-23a456789abc",
"network_id": null,
"transaction_id": null,
"remarks": {
"code": "declined",
"message": "Fondos insuficientes"
},
"is_test": true,
"created_at": "2025-01-20T01:45:22.000000Z",
"paid_at": null
}
]
ID del pago cuyo historial de intentos consultarás. Crear pago.
[
{
"id": "9e028bd9-755f-4069-8742-7727d0dc4047",
"status": "succeeded",
"currency": "COP",
"amount": 10000,
"amount_label": "$10.000",
"payment_method_type": "CARD",
"payment_method_id": "9e028bd9-74b0-4eda-a121-ab3d59909ce7",
"network_id": "ntw_987654321",
"transaction_id": "txn_abc123xyz",
"remarks": {
"code": "approved",
"message": "Pago aprobado"
},
"is_test": true,
"created_at": "2025-01-20T01:48:54.000000Z",
"paid_at": "2025-01-20T01:49:10.000000Z"
},
{
"id": "8f139e2a-6b5c-4d7e-9f01-23a456789abc",
"status": "failed",
"currency": "COP",
"amount": 10000,
"amount_label": "$10.000",
"payment_method_type": "PSE",
"payment_method_id": "8f139e2a-6b5c-4d7e-9f01-23a456789abc",
"network_id": null,
"transaction_id": null,
"remarks": {
"code": "declined",
"message": "Fondos insuficientes"
},
"is_test": true,
"created_at": "2025-01-20T01:45:22.000000Z",
"paid_at": null
}
]
Was this page helpful?
⌘I