Tipos de eventos
Eventos
Los eventos son la forma en que OrkestaPay notificará que está sucediendo con los pagos de tu comercio.
Estos eventos son disparados cuando un pago cambia de estado.
Evento | Descripción |
---|---|
payment.authorize | Ocurre cuando un pago ha sido únicamente autorizado |
payment.cancel | Ocurre cuando un pago autorizado ha sido cancelado |
payment.capture | Ocurre cuando a un pago autorizado se hace efectivo |
payment.purchase | Ocurre cuando un pago se realiza con éxito |
payment.refund | Ocurre cuando a un pago se le realiza un reembolso |
Ejemplo de payment.authorize
{
"data": {
"amount": {
"authorized": 400.55,
"currency": "MXN"
},
"created_at": "1718065073489",
"device_session_id": "df4b8724-7a1d-409e-87b5-c0504b0ec97f",
"order_id": "ord_cd9e4c885b4f45e59f80671b0890d166",
"payment_id": "pay_acb742dd2f1b4dfe8db3fdb56d6f3e17",
"payment_source": {
"payment_method_id": "pym_cac21398fe1b4e058808030eaa1e19b8",
"settings": {
"card": {
"capture": false
}
},
"type": "CARD"
},
"status": "AUTHORIZED",
"transactions": [
{
"amount": 400.55,
"authorization_code": "pi_3PQIPRGYqhDa3Ul632Oo2v0w",
"code": "APPROVED",
"created_at": "1718065079681",
"description": "ord_cd9e4c885b4f45e59f80671b0890d166",
"message": "Approved or completed successfully",
"provider": {
"code": "000",
"merchant_provider_id": "mpv_871e6d7cfd5b489f98ee35ecccb44a43",
"message": "Transaction approved",
"name": "Stripe",
"provider_transaction_id": "pi_3PQIPRGYqhDa3Ul632Oo2v0w"
},
"status": "SUCCESS",
"transaction_id": "ctx_14b98b358e194c4288a2b12796e53e0e",
"type": "AUTHORIZE"
}
],
"updated_at": "1718065073489"
},
"type": "payment",
"type_event": "payment.authorize",
"version": 1
}
Ejemplo de payment.cancel
{
"data": {
"amount": {
"authorized": 400.55,
"currency": "MXN",
"voided": 400.55
},
"created_at": "1718065073000",
"device_session_id": "df4b8724-7a1d-409e-87b5-c0504b0ec97f",
"order_id": "ord_cd9e4c885b4f45e59f80671b0890d166",
"payment_id": "pay_acb742dd2f1b4dfe8db3fdb56d6f3e17",
"payment_source": {
"payment_method_id": "pym_cac21398fe1b4e058808030eaa1e19b8",
"settings": {
"card": {
"capture": false
}
},
"type": "CARD"
},
"status": "CANCELLED",
"transactions": [
{
"amount": 400.55,
"authorization_code": "pi_3PQIPRGYqhDa3Ul632Oo2v0w",
"code": "APPROVED",
"created_at": "1718065157000",
"description": "",
"message": "",
"provider": {
"code": "000",
"merchant_provider_id": "mpv_871e6d7cfd5b489f98ee35ecccb44a43",
"message": "Approved or completed successfully",
"name": "Stripe",
"provider_transaction_id": "pi_3PQIPRGYqhDa3Ul632Oo2v0w"
},
"status": "SUCCESS",
"transaction_id": "ctx_14b98b358e194c4288a2b12796e53e0e",
"type": "VOID"
},
{
"amount": 400.55,
"authorization_code": "pi_3PQIPRGYqhDa3Ul632Oo2v0w",
"code": "APPROVED",
"created_at": "1718065080000",
"description": "ord_cd9e4c885b4f45e59f80671b0890d166",
"message": "Approved or completed successfully",
"provider": {
"code": "000",
"merchant_provider_id": "mpv_871e6d7cfd5b489f98ee35ecccb44a43",
"message": "Transaction approved",
"name": "Stripe",
"provider_transaction_id": "pi_3PQIPRGYqhDa3Ul632Oo2v0w"
},
"status": "SUCCESS",
"transaction_id": "ctx_14b98b358e194c4288a2b12796e53e0e",
"type": "AUTHORIZE"
}
],
"updated_at": "1718065157000"
},
"type": "payment",
"type_event": "payment.void",
"version": 1
}
Ejemplo de payment.capture
{
"data": {
"amount": {
"authorized": 450.55,
"captured": 200.55,
"currency": "MXN"
},
"created_at": "1718065643000",
"device_session_id": "df4b8724-7a1d-409e-87b5-c0504b0ec97f",
"order_id": "ord_cd9e4c885b4f45e59f80671b0890d166",
"payment_id": "pay_3ad5e6c4657b4762a786a319e0b2aafc",
"payment_source": {
"payment_method_id": "pym_cac21398fe1b4e058808030eaa1e19b8",
"settings": {
"card": {
"capture": false
}
},
"type": "CARD"
},
"status": "COMPLETED",
"transactions": [
{
"amount": 200.55,
"authorization_code": "pi_3PQIYaGYqhDa3Ul61ueMktLE",
"code": "APPROVED",
"created_at": "1718065652000",
"description": "Steel Lead connect withdrawal",
"message": "",
"provider": {
"code": "000",
"merchant_provider_id": "mpv_871e6d7cfd5b489f98ee35ecccb44a43",
"message": "Approved or completed successfully",
"name": "Stripe",
"provider_transaction_id": "pi_3PQIYaGYqhDa3Ul61ueMktLE"
},
"status": "SUCCESS",
"transaction_id": "ctx_2d671738d981448bbecc1c24059d49ca",
"type": "CAPTURE"
},
{
"amount": 450.55,
"authorization_code": "pi_3PQIYaGYqhDa3Ul61ueMktLE",
"code": "APPROVED",
"created_at": "1718065646000",
"description": "ord_cd9e4c885b4f45e59f80671b0890d166",
"message": "Approved or completed successfully",
"provider": {
"code": "000",
"merchant_provider_id": "mpv_871e6d7cfd5b489f98ee35ecccb44a43",
"message": "Transaction approved",
"name": "Stripe",
"provider_transaction_id": "pi_3PQIYaGYqhDa3Ul61ueMktLE"
},
"status": "SUCCESS",
"transaction_id": "ctx_2d671738d981448bbecc1c24059d49ca",
"type": "AUTHORIZE"
}
],
"updated_at": "1718065652000"
},
"type": "payment",
"type_event": "payment.capture",
"version": 1
}
Ejemplo de payment.purchase
{
"data": {
"amount": {
"currency": "MXN"
},
"created_at": "1716502905015",
"order_id": "ord_e0947c76f00d436e8668a154acc8ead5",
"payment_id": "pay_80f964944d544873827dd534ca14a0dd",
"payment_source": {
"payment_method_id": "pym_7f9af613a053412dab251afa38b2a2b3",
"settings": {
"card": {
"capture": true
}
},
"type": "CARD"
},
"status": "FAILED",
"transactions": [
{
"amount": 1000,
"code": "GENERIC_FAILURE",
"created_at": "1716502906283",
"description": "Corporis molestiae nisi ut molestias doloribus corporis eum.",
"message": "Transaction could not be executed",
"provider": {
"code": "999",
"merchant_provider_id": "mpv_e18994e300b641969cca71a21740ef27",
"message": "Exception occurred during execution on the exchange: Exchange[D76278659CF3798-0000000000000003]",
"name": "openpay"
},
"status": "FAILED",
"transaction_id": "ctx_95e6292080d948cdaa9c6bdb965f7bef",
"type": "PURCHASE"
}
],
"updated_at": "1716502905015"
},
"event_type": "payment.purchase",
"type": "payment",
"version": 1
}
Ejemplo de payment.refund
{
"data": {
"amount": 1000,
"authorization_code": "trck7tl8vszccb9hq6op",
"code": "APPROVED",
"created_at": "1716504505217",
"description": "Product Steel Soap bandwidth Plastic",
"message": "Approved or completed successfully",
"provider": {
"code": "000",
"merchant_provider_id": "mpv_47879b3636ce48d993b500ee2e9323bb",
"message": "",
"name": "Openpay",
"provider_transaction_id": "trck7tl8vszccb9hq6op"
},
"status": "COMPLETED",
"transaction_id": "af02757d59394327aaa45c58661ec052",
"type": "REFUND"
},
"event_type": "payment.refund",
"type": "payment",
"version": 1
}
Updated 3 days ago