双卡支付(v2)
检索支付(两张卡)
通过 GET /v2/payments/ 检索由两张卡出资的支付,包括每张卡的金额和交易。
GET
/
payments
/
{payment_id}
检索支付(v2)
curl --request GET \
--url https://api-sandbox.y.uno/v2/payments/{payment_id} \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v2/payments/{payment_id}"
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'public-api-key': '<api-key>', 'private-secret-key': '<api-key>'}
};
fetch('https://api-sandbox.y.uno/v2/payments/{payment_id}', 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-sandbox.y.uno/v2/payments/{payment_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$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-sandbox.y.uno/v2/payments/{payment_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
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-sandbox.y.uno/v2/payments/{payment_id}")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v2/payments/{payment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "7c1b6e2a-5f3d-4a8e-9b21-3e4f5a6b7c8d",
"account_id": "493e9374-510a-4201-9e09-de669d75f256",
"description": "Order paid with two cards",
"country": "BR",
"status": "SUCCEEDED",
"sub_status": "APPROVED",
"merchant_order_id": "order-10045",
"created_at": "2026-10-27T14:02:11.120Z",
"updated_at": "2026-10-27T14:02:12.300Z",
"split_payment_methods": true,
"payment_methods_count": 2,
"sdk_action_required": false,
"amount": {
"currency": "BRL",
"value": 300
},
"checkout": {
"session": null
},
"payment_method": {
"capture": true,
"account_updater": false,
"payment_methods": [
{
"sequence": 1,
"type": "CARD",
"amount": {
"currency": "BRL",
"value": 200
},
"transactions": [
{
"id": "d2a4f6b8-1c3e-4a5b-8d7f-9e0a1b2c3d4e",
"type": "PURCHASE",
"status": "SUCCEEDED",
"category": "CARD",
"amount": 200,
"provider_id": "YUNO_TEST_PAYMENT_GATEWAY",
"response_code": "SUCCEEDED",
"response_message": "Transaction successful",
"reason": null,
"description": null,
"merchant_reference": null,
"three_d_secure_action_required": false,
"created_at": "2026-10-27T14:02:11.402Z",
"updated_at": "2026-10-27T14:02:12.118Z"
}
]
},
{
"sequence": 2,
"type": "CARD",
"amount": {
"currency": "BRL",
"value": 100
},
"transactions": [
{
"id": "e3b5a7c9-2d4f-4b6c-9e8a-0f1b2c3d4e5f",
"type": "PURCHASE",
"status": "SUCCEEDED",
"category": "CARD",
"amount": 100,
"provider_id": "YUNO_TEST_PAYMENT_GATEWAY",
"response_code": "SUCCEEDED",
"response_message": "Transaction successful",
"reason": null,
"description": null,
"merchant_reference": null,
"three_d_secure_action_required": false,
"created_at": "2026-10-27T14:02:11.402Z",
"updated_at": "2026-10-27T14:02:12.118Z"
}
]
}
]
},
"customer_payer": {
"id": "cfae0941-7234-427a-a739-ef4fce966c79",
"first_name": "Ana",
"last_name": "Souza",
"email": "ana.souza@example.com"
},
"workflow": "DIRECT",
"callback_url": "https://merchant.example.com/checkout/return",
"metadata": []
}
此请求使用请求路径中的
id,检索通过创建支付(两张卡)创建的支付。基础 URL 在 sandbox 中为 https://api-sandbox.y.uno/v2,在生产环境中为 https://api.y.uno/v2。
响应中包含 split_payment_methods: true、payment_methods_count: 2,并在 payment_method.payment_methods 中为每张卡提供一个条目,每个条目都有其 sequence(1 或 2)、type、amount 和 transactions。卡本身没有独立的状态:请从每张卡的交易中读取该卡的结果,从支付级别的 status 和 sub_status 中读取支付结果。请参阅使用两张卡支付。
对于通过
POST /v1/payments 创建的支付,请使用 v1 请求 GET /v1/payments/{payment_id}。v1 响应将支付作为一个整体显示,而不是按卡显示。授权
响应
支付
由两张卡共同支付的支付。
支付的汇总状态。参见使用两张卡支付。
此页面对您有帮助吗?
⌘I
检索支付(v2)
curl --request GET \
--url https://api-sandbox.y.uno/v2/payments/{payment_id} \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v2/payments/{payment_id}"
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'public-api-key': '<api-key>', 'private-secret-key': '<api-key>'}
};
fetch('https://api-sandbox.y.uno/v2/payments/{payment_id}', 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-sandbox.y.uno/v2/payments/{payment_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$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-sandbox.y.uno/v2/payments/{payment_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
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-sandbox.y.uno/v2/payments/{payment_id}")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v2/payments/{payment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "7c1b6e2a-5f3d-4a8e-9b21-3e4f5a6b7c8d",
"account_id": "493e9374-510a-4201-9e09-de669d75f256",
"description": "Order paid with two cards",
"country": "BR",
"status": "SUCCEEDED",
"sub_status": "APPROVED",
"merchant_order_id": "order-10045",
"created_at": "2026-10-27T14:02:11.120Z",
"updated_at": "2026-10-27T14:02:12.300Z",
"split_payment_methods": true,
"payment_methods_count": 2,
"sdk_action_required": false,
"amount": {
"currency": "BRL",
"value": 300
},
"checkout": {
"session": null
},
"payment_method": {
"capture": true,
"account_updater": false,
"payment_methods": [
{
"sequence": 1,
"type": "CARD",
"amount": {
"currency": "BRL",
"value": 200
},
"transactions": [
{
"id": "d2a4f6b8-1c3e-4a5b-8d7f-9e0a1b2c3d4e",
"type": "PURCHASE",
"status": "SUCCEEDED",
"category": "CARD",
"amount": 200,
"provider_id": "YUNO_TEST_PAYMENT_GATEWAY",
"response_code": "SUCCEEDED",
"response_message": "Transaction successful",
"reason": null,
"description": null,
"merchant_reference": null,
"three_d_secure_action_required": false,
"created_at": "2026-10-27T14:02:11.402Z",
"updated_at": "2026-10-27T14:02:12.118Z"
}
]
},
{
"sequence": 2,
"type": "CARD",
"amount": {
"currency": "BRL",
"value": 100
},
"transactions": [
{
"id": "e3b5a7c9-2d4f-4b6c-9e8a-0f1b2c3d4e5f",
"type": "PURCHASE",
"status": "SUCCEEDED",
"category": "CARD",
"amount": 100,
"provider_id": "YUNO_TEST_PAYMENT_GATEWAY",
"response_code": "SUCCEEDED",
"response_message": "Transaction successful",
"reason": null,
"description": null,
"merchant_reference": null,
"three_d_secure_action_required": false,
"created_at": "2026-10-27T14:02:11.402Z",
"updated_at": "2026-10-27T14:02:12.118Z"
}
]
}
]
},
"customer_payer": {
"id": "cfae0941-7234-427a-a739-ef4fce966c79",
"first_name": "Ana",
"last_name": "Souza",
"email": "ana.souza@example.com"
},
"workflow": "DIRECT",
"callback_url": "https://merchant.example.com/checkout/return",
"metadata": []
}