Registar um conector de pagamento
RegistosPOST /payments/registrations
Exchange a payment enrollment token for a connector session token
The token binds the session to one tenant. A request may assert tenant_id, and is refused when it differs from the token's tenant. operational_methods lists the supported methods the connector can actually complete; a skeleton provider declares none.
Corpo application/json
tokenOne-time payment connector enrollment token
namesupported_methodsoperational_methodscurrencyhostnameagent_versiontenant_id
Devolve
201 Connector registered
Erros 400
curl -X POST "$CONNECTOR_API/payments/registrations" \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"token": "token",
"name": "Ana Matsinhe",
"supported_methods": [
"supported method"
],
"operational_methods": [
"operational method"
],
"currency": "MZN",
"hostname": "hostname",
"agent_version": "agent version",
"tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6"
}'
# Sem comando CLI equivalente; use cURL ou HTTP directo.
const res = await fetch("$CONNECTOR_API/payments/registrations", {
method: "POST",
headers: {
Authorization: "Bearer sk_test_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
"token": "token",
"name": "Ana Matsinhe",
"supported_methods": [
"supported method"
],
"operational_methods": [
"operational method"
],
"currency": "MZN",
"hostname": "hostname",
"agent_version": "agent version",
"tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6"
})
});
const data = await res.json();
import requests
res = requests.post(
"$CONNECTOR_API/payments/registrations",
headers={
"Authorization": "Bearer sk_test_..."
},
json={
"token": "token",
"name": "Ana Matsinhe",
"supported_methods": [
"supported method"
],
"operational_methods": [
"operational method"
],
"currency": "MZN",
"hostname": "hostname",
"agent_version": "agent version",
"tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6"
}
)
data = res.json()
body := strings.NewReader(`{
"token": "token",
"name": "Ana Matsinhe",
"supported_methods": [
"supported method"
],
"operational_methods": [
"operational method"
],
"currency": "MZN",
"hostname": "hostname",
"agent_version": "agent version",
"tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6"
}`)
req, _ := http.NewRequest("POST", "$CONNECTOR_API/payments/registrations", body)
req.Header.Set("Authorization", "Bearer sk_test_...")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
Connector registered